[−][src]Module solana_libra_crypto::signing
An implementation of the associated functions for handling cryptographic signatures for the Libra project.
This is an API for Pure Ed25519 EdDSA signatures.
Warning: This API will soon be updated in the [nextgen
] module.
Example
Note that the signing and verifying functions take an input message of type HashValue
.
use crypto::{hash::*, signing::*}; let mut hasher = TestOnlyHasher::default(); hasher.write("Test message".as_bytes()); let hashed_message = hasher.finish(); let (private_key, public_key) = generate_keypair(); let signature = sign_message(hashed_message, &private_key).unwrap(); assert!(verify_signature(hashed_message, &signature, &public_key).is_ok());
Structs
KeyPair | A public and private key pair. |
PrivateKey | An ed25519 private key. |
PublicKey | An ed25519 public key. |
Signature | An ed25519 signature. |
Functions
batch_verify_signatures | Batch signature verification as described in the original EdDSA article by Bernstein et al. "High-speed high-security signatures". Current implementation works for signatures on the same message and it checks for malleability. |
derive_keypair_from_seed | Derives a keypair |
generate_and_encode_keypair | Generates a random keypair |
generate_genesis_keypair | Generates a well-known keypair |
generate_keypair | Generates a random keypair |
generate_keypair_for_testing | Generates consistent keypair |
generate_keypair_from_rng | Generates a keypair |
generate_keypair_hybrid | Generates a random keypair |
sign_message | Constructs a signature for |
verify_signature | Checks that |