Crypto++ 8.9
Free C++ class library of cryptographic schemes
|
Discrete Log (DL) simple key agreement base implementation. More...
#include <pubkey.h>
Public Types | |
typedef T | Element |
Public Member Functions | |
CryptoParameters & | AccessCryptoParameters () |
Retrieves a reference to Crypto Parameters. | |
unsigned int | AgreedValueLength () const |
Provides the size of the agreed value. | |
unsigned int | PrivateKeyLength () const |
Provides the size of the private key. | |
unsigned int | PublicKeyLength () const |
Provides the size of the public key. | |
void | GeneratePrivateKey (RandomNumberGenerator &rng, byte *privateKey) const |
Generate private key in this domain. | |
void | GeneratePublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const |
Generate a public key from a private key in this domain. | |
bool | Agree (byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const |
Derive agreed value. | |
const Element & | GetGenerator () const |
Retrieves a reference to the group generator. | |
Public Member Functions inherited from SimpleKeyAgreementDomain | |
virtual void | GenerateKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const |
Generate a private/public key pair. | |
Public Member Functions inherited from KeyAgreementAlgorithm | |
CryptoMaterial & | AccessMaterial () |
Retrieves a reference to Crypto Parameters. | |
const CryptoMaterial & | GetMaterial () const |
Retrieves a reference to Crypto Parameters. | |
virtual const CryptoParameters & | GetCryptoParameters () const |
Retrieves a reference to Crypto Parameters. | |
Public Member Functions inherited from Algorithm | |
Algorithm (bool checkSelfTestStatus=true) | |
Interface for all crypto algorithms. | |
virtual std::string | AlgorithmName () const |
Provides the name of this algorithm. | |
virtual std::string | AlgorithmProvider () const |
Retrieve the provider of this algorithm. | |
Public Member Functions inherited from Clonable | |
virtual Clonable * | Clone () const |
Copies this object. | |
Discrete Log (DL) simple key agreement base implementation.
T | class or type |
typedef T DL_SimpleKeyAgreementDomainBase< T >::Element |
|
inlinevirtual |
|
inlinevirtual |
Retrieves a reference to Crypto Parameters.
Implements KeyAgreementAlgorithm.
|
inlinevirtual |
Provides the size of the agreed value.
Implements SimpleKeyAgreementDomain.
|
inlinevirtual |
Provides the size of the private key.
Implements SimpleKeyAgreementDomain.
|
inlinevirtual |
Provides the size of the public key.
Implements SimpleKeyAgreementDomain.
|
inlinevirtual |
Generate private key in this domain.
rng | a RandomNumberGenerator derived class |
privateKey | a byte buffer for the generated private key in this domain |
COUNTOF(privateKey) == PrivateKeyLength()
Implements SimpleKeyAgreementDomain.
|
inlinevirtual |
Generate a public key from a private key in this domain.
rng | a RandomNumberGenerator derived class |
privateKey | a byte buffer with the previously generated private key |
publicKey | a byte buffer for the generated public key in this domain |
COUNTOF(publicKey) == PublicKeyLength()
Implements SimpleKeyAgreementDomain.
|
inlinevirtual |
Derive agreed value.
agreedValue | a byte buffer for the shared secret |
privateKey | a byte buffer with your private key in this domain |
otherPublicKey | a byte buffer with the other party's public key in this domain |
validateOtherPublicKey | a flag indicating if the other party's public key should be validated |
Agree() derives an agreed value from your private keys and couterparty's public keys.
The other party's public key is validated by default. If you have previously validated the static public key, use validateStaticOtherPublicKey=false
to save time.
COUNTOF(agreedValue) == AgreedValueLength()
COUNTOF(privateKey) == PrivateKeyLength()
COUNTOF(otherPublicKey) == PublicKeyLength()
Implements SimpleKeyAgreementDomain.
|
inline |