Fabcoin Core
0.16.2
P2P Digital Currency
|
Discrete Log (DL) simple key agreement base implementation. More...
#include <pubkey.h>
Public Types | |
typedef T | Element |
Public Member Functions | |
virtual | ~DL_SimpleKeyAgreementDomainBase () |
CryptoParameters & | AccessCryptoParameters () |
Retrieves a reference to Crypto Parameters. More... | |
unsigned int | AgreedValueLength () const |
Provides the size of the agreed value. More... | |
unsigned int | PrivateKeyLength () const |
Provides the size of the private key. More... | |
unsigned int | PublicKeyLength () const |
Provides the size of the public key. More... | |
void | GeneratePrivateKey (RandomNumberGenerator &rng, byte *privateKey) const |
Generate private key in this domain. More... | |
void | GeneratePublicKey (RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const |
Generate a public key from a private key in this domain. More... | |
bool | Agree (byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const |
Derive agreed value. More... | |
const Element & | GetGenerator () const |
Retrieves a reference to the group generator. More... | |
Public Member Functions inherited from SimpleKeyAgreementDomain | |
virtual | ~SimpleKeyAgreementDomain () |
virtual void | GenerateKeyPair (RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const |
Generate a private/public key pair. More... | |
Public Member Functions inherited from KeyAgreementAlgorithm | |
virtual | ~KeyAgreementAlgorithm () |
CryptoMaterial & | AccessMaterial () |
Retrieves a reference to Crypto Parameters. More... | |
const CryptoMaterial & | GetMaterial () const |
Retrieves a reference to Crypto Parameters. More... | |
virtual const CryptoParameters & | GetCryptoParameters () const |
Retrieves a reference to Crypto Parameters. More... | |
Public Member Functions inherited from AsymmetricAlgorithm | |
virtual | ~AsymmetricAlgorithm () |
void | BERDecode (BufferedTransformation &bt) |
Loads this object from a BufferedTransformation. More... | |
void | DEREncode (BufferedTransformation &bt) const |
Saves this object to a BufferedTransformation. More... | |
Public Member Functions inherited from Algorithm | |
virtual | ~Algorithm () |
Algorithm (bool checkSelfTestStatus=true) | |
Interface for all crypto algorithms. More... | |
virtual std::string | AlgorithmName () const |
Provides the name of this algorithm. More... | |
Public Member Functions inherited from Clonable | |
virtual | ~Clonable () |
virtual Clonable * | Clone () const |
Copies this object. More... | |
Protected Member Functions | |
virtual const DL_KeyAgreementAlgorithm< Element > & | GetKeyAgreementAlgorithm () const =0 |
virtual DL_GroupParameters< Element > & | AccessAbstractGroupParameters ()=0 |
const DL_GroupParameters< Element > & | GetAbstractGroupParameters () const |
Discrete Log (DL) simple key agreement base implementation.
T | class or type |
typedef T DL_SimpleKeyAgreementDomainBase< T >::Element |
|
inlinevirtual |
|
protectedpure virtual |
Implemented in DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >.
|
inlinevirtual |
Retrieves a reference to Crypto Parameters.
Implements KeyAgreementAlgorithm.
|
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.
Definition at line 1882 of file pubkey.h.
|
inlinevirtual |
Provides the size of the agreed value.
Implements SimpleKeyAgreementDomain.
Definition at line 1863 of file pubkey.h.
|
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.
|
inlineprotected |
|
inline |
|
protectedpure virtual |
Implemented in DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >.
|
inlinevirtual |
Provides the size of the private key.
Implements SimpleKeyAgreementDomain.
Definition at line 1864 of file pubkey.h.
|
inlinevirtual |
Provides the size of the public key.
Implements SimpleKeyAgreementDomain.
Definition at line 1865 of file pubkey.h.