You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
dependabot[bot] 32dc17a677
Bump actions/checkout from 3.3.0 to 3.4.0 (#50)
1 week ago
.github Bump actions/checkout from 3.3.0 to 3.4.0 (#50) 1 week ago
benches Introduce SpendAuth: SigType and Binding: SigType traits 1 year ago
rfcs add missing checks 2 years ago
src fix calls to renamed DKG functions; move dkg code to its own file (#49) 3 weeks ago
tests add Pallas and Jubjub ciphersuites and FROST support (#33) 4 weeks ago
.gitignore Optimized batch verification (#36) 3 years ago
CHANGELOG.md bump to 0.5.0; don't enable frost-rerandomized with std (#48) 3 weeks ago
Cargo.toml bump to 0.5.0; don't enable frost-rerandomized with std (#48) 3 weeks ago
Dockerfile Rename crate to reddsa 1 year ago
LICENCE Rename crate to reddsa 1 year ago
LICENCE.MIT Frost keygen with dealer (#47) 2 years ago
LICENSE.Apache-2.0 Frost keygen with dealer (#47) 2 years ago
README.md bump to 0.5.0; don't enable frost-rerandomized with std (#48) 3 weeks ago
cloudbuild.yaml Add GitHub Actions workflow which runs Google Cloudbuild jobs 3 years ago
codecov.yml Update the include_str support to fix CI on nightly (#12) 1 year ago
rust-toolchain bump MSRV to 1.60.0 in rust-toolchain 4 weeks ago
zcash-frost-audit-report-20210323.pdf Add FROST audit pdf to root of repo 2 years ago

README.md

A minimal RedDSA implementation for use in Zcash.

Two specializations of RedDSA are used in Zcash: RedJubjub and RedPallas. For each of these, two parameterizations are used, one for BindingSig and one for SpendAuthSig. This library distinguishes these in the type system, using the sealed SigType trait as a type-level enum.

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 RedDSA verification key. This allows the VerificationKey type to cache verification checks related to the verification key encoding. For all specializations of RedDSA used in Zcash, encodings of signing and verification keys are 32 bytes.

Examples

Creating a BindingSig, serializing and deserializing it, and verifying the signature:

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

let msg = b"Hello!";

// Generate a secret key and sign the message
let sk = SigningKey::<sapling::Binding>::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<sapling::Binding> = sig_bytes.into();
assert!(
    VerificationKey::try_from(pk_bytes)
        .and_then(|pk| pk.verify(msg, &sig))
        .is_ok()
);

FROST

You can enable ZIP-312 re-randomized FROST support with the frost feature. This is still experimental since ZIP-312 is still a draft.

docs

cargo doc --features "nightly" --open