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§
Sourcetype SigningKey
type SigningKey
Signing key type.
Sourcetype VerifyingKey
type VerifyingKey
Verifying key type.
Sourcetype Commitment
type Commitment
Commitment type.
Required Methods§
Sourcefn deriving(signing: &Self::SigningKey) -> Self::VerifyingKey
fn deriving(signing: &Self::SigningKey) -> Self::VerifyingKey
Derive a verifying key from a signing key.
Sourcefn sign_value(payload: &Value, key: &Self::SigningKey) -> Self::Signature
fn sign_value(payload: &Value, key: &Self::SigningKey) -> Self::Signature
Sign a value payload.
Sourcefn verify_signed_value(
payload: &Value,
signature: &Self::Signature,
key: &Self::VerifyingKey,
) -> bool
fn verify_signed_value( payload: &Value, signature: &Self::Signature, key: &Self::VerifyingKey, ) -> bool
Verify a signed value payload.
Sourcefn commitment(payload: &Value) -> Self::Commitment
fn commitment(payload: &Value) -> Self::Commitment
Compute a commitment 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.