[−]Module cjdns_crypto::sign
Public-key signatures
Security model
The sign()
function is designed to meet the standard
notion of unforgeability for a public-key signature scheme under
chosen-message attacks.
Selected primitive
crypto::sign::sign
is ed25519
, a signature scheme specified in
Ed25519. This function is conjectured to meet the
standard notion of unforgeability for a public-key signature scheme under
chosen-message attacks.
Alternate primitives
crypto_sign | PUBLICKEYBYTES | SECRETKEYBYTES | BYTES |
---|---|---|---|
crypto_sign_ed25519 | 32 | 64 | 64 |
crypto_sign_edwards25519sha512batch | 32 | 64 | 64 |
crypto_sign_edwards25519sha512batch
is a prototype. It has been replaced with
Ed25519 and is only kept here for compatibility reasons.
Example
use sodiumoxide::crypto::sign; let (pk, sk) = sign::gen_keypair(); let data_to_sign = b"some data"; let signed_data = sign::sign(data_to_sign, &sk); let verified_data = sign::verify(&signed_data, &pk).unwrap(); assert!(data_to_sign == &verified_data[..]);
Example (detached signatures)
use sodiumoxide::crypto::sign; let (pk, sk) = sign::gen_keypair(); let data_to_sign = b"some data"; let signature = sign::sign_detached(data_to_sign, &sk); assert!(sign::verify_detached(&signature, data_to_sign, &pk));
Modules
ed25519 |
|
Structs
Error | Signature errors. |
PublicKey |
|
SecretKey |
|
Seed |
|
Signature | Ed25519 signature. |
State | State for multi-part (streaming) computation of signature. |
Constants
PUBLICKEYBYTES | Number of bytes in a |
SECRETKEYBYTES | Number of bytes in a |
SEEDBYTES | Number of bytes in a |
SIGNATUREBYTES | Number of bytes in a |
Traits
Signer | Sign the provided message bytestring using |
Verifier | Verify the provided message bytestring using |
Functions
gen_keypair |
|
keypair_from_seed |
|
sign |
|
sign_detached |
|
verify |
|
verify_detached |
|