DL_PrivateKey_ElGamal< BASE > Struct Template Reference

ElGamal Private Key adapter. More...

Inheritance diagram for DL_PrivateKey_ElGamal< BASE >:

## Public Member Functions

virtual OID | GetAlgorithmID () const
| Retrieves the OID of the algorithm. More...
bool | Validate (RandomNumberGenerator &rng, unsigned int level) const
| Check the key for errors. More...

## Detailed Description

### template<class BASE>
struct DL_PrivateKey_ElGamal< BASE >

ElGamal Private Key adapter.

Template Parameters

  BASE | PrivateKey derived class

DL_PrivateKey_ElGamal provides an override for GetAlgorithmID() to utilize 1.3.14.7.2.1.1. Prior to DL_PrivateKey_ElGamal, the ElGamal keys [mistakenly] used the OID from DSA due to DL_GroupParmaters_GFP(). If you need to `Load` an ElGamal key with the wrong OID then see ElGamal on the Crypto++ wiki.

See also
  Issue 876, Issue 567

Since
  Crypto++ 8.3

Definition at line 171 of file elgamal.h.

## Member Function Documentation

## GetAlgorithmID()

template<class BASE >

virtual OID DL_PrivateKey_ElGamal< BASE >::GetAlgorithmID | ( |  | ) | const

inline virtual

Retrieves the OID of the algorithm.

Returns
  OID of the algorithm

DL_PrivateKey_ElGamal provides an override for GetAlgorithmID() to utilize 1.3.14.7.2.1.1. Prior to DL_PrivateKey_ElGamal, the ElGamal keys [mistakenly] used the OID from DSA due to DL_GroupParmaters_GFP(). If you need to `Load` an ElGamal key with the wrong OID then see ElGamal on the Crypto++ wiki.

See also
  Issue 876, Issue 567

Definition at line 185 of file elgamal.h.

## Validate()

template<class BASE >

bool DL_PrivateKey_ElGamal< BASE >::Validate | ( | RandomNumberGenerator & | rng,
|  | unsigned int | level
| ) |  | const

inline

Check the key for errors.

Parameters

  rng | RandomNumberGenerator for objects which use randomized testing
  level | level of thoroughness

Returns
  true if the tests succeed, false otherwise

There are four levels of thoroughness:

- 0 - using this object won't cause a crash or exception
- 1 - this object will probably function, and encrypt, sign, other operations correctly
- 2 - ensure this object will function correctly, and perform reasonable security checks
- 3 - perform reasonable security checks, and do checks that may take a long time

Level 0 does not require a RandomNumberGenerator. A NullRNG() can be used for level 0. Level 1 may not check for weak keys and such. Levels 2 and 3 are recommended.

Definition at line 206 of file elgamal.h.

The documentation for this struct was generated from the following file:

- elgamal.h