Trait modular_frost::curve::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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Curve for Ed448

Available on crate feature ed448 only.
source§

const CONTEXT: &'static [u8] = CONTEXT

source§

impl Curve for Ed25519

Available on crate features ristretto or ed25519 only.
source§

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

source§

impl Curve for P256

Available on crate features secp256k1 or p256 only.
source§

const CONTEXT: &'static [u8] = b"FROST-P256-SHA256-v1"

source§

impl Curve for Ristretto

Available on crate features ristretto or ed25519 only.
source§

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

source§

impl Curve for Secp256k1

Available on crate features secp256k1 or p256 only.
source§

const CONTEXT: &'static [u8] = b"FROST-secp256k1-SHA256-v1"