Crypto++ 8.7
Free C++ class library of cryptographic schemes
|
Ed25519 signature verification algorithm. More...
#include <xed25519.h>
Public Types | |
typedef Integer | Element |
Public Member Functions | |
ed25519Verifier () | |
Create an ed25519Verifier object. More... | |
ed25519Verifier (const byte y[PUBLIC_KEYLENGTH]) | |
Create an ed25519Verifier object. More... | |
ed25519Verifier (const Integer &y) | |
Create an ed25519Verifier object. More... | |
ed25519Verifier (const X509PublicKey &key) | |
Create an ed25519Verifier object. More... | |
ed25519Verifier (BufferedTransformation ¶ms) | |
Create an ed25519Verifier object. More... | |
ed25519Verifier (const ed25519Signer &signer) | |
Create an ed25519Verifier object. More... | |
PublicKey & | AccessKey () |
Retrieves a reference to a Public Key. More... | |
PublicKey & | AccessPublicKey () |
Retrieves a reference to a Public Key. More... | |
const PublicKey & | GetKey () const |
Retrieves a reference to a Public Key. More... | |
const PublicKey & | GetPublicKey () const |
Retrieves a reference to a Public Key. More... | |
size_t | SignatureLength () const |
Provides the signature length if it only depends on the key. More... | |
size_t | MaxRecoverableLength () const |
Provides the length of longest message that can be recovered. More... | |
size_t | MaxRecoverableLengthFromSignatureLength (size_t signatureLength) const |
Provides the length of longest message that can be recovered from a signature of given length. More... | |
bool | IsProbabilistic () const |
Determines whether a signature scheme requires a random number generator. More... | |
bool | AllowNonrecoverablePart () const |
Determines whether the non-recoverable message part can be signed. More... | |
bool | RecoverablePartFirst () const |
Determines whether the recoverable part must be input before the non-recoverable part. More... | |
ed25519_MessageAccumulator * | NewVerificationAccumulator () const |
Create a new HashTransformation to accumulate the message to be verified. More... | |
void | InputSignature (PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const |
Input signature into a message accumulator. More... | |
bool | VerifyAndRestart (PK_MessageAccumulator &messageAccumulator) const |
Check whether messageAccumulator contains a valid signature and message, and restart messageAccumulator. More... | |
bool | VerifyStream (std::istream &stream, const byte *signature, size_t signatureLen) const |
Check whether input signature is a valid signature for input message. More... | |
DecodingResult | RecoverAndRestart (byte *recoveredMessage, PK_MessageAccumulator &messageAccumulator) const |
Recover a message from its signature. More... | |
Public Member Functions inherited from PK_Verifier | |
virtual PK_MessageAccumulator * | NewVerificationAccumulator () const =0 |
Create a new HashTransformation to accumulate the message to be verified. More... | |
virtual void | InputSignature (PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const =0 |
Input signature into a message accumulator. More... | |
virtual bool | Verify (PK_MessageAccumulator *messageAccumulator) const |
Check whether messageAccumulator contains a valid signature and message. More... | |
virtual bool | VerifyAndRestart (PK_MessageAccumulator &messageAccumulator) const =0 |
Check whether messageAccumulator contains a valid signature and message, and restart messageAccumulator. More... | |
virtual bool | VerifyMessage (const byte *message, size_t messageLen, const byte *signature, size_t signatureLen) const |
Check whether input signature is a valid signature for input message. More... | |
virtual DecodingResult | Recover (byte *recoveredMessage, PK_MessageAccumulator *messageAccumulator) const |
Recover a message from its signature. More... | |
virtual DecodingResult | RecoverAndRestart (byte *recoveredMessage, PK_MessageAccumulator &messageAccumulator) const =0 |
Recover a message from its signature. More... | |
virtual DecodingResult | RecoverMessage (byte *recoveredMessage, const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, const byte *signature, size_t signatureLength) const |
Recover a message from its signature. More... | |
Public Member Functions inherited from PK_SignatureScheme | |
virtual size_t | SignatureLength () const =0 |
Provides the signature length if it only depends on the key. More... | |
virtual size_t | MaxSignatureLength (size_t recoverablePartLength=0) const |
Provides the maximum signature length produced given the length of the recoverable message part. More... | |
virtual size_t | MaxRecoverableLength () const =0 |
Provides the length of longest message that can be recovered. More... | |
virtual size_t | MaxRecoverableLengthFromSignatureLength (size_t signatureLength) const =0 |
Provides the length of longest message that can be recovered from a signature of given length. More... | |
virtual bool | IsProbabilistic () const =0 |
Determines whether a signature scheme requires a random number generator. More... | |
virtual bool | AllowNonrecoverablePart () const =0 |
Determines whether the non-recoverable message part can be signed. More... | |
virtual bool | SignatureUpfront () const |
Determines whether the signature must be input before the message. More... | |
virtual bool | RecoverablePartFirst () const =0 |
Determines whether the recoverable part must be input before the non-recoverable part. More... | |
Public Member Functions inherited from PublicKeyAlgorithm | |
CryptoMaterial & | AccessMaterial () |
Retrieves a reference to a Public Key. More... | |
const CryptoMaterial & | GetMaterial () const |
Retrieves a reference to a Public Key. More... | |
virtual PublicKey & | AccessPublicKey ()=0 |
Retrieves a reference to a Public Key. More... | |
virtual const PublicKey & | GetPublicKey () const |
Retrieves a reference to a Public Key. More... | |
virtual CryptoMaterial & | AccessMaterial ()=0 |
Retrieves a reference to CryptoMaterial. More... | |
virtual const CryptoMaterial & | GetMaterial () const =0 |
Retrieves a reference to CryptoMaterial. More... | |
Public Member Functions inherited from Algorithm | |
Algorithm (bool checkSelfTestStatus=true) | |
Interface for all crypto algorithms. More... | |
virtual std::string | AlgorithmName () const |
Provides the name of this algorithm. More... | |
virtual std::string | AlgorithmProvider () const |
Retrieve the provider of this algorithm. More... | |
Public Member Functions inherited from Clonable | |
virtual Clonable * | Clone () const |
Copies this object. More... | |
Static Public Attributes | |
static const int | PUBLIC_KEYLENGTH = 32 |
static const int | SIGNATURE_LENGTH = 64 |
Ed25519 signature verification algorithm.
Definition at line 712 of file xed25519.h.
typedef Integer ed25519Verifier::Element |
Definition at line 716 of file xed25519.h.
|
inlinevirtual |
Definition at line 718 of file xed25519.h.
|
inline |
Create an ed25519Verifier object.
Definition at line 721 of file xed25519.h.
ed25519Verifier::ed25519Verifier | ( | const byte | y[PUBLIC_KEYLENGTH] | ) |
Create an ed25519Verifier object.
y | public key |
This constructor creates an ed25519Verifier object using existing parameters.
Definition at line 843 of file xed25519.cpp.
ed25519Verifier::ed25519Verifier | ( | const Integer & | y | ) |
Create an ed25519Verifier object.
y | public key |
This constructor creates an ed25519Verifier object using existing parameters.
Definition at line 849 of file xed25519.cpp.
ed25519Verifier::ed25519Verifier | ( | const X509PublicKey & | key | ) |
Create an ed25519Verifier object.
key | X509 public key |
This constructor creates an ed25519Verifier object using an existing public key.
Definition at line 860 of file xed25519.cpp.
ed25519Verifier::ed25519Verifier | ( | BufferedTransformation & | params | ) |
Create an ed25519Verifier object.
params | public and private key |
This constructor creates an ed25519Verifier object using existing parameters. The params
can be created with Save
.
Definition at line 868 of file xed25519.cpp.
ed25519Verifier::ed25519Verifier | ( | const ed25519Signer & | signer | ) |
Create an ed25519Verifier object.
signer | ed25519 signer object |
This constructor creates an ed25519Verifier object using existing parameters. The params
can be created with Save
.
Definition at line 873 of file xed25519.cpp.
|
inline |
Retrieves a reference to a Public Key.
AccessKey() retrieves a non-const reference to a public key.
Definition at line 759 of file xed25519.h.
|
inlinevirtual |
Retrieves a reference to a Public Key.
Implements PublicKeyAlgorithm.
Definition at line 760 of file xed25519.h.
|
inline |
Retrieves a reference to a Public Key.
GetKey() retrieves a const reference to a public key.
Definition at line 764 of file xed25519.h.
|
inlinevirtual |
Retrieves a reference to a Public Key.
Reimplemented from PublicKeyAlgorithm.
Definition at line 765 of file xed25519.h.
|
inlinevirtual |
Provides the signature length if it only depends on the key.
SignatureLength() returns the signature length if it only depends on the key, otherwise 0.
Implements PK_SignatureScheme.
Definition at line 768 of file xed25519.h.
|
inlinevirtual |
Provides the length of longest message that can be recovered.
MaxRecoverableLength() returns the length of longest message that can be recovered, or 0 if this signature scheme does not support message recovery.
Implements PK_SignatureScheme.
Definition at line 769 of file xed25519.h.
|
inlinevirtual |
Provides the length of longest message that can be recovered from a signature of given length.
signatureLength | the length of the signature, in bytes |
MaxRecoverableLengthFromSignatureLength() returns the length of longest message that can be recovered from a signature of given length, or 0 if this signature scheme does not support message recovery.
Implements PK_SignatureScheme.
Definition at line 770 of file xed25519.h.
|
inlinevirtual |
Determines whether a signature scheme requires a random number generator.
if IsProbabilistic() returns false, then NullRNG() can be passed to functions that take RandomNumberGenerator().
Implements PK_SignatureScheme.
Definition at line 774 of file xed25519.h.
|
inlinevirtual |
Determines whether the non-recoverable message part can be signed.
Implements PK_SignatureScheme.
Definition at line 775 of file xed25519.h.
|
inlinevirtual |
Determines whether the recoverable part must be input before the non-recoverable part.
RecoverablePartFirst() determines whether you must input the recoverable part before the non-recoverable part during signing
Implements PK_SignatureScheme.
Definition at line 776 of file xed25519.h.
|
inlinevirtual |
Create a new HashTransformation to accumulate the message to be verified.
NewVerificationAccumulator() can be used with all verification methods. Verify() will automatically delete the accumulator pointer. The caller is responsible for deletion if a method is called that takes a reference.
Implements PK_Verifier.
Definition at line 778 of file xed25519.h.
|
inlinevirtual |
Input signature into a message accumulator.
messageAccumulator | a pointer to a PK_MessageAccumulator derived class |
signature | the signature on the message |
signatureLength | the size of the signature |
Implements PK_Verifier.
Definition at line 782 of file xed25519.h.
|
virtual |
Check whether messageAccumulator contains a valid signature and message, and restart messageAccumulator.
messageAccumulator | a reference to a PK_MessageAccumulator derived class |
VerifyAndRestart() restarts the messageAccumulator
Implements PK_Verifier.
Definition at line 879 of file xed25519.cpp.
bool ed25519Verifier::VerifyStream | ( | std::istream & | stream, |
const byte * | signature, | ||
size_t | signatureLen | ||
) | const |
Check whether input signature is a valid signature for input message.
stream | an std::istream derived class |
signature | a pointer to the signature over the message |
signatureLen | the size of the signature |
VerifyStream() handles large streams. The Stream functions were added to ed25519 for signing and verifying files that are too large for a memory allocation. The functions are not present in other library signers and verifiers.
Definition at line 889 of file xed25519.cpp.
|
inlinevirtual |
Recover a message from its signature.
recoveredMessage | a pointer to the recoverable message part to be verified |
messageAccumulator | a pointer to a PK_MessageAccumulator derived class |
RecoverAndRestart() restarts the messageAccumulator
COUNTOF(recoveredMessage) == MaxRecoverableLengthFromSignatureLength(signatureLength)
Implements PK_Verifier.
Definition at line 803 of file xed25519.h.
|
static |
Definition at line 714 of file xed25519.h.
|
static |
Definition at line 715 of file xed25519.h.