Skip to main content

Curve

Trait Curve 

Source
pub trait Curve {
    type PublicKey;
    type Signature;

    // Required method
    fn verify(
        public_key: &Self::PublicKey,
        msg: &[u8],
        signature: &Self::Signature,
    ) -> bool;
}
Expand description

Digital Signature Algorithm.

Required Associated Types§

Source

type PublicKey

Public key

Source

type Signature

Signature

Required Methods§

Source

fn verify( public_key: &Self::PublicKey, msg: &[u8], signature: &Self::Signature, ) -> bool

Verify the signature over the message for given public key

NOTE: implementations MAY require msg to be prehash (i.e. output of cryptographic hash function) of a fixed length and reject the signature otherwise. Check corresponding docs before using.

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

Source§

type PublicKey = VerifyingKey

Source§

type Signature = Signature

Source§

impl Curve for P256

Source§

type PublicKey = VerifyingKey<NistP256>

Source§

type Signature = Signature<NistP256>

Source§

impl Curve for Secp256k1

Source§

type PublicKey = VerifyingKey<Secp256k1>

Source§

type Signature = Signature<Secp256k1>