Trait Curve

Source
pub trait Curve: Ciphersuite {
    const CONTEXT: &'static [u8];

    // Provided methods
    fn hash(dst: &[u8], data: &[u8]) -> Output<Self::H> { ... }
    fn hash_to_F(dst: &[u8], msg: &[u8]) -> Self::F { ... }
    fn hash_msg(msg: &[u8]) -> Output<Self::H> { ... }
    fn hash_commitments(commitments: &[u8]) -> Output<Self::H> { ... }
    fn hash_binding_factor(binding: &[u8]) -> Self::F { ... }
    fn random_nonce<R: RngCore + CryptoRng>(
        secret: &Zeroizing<Self::F>,
        rng: &mut R,
    ) -> Zeroizing<Self::F> { ... }
    fn read_G<R: Read>(reader: &mut R) -> Result<Self::G> { ... }
}
Expand description

FROST Ciphersuite.

This exclude the signing algorithm specific H2, making this solely the curve, its associated hash function, and the functions derived from it.

Required Associated Constants§

Source

const CONTEXT: &'static [u8]

Context string for this curve.

Provided Methods§

Source

fn hash(dst: &[u8], data: &[u8]) -> Output<Self::H>

Hash the given dst and data to a byte vector. Used to instantiate H4 and H5.

Source

fn hash_to_F(dst: &[u8], msg: &[u8]) -> Self::F

Field element from hash. Used during key gen and by other crates under Serai as a general utility. Used to instantiate H1 and H3.

Source

fn hash_msg(msg: &[u8]) -> Output<Self::H>

Hash the message for the binding factor. H4 from the IETF draft.

Source

fn hash_commitments(commitments: &[u8]) -> Output<Self::H>

Hash the commitments for the binding factor. H5 from the IETF draft.

Source

fn hash_binding_factor(binding: &[u8]) -> Self::F

Hash the commitments and message to calculate the binding factor. H1 from the IETF draft.

Source

fn random_nonce<R: RngCore + CryptoRng>( secret: &Zeroizing<Self::F>, rng: &mut R, ) -> Zeroizing<Self::F>

Securely generate a random nonce. H3 from the IETF draft.

Source

fn read_G<R: Read>(reader: &mut R) -> Result<Self::G>

Read a point from a reader, rejecting identity.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Curve for Ed25519

Available on crate features ristretto or ed25519 only.
Source§

const CONTEXT: &'static [u8] = b"FROST-ED25519-SHA512-v1"