Crates.io | deevee |
lib.rs | deevee |
version | 0.3.0 |
source | src |
created_at | 2022-06-16 23:54:47.274578 |
updated_at | 2022-06-17 16:17:49.97865 |
description | Designated verifier signatures |
homepage | |
repository | https://github.com/cronokirby/deevee |
max_upload_size | |
id | 607737 |
size | 381,292 |
A crate providing an implementation of Designated Verifier Signatures (DVS).
This library is experimental Cryptographic Software: use at your own peril.
These are like normal signatures, except that the signer also designates a special verifier when signing a message. This changes two things about the resulting signature:
This can be useful in situations where you need to sign a piece of data to convince someone of something, but you want some kind of deniability about this interaction.
These are essentially a variant of Schnorr signatures, using the Ristretto curve.
Here's an example which illustrates the main APIs of the crate:
use deevee::*;
use rand_core::OsRng;
let (privA, pubA) = generate_keypair(&mut OsRng);
let (privB, pubB) = generate_keypair(&mut OsRng);
let (privC, pubC) = generate_keypair(&mut OsRng);
let sig = privA.sign(&mut OsRng, &pubB, b"I like cats");
// The signature verifies, because the designee matches
assert!(privB.verify(&pubA, b"I like cats", &sig));
// If we change the message, verification fails
assert!(!privB.verify(&pubA, b"I don't like cats", &sig));
// The signer won't verify with a different signer either
assert!(!privB.verify(&pubC, b"I like cats", &sig));
// The wrong verifier can't validate the signature either
assert!(!privC.verify(&pubA, b"I like cats", &sig));
// Finally, the verifier can forge a valid signature for themselves
let forged = privB.forge(&mut OsRng, &pubA, b"I don't like cats");
assert!(privB.verify(&pubA, b"I don't like cats", &forged));
Further details on the math are available in math.md.