Crypto++ 8.9
Free C++ class library of cryptographic schemes
|
Go to the source code of this file.
Functions | |
int | curve25519_mult (byte publicKey[32], const byte secretKey[32]) |
Generate a public key. | |
int | curve25519_mult (byte sharedKey[32], const byte secretKey[32], const byte othersKey[32]) |
Generate a shared key. | |
int | ed25519_publickey (byte publicKey[32], const byte secretKey[32]) |
Creates a public key from a secret key. | |
int | ed25519_sign (const byte *message, size_t messageLength, const byte secretKey[32], const byte publicKey[32], byte signature[64]) |
Creates a signature on a message. | |
int | ed25519_sign (std::istream &stream, const byte secretKey[32], const byte publicKey[32], byte signature[64]) |
Creates a signature on a message. | |
int | ed25519_sign_open (const byte *message, size_t messageLength, const byte publicKey[32], const byte signature[64]) |
Verifies a signature on a message. | |
int | ed25519_sign_open (std::istream &stream, const byte publicKey[32], const byte signature[64]) |
Verifies a signature on a message. | |
Functions for curve25519 and ed25519 operations
This header provides the entry points into Andrew Moon's curve25519 and ed25519 curve functions. The Crypto++ classes x25519 and ed25519 use the functions. The functions are in the Donna
namespace and are curve25519_mult(), ed25519_publickey(), ed25519_sign() and ed25519_sign_open().
At the moment the hash function for signing is fixed at SHA512.
Definition in file donna.h.
Generate a public key.
publicKey | byte array for the public key |
secretKey | byte array with the private key |
curve25519_mult() generates a public key from an existing secret key. Internally curve25519_mult() performs a scalar multiplication using the base point and writes the result to pubkey
.
Generate a shared key.
sharedKey | byte array for the shared secret |
secretKey | byte array with the private key |
othersKey | byte array with the peer's public key |
curve25519_mult() generates a shared key from an existing secret key and the other party's public key. Internally curve25519_mult() performs a scalar multiplication using the two keys and writes the result to sharedKey
.
Creates a public key from a secret key.
publicKey | byte array for the public key |
secretKey | byte array with the private key |
ed25519_publickey() generates a public key from a secret key. Internally ed25519_publickey() performs a scalar multiplication using the secret key and then writes the result to publicKey
.
int ed25519_sign | ( | const byte * | message, |
size_t | messageLength, | ||
const byte | secretKey[32], | ||
const byte | publicKey[32], | ||
byte | signature[64] ) |
Creates a signature on a message.
message | byte array with the message |
messageLength | size of the message, in bytes |
publicKey | byte array with the public key |
secretKey | byte array with the private key |
signature | byte array for the signature |
ed25519_sign() generates a signature on a message using the public and private keys. The various buffers can be exact sizes, and do not require extra space like when using the NaCl library functions.
At the moment the hash function for signing is fixed at SHA512.
int ed25519_sign | ( | std::istream & | stream, |
const byte | secretKey[32], | ||
const byte | publicKey[32], | ||
byte | signature[64] ) |
Creates a signature on a message.
stream | std::istream derived class |
publicKey | byte array with the public key |
secretKey | byte array with the private key |
signature | byte array for the signature |
ed25519_sign() generates a signature on a message using the public and private keys. The various buffers can be exact sizes, and do not require extra space like when using the NaCl library functions.
This ed25519_sign() overload handles large streams. It was added for signing and verifying files that are too large for a memory allocation.
At the moment the hash function for signing is fixed at SHA512.
int ed25519_sign_open | ( | const byte * | message, |
size_t | messageLength, | ||
const byte | publicKey[32], | ||
const byte | signature[64] ) |
Verifies a signature on a message.
message | byte array with the message |
messageLength | size of the message, in bytes |
publicKey | byte array with the public key |
signature | byte array with the signature |
ed25519_sign_open() verifies a signature on a message using the public key. The various buffers can be exact sizes, and do not require extra space like when using the NaCl library functions.
At the moment the hash function for signing is fixed at SHA512.
Verifies a signature on a message.
stream | std::istream derived class |
publicKey | byte array with the public key |
signature | byte array with the signature |
ed25519_sign_open() verifies a signature on a message using the public key. The various buffers can be exact sizes, and do not require extra space like when using the NaCl library functions.
This ed25519_sign_open() overload handles large streams. It was added for signing and verifying files that are too large for a memory allocation.
At the moment the hash function for signing is fixed at SHA512.