Crypto++ 7.0 Free C++ class library of cryptographic schemes

Public Types | Public Member Functions | Static Public Attributes | List of all members
ed25519Verifier Struct Reference

Ed25519 signature verification algorithm. More...

Inheritance diagram for ed25519Verifier:

## Public Types
typedef Integer | Element

## Public Member Functions
| ed25519Verifier ()
| Create a ed25519Verifier object.
| ed25519Verifier (const byte y[PUBLIC_KEYLENGTH])
| Create a ed25519Verifier object. More...
| ed25519Verifier (const Integer &y)
| Create a ed25519Verifier object. More...
| ed25519Verifier (BufferedTransformation &params)
| Create a ed25519Verifier object. More...
| ed25519Verifier (const ed25519Signer &signer)
| Create a ed25519Verifier object. More...
PublicKey & | AccessKey ()
PublicKey & | AccessPublicKey ()
| Retrieves a reference to a Public Key. More...
const PublicKey & | GetKey () const
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...
DecodingResult | RecoverAndRestart (byte *recoveredMessage, PK_MessageAccumulator &messageAccumulator) const
| Recover a message from its signature. More...
Public Member Functions inherited from PK_Verifier
virtual bool | Verify (PK_MessageAccumulator *messageAccumulator) const
| Check whether messageAccumulator contains a valid signature and message. 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 | 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 | MaxSignatureLength (size_t recoverablePartLength=0) const
| Provides the maximum signature length produced given the length of the recoverable message part. More...
virtual bool | SignatureUpfront () const
| Determines whether the signature must be input before the message. 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...
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

## Detailed Description

Ed25519 signature verification algorithm.

Since
  Crypto++ 8.0

Definition at line 665 of file xed25519.h.

## Constructor & Destructor Documentation

## ◆ ed25519Verifier() [1/4]

ed25519Verifier::ed25519Verifier | ( | const byte | y[PUBLIC_KEYLENGTH] | ) |

Create a ed25519Verifier object.

Parameters

  y | public key

This constructor creates a ed25519Verifier object using existing parameters.

Note
  The public key is not validated.

Definition at line 779 of file xed25519.cpp.

## ◆ ed25519Verifier() [2/4]

ed25519Verifier::ed25519Verifier | ( | const Integer & | y | ) |

Create a ed25519Verifier object.

Parameters

  y | public key

This constructor creates a ed25519Verifier object using existing parameters.

Note
  The public key is not validated.

Definition at line 785 of file xed25519.cpp.

## ◆ ed25519Verifier() [3/4]

ed25519Verifier::ed25519Verifier | ( | BufferedTransformation & | params | ) |

Create a ed25519Verifier object.

Parameters

  params | public and private key

This constructor creates a ed25519Verifier object using existing parameters. The `params` can be created with `Save`.

Note
  The public key is not validated.

Definition at line 796 of file xed25519.cpp.

## ◆ ed25519Verifier() [4/4]

ed25519Verifier::ed25519Verifier | ( | const ed25519Signer & | signer | ) |

Create a ed25519Verifier object.

Parameters

  signer | ed25519 signer object

This constructor creates a ed25519Verifier object using existing parameters. The `params` can be created with `Save`.

Note
  The public key is not validated.

Definition at line 801 of file xed25519.cpp.

## Member Function Documentation

## ◆ AccessPublicKey()

PublicKey& ed25519Verifier::AccessPublicKey | ( |  | ) |
| inline virtual

Retrieves a reference to a Public Key.

Returns
  a reference to the public key

Implements PublicKeyAlgorithm.

Definition at line 704 of file xed25519.h.

## ◆ GetPublicKey()

const PublicKey& ed25519Verifier::GetPublicKey | ( |  | ) | const
| inline virtual

Retrieves a reference to a Public Key.

Returns
  a const reference the public key

Reimplemented from PublicKeyAlgorithm.

Definition at line 707 of file xed25519.h.

## ◆ SignatureLength()

size_t ed25519Verifier::SignatureLength | ( |  | ) | const
| inline virtual

Provides the signature length if it only depends on the key.

Returns
  the signature length if it only depends on the key, in bytes

