Security Scol plugin
|
Interface for domains of simple key agreement protocols. More...
#include <cryptlib.h>
Public Member Functions | |
virtual unsigned int | AgreedValueLength () const =0 |
Provides the size of the agreed value. | |
virtual unsigned int | PrivateKeyLength () const =0 |
Provides the size of the private key. | |
virtual unsigned int | PublicKeyLength () const =0 |
Provides the size of the public key. | |
virtual void | GeneratePrivateKey (RandomNumberGenerator &rng, byte *privateKey) const =0 |
Generate private key in this domain. | |
virtual void | GeneratePublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0 |
Generate a public key from a private key in this domain. | |
virtual void | GenerateKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const |
Generate a private/public key pair. | |
virtual bool | Agree (byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const =0 |
Derive agreed value. | |
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 CryptoParameters & | AccessCryptoParameters ()=0 |
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. | |
Interface for domains of simple key agreement protocols.
A key agreement domain is a set of parameters that must be shared by two parties in a key agreement protocol, along with the algorithms for generating key pairs and deriving agreed values.
Definition at line 3012 of file cryptlib.h.
|
inlinevirtual |
Definition at line 3015 of file cryptlib.h.
|
pure virtual |
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()
Implemented in DL_SimpleKeyAgreementDomainBase< T >, DL_SimpleKeyAgreementDomainBase< GROUP_PARAMETERS::Element >, x25519, and XTR_DH.
|
pure virtual |
Provides the size of the agreed value.
Implemented in DL_SimpleKeyAgreementDomainBase< T >, DL_SimpleKeyAgreementDomainBase< GROUP_PARAMETERS::Element >, x25519, and XTR_DH.
|
virtual |
Generate a private/public key pair.
rng | a RandomNumberGenerator derived class |
privateKey | a byte buffer for the generated private key in this domain |
publicKey | a byte buffer for the generated public key in this domain |
GenerateKeyPair() is equivalent to calling GeneratePrivateKey() and then GeneratePublicKey().
COUNTOF(privateKey) == PrivateKeyLength()
COUNTOF(publicKey) == PublicKeyLength()
Definition at line 990 of file cryptlib.cpp.
|
pure virtual |
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()
Implemented in DL_SimpleKeyAgreementDomainBase< T >, DL_SimpleKeyAgreementDomainBase< GROUP_PARAMETERS::Element >, x25519, and XTR_DH.
|
pure virtual |
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()
Implemented in DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >, DL_SimpleKeyAgreementDomainBase< T >, DL_SimpleKeyAgreementDomainBase< GROUP_PARAMETERS::Element >, x25519, and XTR_DH.
|
pure virtual |
Provides the size of the private key.
Implemented in DL_SimpleKeyAgreementDomainBase< T >, DL_SimpleKeyAgreementDomainBase< GROUP_PARAMETERS::Element >, x25519, and XTR_DH.
|
pure virtual |
Provides the size of the public key.
Implemented in DL_SimpleKeyAgreementDomainBase< T >, DL_SimpleKeyAgreementDomainBase< GROUP_PARAMETERS::Element >, x25519, and XTR_DH.