Security Scol plugin
|
Ed25519 signature verification algorithm. More...
#include <xed25519.h>
Public Types | |
typedef Integer | Element |
Public Member Functions | |
CRYPTOPP_CONSTANT (PUBLIC_KEYLENGTH=32) | |
CRYPTOPP_CONSTANT (SIGNATURE_LENGTH=64) | |
ed25519Verifier () | |
Create an ed25519Verifier object. | |
ed25519Verifier (const byte y[PUBLIC_KEYLENGTH]) | |
Create an ed25519Verifier object. | |
ed25519Verifier (const Integer &y) | |
Create an ed25519Verifier object. | |
ed25519Verifier (const X509PublicKey &key) | |
Create an ed25519Verifier object. | |
ed25519Verifier (BufferedTransformation ¶ms) | |
Create an ed25519Verifier object. | |
ed25519Verifier (const ed25519Signer &signer) | |
Create an ed25519Verifier object. | |
PublicKey & | AccessKey () |
Retrieves a reference to a Public Key. | |
PublicKey & | AccessPublicKey () |
Retrieves a reference to a Public Key. | |
const PublicKey & | GetKey () const |
Retrieves a reference to a Public Key. | |
const PublicKey & | GetPublicKey () const |
Retrieves a reference to a Public Key. | |
size_t | SignatureLength () const |
Provides the signature length if it only depends on the key. | |
size_t | MaxRecoverableLength () const |
Provides the length of longest message that can be recovered. | |
size_t | MaxRecoverableLengthFromSignatureLength (size_t signatureLength) const |
Provides the length of longest message that can be recovered from a signature of given length. | |
bool | IsProbabilistic () const |
Determines whether a signature scheme requires a random number generator. | |
bool | AllowNonrecoverablePart () const |
Determines whether the non-recoverable message part can be signed. | |
bool | RecoverablePartFirst () const |
Determines whether the recoverable part must be input before the non-recoverable part. | |
ed25519_MessageAccumulator * | NewVerificationAccumulator () const |
Create a new HashTransformation to accumulate the message to be verified. | |
void | InputSignature (PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const |
Input signature into a message accumulator. | |
bool | VerifyAndRestart (PK_MessageAccumulator &messageAccumulator) const |
Check whether messageAccumulator contains a valid signature and message, and restart messageAccumulator. | |
bool | VerifyStream (std::istream &stream, const byte *signature, size_t signatureLen) const |
Check whether input signature is a valid signature for input message. | |
DecodingResult | RecoverAndRestart (byte *recoveredMessage, PK_MessageAccumulator &messageAccumulator) const |
Recover a message from its signature. | |
Public Member Functions inherited from PK_Verifier | |
virtual bool | Verify (PK_MessageAccumulator *messageAccumulator) const |
Check whether messageAccumulator contains a valid signature and message. | |
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. | |
virtual DecodingResult | Recover (byte *recoveredMessage, PK_MessageAccumulator *messageAccumulator) const |
Recover a message from its signature. | |
virtual DecodingResult | RecoverMessage (byte *recoveredMessage, const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, const byte *signature, size_t signatureLength) const |
Recover a message from its signature. | |
Public Member Functions inherited from PK_SignatureScheme | |
virtual size_t | MaxSignatureLength (size_t recoverablePartLength=0) const |
Provides the maximum signature length produced given the length of the recoverable message part. | |
virtual bool | SignatureUpfront () const |
Determines whether the signature must be input before the message. | |
Public Member Functions inherited from PublicKeyAlgorithm | |
CryptoMaterial & | AccessMaterial () |
Retrieves a reference to a Public Key. | |
const CryptoMaterial & | GetMaterial () const |
Retrieves a reference to a Public Key. | |
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. | |
Protected Attributes | |
ed25519PublicKey | m_key |
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.
|
inlinevirtual |
Determines whether the non-recoverable message part can be signed.
Implements PK_SignatureScheme.
Definition at line 775 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 |
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.
|
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 |
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 |
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 |
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 |
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.
|
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.
|
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.
|
protected |
Definition at line 809 of file xed25519.h.