SignatureLength() returns the signature length if it only depends on the key, otherwise 0.

Implements PK_SignatureScheme.

Definition at line 710 of file xed25519.h.

## ◆ MaxRecoverableLength()

size_t ed25519Verifier::MaxRecoverableLength | ( |  | ) | const
| inline virtual

Provides the length of longest message that can be recovered.

Returns
  the length of longest message that can be recovered, in bytes

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 711 of file xed25519.h.

## ◆ MaxRecoverableLengthFromSignatureLength()

size_t ed25519Verifier::MaxRecoverableLengthFromSignatureLength | ( | size_t | signatureLength | ) | const
| inline virtual

Provides the length of longest message that can be recovered from a signature of given length.

Parameters

  signatureLength | the length of the signature, in bytes

Returns
  the length of longest message that can be recovered from a signature of given length, 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 712 of file xed25519.h.

## ◆ IsProbabilistic()

bool ed25519Verifier::IsProbabilistic | ( |  | ) | const
| inline virtual

Determines whether a signature scheme requires a random number generator.

Returns
  true if the signature scheme requires a RandomNumberGenerator() to sign

if IsProbabilistic() returns false, then NullRNG() can be passed to functions that take RandomNumberGenerator().

Implements PK_SignatureScheme.

Definition at line 716 of file xed25519.h.

## ◆ AllowNonrecoverablePart()

bool ed25519Verifier::AllowNonrecoverablePart | ( |  | ) | const
| inline virtual

Determines whether the non-recoverable message part can be signed.

Returns
  true if the non-recoverable message part can be signed

Implements PK_SignatureScheme.

Definition at line 717 of file xed25519.h.

## ◆ RecoverablePartFirst()

bool ed25519Verifier::RecoverablePartFirst | ( |  | ) | const
| inline virtual

Determines whether the recoverable part must be input before the non-recoverable part.

Returns
  true if the recoverable part must be input before the non-recoverable part during signing

RecoverablePartFirst() determines whether you must input the recoverable part before the non-recoverable part during signing

Implements PK_SignatureScheme.

Definition at line 718 of file xed25519.h.

## ◆ NewVerificationAccumulator()

ed25519_MessageAccumulator* ed25519Verifier::NewVerificationAccumulator | ( |  | ) | const
| inline virtual

Create a new HashTransformation to accumulate the message to be verified.

Returns
  a pointer to a PK_MessageAccumulator

NewVerificationAccumulator() can be used with all verification methods. Verify() will autimatically 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 720 of file xed25519.h.

## ◆ InputSignature()

void ed25519Verifier::InputSignature | ( | PK_MessageAccumulator & | messageAccumulator,
|  | const byte * | signature,
|  | size_t | signatureLength
| ) |  | const
| inline virtual

Input signature into a message accumulator.

Parameters

  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 724 of file xed25519.h.

## ◆ VerifyAndRestart()

bool ed25519Verifier::VerifyAndRestart | ( | PK_MessageAccumulator & | messageAccumulator | ) | const
| virtual

Check whether messageAccumulator contains a valid signature and message, and restart messageAccumulator.

Parameters

  messageAccumulator | a reference to a PK_MessageAccumulator derived class

Returns
  true if the signature is valid, false otherwise

VerifyAndRestart() restarts the messageAccumulator

Implements PK_Verifier.

Definition at line 807 of file xed25519.cpp.

## ◆ RecoverAndRestart()

DecodingResult ed25519Verifier::RecoverAndRestart | ( | byte * | recoveredMessage,
|  | PK_MessageAccumulator & | messageAccumulator
| ) |  | const
| inline virtual

Recover a message from its signature.

Parameters

  recoveredMessage | a pointer to the recoverable message part to be verified
  messageAccumulator | a pointer to a PK_MessageAccumulator derived class

Returns
  the result of the verification operation

RecoverAndRestart() restarts the messageAccumulator

Precondition
  `COUNTOF(recoveredMessage) == MaxRecoverableLengthFromSignatureLength(signatureLength)`

Implements PK_Verifier.

Definition at line 734 of file xed25519.h.

The documentation for this struct was generated from the following files:

- xed25519.h
- xed25519.cpp