Variant

Trait Variant 

Source
pub trait Variant:
    Clone
    + Send
    + Sync
    + Hash
    + Eq
    + Debug
    + 'static {
    type Public: Point + FixedSize + Debug + Hash + Copy + AsRef<Self::Public>;
    type Signature: Point + FixedSize + Debug + Hash + Copy + AsRef<Self::Signature>;

    const PROOF_OF_POSSESSION: DST;
    const MESSAGE: DST;

    // Required methods
    fn verify(
        public: &Self::Public,
        hm: &Self::Signature,
        signature: &Self::Signature,
    ) -> Result<(), Error>;
    fn batch_verify<R: CryptoRngCore>(
        rng: &mut R,
        publics: &[Self::Public],
        hms: &[Self::Signature],
        signatures: &[Self::Signature],
    ) -> Result<(), Error>;
    fn pairing(public: &Self::Public, signature: &Self::Signature) -> GT;
}
Expand description

A specific instance of a signature scheme.

Required Associated Constants§

Source

const PROOF_OF_POSSESSION: DST

The domain separator tag (DST) for a proof of possession.

Source

const MESSAGE: DST

The domain separator tag (DST) for a message.

Required Associated Types§

Source

type Public: Point + FixedSize + Debug + Hash + Copy + AsRef<Self::Public>

The public key type.

Source

type Signature: Point + FixedSize + Debug + Hash + Copy + AsRef<Self::Signature>

The signature type.

Required Methods§

Source

fn verify( public: &Self::Public, hm: &Self::Signature, signature: &Self::Signature, ) -> Result<(), Error>

Verify the signature from the provided public key and pre-hashed message.

Source

fn batch_verify<R: CryptoRngCore>( rng: &mut R, publics: &[Self::Public], hms: &[Self::Signature], signatures: &[Self::Signature], ) -> Result<(), Error>

Verify a batch of signatures from the provided public keys and pre-hashed messages.

Source

fn pairing(public: &Self::Public, signature: &Self::Signature) -> GT

Compute the pairing e(G1, G2) -> GT.

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 Variant for MinPk

Source§

const PROOF_OF_POSSESSION: DST = G2_PROOF_OF_POSSESSION

Source§

const MESSAGE: DST = G2_MESSAGE

Source§

type Public = G1

Source§

type Signature = G2

Source§

impl Variant for MinSig

Source§

const PROOF_OF_POSSESSION: DST = G1_PROOF_OF_POSSESSION

Source§

const MESSAGE: DST = G1_MESSAGE

Source§

type Public = G2

Source§

type Signature = G1