Skip to main content

VerificationModel

Trait VerificationModel 

Source
pub trait VerificationModel {
    type Hash;
    type SigningKey;
    type VerifyingKey;
    type Signature;
    type Commitment;
    type Nullifier;

    // Required methods
    fn hash(tag: HashTag, bytes: &[u8]) -> Self::Hash;
    fn deriving(signing: &Self::SigningKey) -> Self::VerifyingKey;
    fn sign_value(payload: &Value, key: &Self::SigningKey) -> Self::Signature;
    fn verify_signed_value(
        payload: &Value,
        signature: &Self::Signature,
        key: &Self::VerifyingKey,
    ) -> bool;
    fn commitment(payload: &Value) -> Self::Commitment;
    fn nullifier(payload: &Value) -> Self::Nullifier;
}
Expand description

Verification model typeclass.

Required Associated Types§

Source

type Hash

Hash type.

Source

type SigningKey

Signing key type.

Source

type VerifyingKey

Verifying key type.

Source

type Signature

Signature type.

Source

type Commitment

Commitment type.

Source

type Nullifier

Nullifier type.

Required Methods§

Source

fn hash(tag: HashTag, bytes: &[u8]) -> Self::Hash

Domain-separated hash.

Source

fn deriving(signing: &Self::SigningKey) -> Self::VerifyingKey

Derive a verifying key from a signing key.

Source

fn sign_value(payload: &Value, key: &Self::SigningKey) -> Self::Signature

Sign a value payload.

Source

fn verify_signed_value( payload: &Value, signature: &Self::Signature, key: &Self::VerifyingKey, ) -> bool

Verify a signed value payload.

Source

fn commitment(payload: &Value) -> Self::Commitment

Compute a commitment for a value.

Source

fn nullifier(payload: &Value) -> Self::Nullifier

Compute a nullifier for a value.

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§