|
| HMQV_Domain (bool clientRole=true) |
| Construct a HMQV domain.
|
|
| HMQV_Domain (const GroupParameters ¶ms, bool clientRole=true) |
| Construct a HMQV domain.
|
|
| HMQV_Domain (BufferedTransformation &bt, bool clientRole=true) |
| Construct a HMQV domain.
|
|
template<class T1 > |
| HMQV_Domain (T1 v1, bool clientRole=true) |
| Construct a HMQV domain.
|
|
template<class T1 , class T2 > |
| HMQV_Domain (T1 v1, T2 v2, bool clientRole=true) |
| Construct a HMQV domain.
|
|
template<class T1 , class T2 , class T3 > |
| HMQV_Domain (T1 v1, T2 v2, T3 v3, bool clientRole=true) |
| Construct a HMQV domain.
|
|
template<class T1 , class T2 , class T3 , class T4 > |
| HMQV_Domain (T1 v1, T2 v2, T3 v3, T4 v4, bool clientRole=true) |
| Construct a HMQV domain.
|
|
const GroupParameters & | GetGroupParameters () const |
| Retrieves the group parameters for this domain.
|
|
GroupParameters & | AccessGroupParameters () |
| Retrieves the group parameters for this domain.
|
|
CryptoParameters & | AccessCryptoParameters () |
| Retrieves the crypto parameters for this domain.
|
|
unsigned int | AgreedValueLength () const |
| Provides the size of the agreed value.
|
|
unsigned int | StaticPrivateKeyLength () const |
| Provides the size of the static private key.
|
|
unsigned int | StaticPublicKeyLength () const |
| Provides the size of the static public key.
|
|
void | GenerateStaticPrivateKey (RandomNumberGenerator &rng, byte *privateKey) const |
| Generate static private key in this domain.
|
|
void | GenerateStaticPublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const |
| Generate a static public key from a private key in this domain.
|
|
unsigned int | EphemeralPrivateKeyLength () const |
| Provides the size of the ephemeral private key.
|
|
unsigned int | EphemeralPublicKeyLength () const |
| Provides the size of the ephemeral public key.
|
|
void | GenerateEphemeralPrivateKey (RandomNumberGenerator &rng, byte *privateKey) const |
| Generate ephemeral private key in this domain.
|
|
void | GenerateEphemeralPublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const |
| Generate ephemeral public key from a private key in this domain.
|
|
bool | Agree (byte *agreedValue, const byte *staticPrivateKey, const byte *ephemeralPrivateKey, const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey, bool validateStaticOtherPublicKey=true) const |
| Derive agreed value or shared secret.
|
|
Public Member Functions inherited from AuthenticatedKeyAgreementDomain |
virtual void | GenerateStaticKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const |
| Generate a static private/public key pair.
|
|
virtual void | GenerateEphemeralKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const |
| Generate private/public key pair.
|
|
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.
|
|
| 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.
|
|
virtual Clonable * | Clone () const |
| Copies this object.
|
|
template<class GROUP_PARAMETERS, class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
class HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >
Hashed Menezes-Qu-Vanstone in GF(p)
This implementation follows Hugo Krawczyk's HMQV: A High-Performance Secure Diffie-Hellman Protocol. Note: this implements HMQV only. HMQV-C with Key Confirmation is not provided.
- See also
- MQV, HMQV, FHMQV, and AuthenticatedKeyAgreementDomain
- Since
- Crypto++ 5.6.4
Definition at line 23 of file hmqv.h.
template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
template<class T1 , class T2 >
Construct a HMQV domain.
- Template Parameters
-
T1 | template parameter used as a constructor parameter |
T2 | template parameter used as a constructor parameter |
- Parameters
-
v1 | first parameter |
v2 | second parameter |
clientRole | flag indicating initiator or recipient |
v1 and v2 are passed directly to the GROUP_PARAMETERS object.
clientRole = true
indicates initiator, and clientRole = false
indicates recipient or server.
Definition at line 78 of file hmqv.h.
template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
template<class T1 , class T2 , class T3 >
Construct a HMQV domain.
- Template Parameters
-
T1 | template parameter used as a constructor parameter |
T2 | template parameter used as a constructor parameter |
T3 | template parameter used as a constructor parameter |
- Parameters
-
v1 | first parameter |
v2 | second parameter |
v3 | third parameter |
clientRole | flag indicating initiator or recipient |
v1, v2 and v3 are passed directly to the GROUP_PARAMETERS object.
clientRole = true
indicates initiator, and clientRole = false
indicates recipient or server.
Definition at line 94 of file hmqv.h.
template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
template<class T1 , class T2 , class T3 , class T4 >
HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::HMQV_Domain |
( |
T1 | v1, |
|
|
T2 | v2, |
|
|
T3 | v3, |
|
|
T4 | v4, |
|
|
bool | clientRole = true ) |
|
inline |
Construct a HMQV domain.
- Template Parameters
-
T1 | template parameter used as a constructor parameter |
T2 | template parameter used as a constructor parameter |
T3 | template parameter used as a constructor parameter |
T4 | template parameter used as a constructor parameter |
- Parameters
-
v1 | first parameter |
v2 | second parameter |
v3 | third parameter |
v4 | third parameter |
clientRole | flag indicating initiator or recipient |
v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object.
clientRole = true
indicates initiator, and clientRole = false
indicates recipient or server.
Definition at line 112 of file hmqv.h.
template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
unsigned int HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::AgreedValueLength |
( |
| ) |
const |
|
inlinevirtual |
Provides the size of the agreed value.
- Returns
- size of agreed value produced in this domain
The length is calculated using GetEncodedElementSize(false)
, which means the element is encoded in a non-reversible format. A non-reversible format means its a raw byte array, and it lacks presentation format like an ASN.1 BIT_STRING or OCTET_STRING.
Implements AuthenticatedKeyAgreementDomain.
Definition at line 136 of file hmqv.h.
template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
unsigned int HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::StaticPublicKeyLength |
( |
| ) |
const |
|
inlinevirtual |
Provides the size of the static public key.
- Returns
- size of static public keys in this domain
The length is calculated using GetEncodedElementSize(true)
, which means the element is encoded in a reversible format. A reversible format means it has a presentation format, and its an ANS.1 encoded element or point.
Implements AuthenticatedKeyAgreementDomain.
Definition at line 151 of file hmqv.h.
template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
Generate a static public key from a private key in this domain.
- Parameters
-
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 |
The public key is an element or point on the curve, and its stored in a revrsible format. A reversible format means it has a presentation format, and its an ANS.1 encoded element or point.
- Precondition
COUNTOF(publicKey) == PublicStaticKeyLength()
Implements AuthenticatedKeyAgreementDomain.
Definition at line 174 of file hmqv.h.
template<class GROUP_PARAMETERS , class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption, class HASH = SHA512>
bool HMQV_Domain< GROUP_PARAMETERS, COFACTOR_OPTION, HASH >::Agree |
( |
byte * | agreedValue, |
|
|
const byte * | staticPrivateKey, |
|
|
const byte * | ephemeralPrivateKey, |
|
|
const byte * | staticOtherPublicKey, |
|
|
const byte * | ephemeralOtherPublicKey, |
|
|
bool | validateStaticOtherPublicKey = true ) const |
|
inlinevirtual |