blake3-lamport-signatures

Crates.ioblake3-lamport-signatures
lib.rsblake3-lamport-signatures
version0.3.5
sourcesrc
created_at2022-01-31 08:40:23.372423
updated_at2023-04-21 23:14:10.457502
descriptionLamport Signatures using the Blake 3 Cryptographic Hash Function
homepagehttps://github.com/samuelSchlesinger/blake3-lamport-signatures
repositoryhttps://github.com/samuelSchlesinger/blake3-lamport-signatures
max_upload_size
id524467
size29,198
Samuel Schlesinger (SamuelSchlesinger)

documentation

https://docs.rs/blake3-lamport-signatures

README

blake3-lamport-signatures

Lamport, as well as Lamport-Merkle, signatures implemented using the blake3 cryptographic hash function. This is an incredibly inefficient digital signature protocol and shouldn't be used under almost all circumstances, its main benefit being its simplicity and flexibility.

Lamport keypairs should only be used to sign one message, while you can specify a number of messages to support in a Lamport-Merkle keypair.

use blake3_lamport_signatures::lamport;

let private_key = lamport::PrivateKey::generate()?;
let public_key = private_key.public_key();
let message = b"Yeah, I said it";
let signature = private_key.sign(message);

assert!(public_key.verify(message, &signature));

use blake3_lamport_signatures::merkle;
// generate a Merkle-Lamport private key capable of signing 100 messages
let mut private_key = merkle::PrivateKey::generate(100);
let public_key = private_key.public_key();
let message = b"And I'll say it again!";
let signature = private_key.sign(message);

assert!(public_key.verify(message, &signature);

Communication

There is a natural two-party verified communication protocol associated with lamport signatures. Alice and Bob start with preshared PublicKeys, and each time they send a message, they include the PublicKey for the next message.

Acknowledgements

Leslie Lamport is a really cool dude.

Commit count: 21

cargo fmt