Arduino Cryptography Library
|
Digital signatures based on the elliptic curve modulo 2^255 - 19. More...
#include <Ed25519.h>
Static Public Member Functions | |
static void | sign (uint8_t signature[64], const uint8_t privateKey[32], const uint8_t publicKey[32], const void *message, size_t len) |
Signs a message using a specific Ed25519 private key. More... | |
static bool | verify (const uint8_t signature[64], const uint8_t publicKey[32], const void *message, size_t len) |
Verifies a signature using a specific Ed25519 public key. More... | |
static void | generatePrivateKey (uint8_t privateKey[32]) |
Generates a private key for Ed25519 signing operations. More... | |
static void | derivePublicKey (uint8_t publicKey[32], const uint8_t privateKey[32]) |
Derives the public key from a private key. More... | |
Digital signatures based on the elliptic curve modulo 2^255 - 19.
The first step in creating a digital signature with Ed25519 is to generate a key pair:
The application can store both the private and public key for later signing operations. Or it can store just the private key and then derive the public key at the point where signing is to occur.
Message signing produces a 64-byte signature as follows:
And then to verify the signature:
References: https://tools.ietf.org/html/draft-irtf-cfrg-eddsa-05
|
static |
Derives the public key from a private key.
publicKey | The public key. |
privateKey | The private key. |
Definition at line 256 of file Ed25519.cpp.
|
static |
Generates a private key for Ed25519 signing operations.
privateKey | The resulting private key. |
The private key is generated with RNG.rand(). It is the caller's responsibility to ensure that the global random number pool has sufficient entropy to generate the 32 bytes of the key safely before calling this function.
Definition at line 243 of file Ed25519.cpp.
|
static |
Signs a message using a specific Ed25519 private key.
signature | The signature value. |
privateKey | The private key to use to sign the message. |
publicKey | The public key corresponding to privateKey. |
message | Points to the message to be signed. |
len | The length of the message to be signed. |
Definition at line 127 of file Ed25519.cpp.
|
static |
Verifies a signature using a specific Ed25519 public key.
signature | The signature value to be verified. |
publicKey | The public key to use to verify the signature. |
message | The message whose signature is to be verified. |
len | The length of the message to be verified. |
Definition at line 189 of file Ed25519.cpp.