Security Scol plugin
|
Interface for domains of authenticated 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 | StaticPrivateKeyLength () const =0 |
Provides the size of the static private key. | |
virtual unsigned int | StaticPublicKeyLength () const =0 |
Provides the size of the static public key. | |
virtual void | GenerateStaticPrivateKey (RandomNumberGenerator &rng, byte *privateKey) const =0 |
Generate static private key in this domain. | |
virtual void | GenerateStaticPublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0 |
Generate a static public key from a private key in this domain. | |
virtual void | GenerateStaticKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const |
Generate a static private/public key pair. | |
virtual unsigned int | EphemeralPrivateKeyLength () const =0 |
Provides the size of ephemeral private key. | |
virtual unsigned int | EphemeralPublicKeyLength () const =0 |
Provides the size of ephemeral public key. | |
virtual void | GenerateEphemeralPrivateKey (RandomNumberGenerator &rng, byte *privateKey) const =0 |
Generate ephemeral private key. | |
virtual void | GenerateEphemeralPublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0 |
Generate ephemeral public key. | |
virtual void | GenerateEphemeralKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const |
Generate private/public key pair. | |
virtual bool | Agree (byte *agreedValue, const byte *staticPrivateKey, const byte *ephemeralPrivateKey, const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, bool validateStaticOtherPublicKey=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 authenticated key agreement protocols.
In an authenticated key agreement protocol, each party has two key pairs. The long-lived key pair is called the static key pair, and the short-lived key pair is called the ephemeral key pair.
Definition at line 3071 of file cryptlib.h.
|
inlinevirtual |
Definition at line 3074 of file cryptlib.h.
|
pure virtual |
Derive agreed value.
agreedValue | a byte buffer for the shared secret |
staticPrivateKey | a byte buffer with your static private key in this domain |
ephemeralPrivateKey | a byte buffer with your ephemeral private key in this domain |
staticOtherPublicKey | a byte buffer with the other party's static public key in this domain |
ephemeralOtherPublicKey | a byte buffer with the other party's ephemeral public key in this domain |
validateStaticOtherPublicKey | 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 ephemeral 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(staticPrivateKey) == StaticPrivateKeyLength()
COUNTOF(ephemeralPrivateKey) == EphemeralPrivateKeyLength()
COUNTOF(staticOtherPublicKey) == StaticPublicKeyLength()
COUNTOF(ephemeralOtherPublicKey) == EphemeralPublicKeyLength()
Implemented in DH2, FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, and MQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >.
|
pure virtual |
Provides the size of the agreed value.
Implemented in DH2, FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, and MQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >.
|
pure virtual |
Provides the size of ephemeral private key.
Implemented in DH2, FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, and MQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >.
|
pure virtual |
Provides the size of ephemeral public key.
Implemented in DH2, FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, and MQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >.
|
virtual |
Generate 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 |
GenerateEphemeralKeyPair() is equivalent to calling GenerateEphemeralPrivateKey() and then GenerateEphemeralPublicKey()
Reimplemented in DH2.
Definition at line 1002 of file cryptlib.cpp.
|
pure virtual |
Generate ephemeral private key.
rng | a RandomNumberGenerator derived class |
privateKey | a byte buffer for the generated private key in this domain |
COUNTOF(privateKey) == PrivateEphemeralKeyLength()
Implemented in DH2, FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, and MQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >.
|
pure virtual |
Generate ephemeral public key.
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 |
COUNTOF(publicKey) == PublicEphemeralKeyLength()
Implemented in DH2, FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, and MQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >.
|
virtual |
Generate a static 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 |
GenerateStaticKeyPair() is equivalent to calling GenerateStaticPrivateKey() and then GenerateStaticPublicKey().
COUNTOF(privateKey) == PrivateStaticKeyLength()
COUNTOF(publicKey) == PublicStaticKeyLength()
Reimplemented in DH2.
Definition at line 996 of file cryptlib.cpp.
|
pure virtual |
Generate static private key in this domain.
rng | a RandomNumberGenerator derived class |
privateKey | a byte buffer for the generated private key in this domain |
COUNTOF(privateKey) == PrivateStaticKeyLength()
Implemented in DH2, FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, and MQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >.
|
pure virtual |
Generate a static 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) == PublicStaticKeyLength()
Implemented in DH2, FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, and MQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >.
|
pure virtual |
Provides the size of the static private key.
Implemented in DH2, FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, and MQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >.
|
pure virtual |
Provides the size of the static public key.
Implemented in DH2, FHMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >, and MQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >.