frost/frost-ristretto255
Deirdre Connolly e6d5afdfb2
Merge pull request #50 from ZcashFoundation/frost-core
* frost-core Cargo.toml

* Ciphersuite trait

* Signature trait

* Copy stub ristretto impl for now

* First stab at making signing and verifying generic over frost-core::Ciphersuite

* Update signing

* Nice const generics and stuff for frost-core::Ciphersuite

* Have to implement traits for the pre-parameterized types inside the module

* Ciphersuite::Group::Field

* Make frost/keys generic over Ciphersuite

* frost-core genericization mostly done, modulo batch

* Move tests around

* Remove internal test module

* Lots of tidies, including type refinement of Scalar, Challenge

* More genericization and tidy'ing

* Test vectors working against Ristretto impl in the frost-core integration tests

* clippy fix

* Fix generic params for full frost example integration test using ristretto

* Genericize proptests

* clippy --fix

* Doc comment identifier module

* In-flight batch and multiscalar mul

* Stop using Scalar::from_hash() as it expects impl Digest which sha2 0.10+ isn't doing anymore

* run cargo udeps

* Update frost-core/src/frost/round1.rs

* Update frost-core/src/frost.rs

* Update frost-core/src/frost/keys.rs
2022-05-16 16:53:17 -04:00
..
benches Make Ristretto implementation up to date with spec (#25) 2022-02-09 15:18:21 -07:00
src Merge pull request #50 from ZcashFoundation/frost-core 2022-05-16 16:53:17 -04:00
tests Update test vectors 2022-03-28 15:46:48 -04:00
Cargo.toml Merge pull request #50 from ZcashFoundation/frost-core 2022-05-16 16:53:17 -04:00
README.md Fix typos 2022-02-08 18:52:02 -05:00

README.md

An implementation of Schnorr signatures on the Ristretto group for both single and threshold numbers of signers (FROST).

In addition to the Signature, SigningKey, VerificationKey types, the library also provides VerificationKeyBytes, a refinement of a [u8; 32] indicating that bytes represent an encoding of a verification key. This allows the VerificationKey type to cache verification checks related to the verification key encoding.

Examples

Creating a Signature with a single signer, serializing and deserializing it, and verifying the signature:

# use std::convert::TryFrom;
use rand::thread_rng;
use frost_ristretto255::*;

let msg = b"Hello!";

// Generate a secret key and sign the message
let sk = SigningKey::new(thread_rng());
let sig = sk.sign(thread_rng(), msg);

// Types can be converted to raw byte arrays using From/Into
let sig_bytes: [u8; 64] = sig.into();
let pk_bytes: [u8; 32] = VerificationKey::from(&sk).into();

// Deserialize and verify the signature.
let sig: Signature = sig_bytes.into();

assert!(
    VerificationKey::try_from(pk_bytes)
        .and_then(|pk| pk.verify(msg, &sig))
        .is_ok()
);

docs

cargo doc --features "nightly" --open