[][src]Struct ed25519_zebra::VerificationKey

pub struct VerificationKey { /* fields omitted */ }

A valid Ed25519 verification key.

This is also called a public key by other implementations.

This type holds decompressed state used in signature verification; if the verification key may not be used immediately, it is probably better to use VerificationKeyBytes, which is a refinement type for [u8; 32].

Zcash-specific consensus properties

Ed25519 checks are described in §5.4.5 of the Zcash protocol specification and in [ZIP 215]. The verification criteria for an (encoded) verification key A_bytes are:

  • A_bytes MUST be an encoding of a point A on the twisted Edwards form of Curve25519, and non-canonical encodings MUST be accepted;

Implementations

impl VerificationKey[src]

pub fn verify(&self, signature: &Signature, msg: &[u8]) -> Result<(), Error>[src]

Verify a purported signature on the given msg.

Zcash-specific consensus properties

Ed25519 checks are described in §5.4.5 of the Zcash protocol specification and in ZIP215. The verification criteria for an (encoded) signature (R_bytes, s_bytes) with (encoded) verification key A_bytes are:

  • A_bytes and R_bytes MUST be encodings of points A and R respectively on the twisted Edwards form of Curve25519, and non-canonical encodings MUST be accepted;

  • s_bytes MUST represent an integer s less than l, the order of the prime-order subgroup of Curve25519;

  • the verification equation [8][s]B = [8]R + [8][k]A MUST be satisfied;

  • the alternate verification equation [s]B = R + [k]A, allowed by RFC 8032, MUST NOT be used.

Trait Implementations

impl AsRef<[u8]> for VerificationKey[src]

impl Clone for VerificationKey[src]

impl Copy for VerificationKey[src]

impl Debug for VerificationKey[src]

impl<'de> Deserialize<'de> for VerificationKey[src]

impl<'a> From<&'a SigningKey> for VerificationKey[src]

impl From<VerificationKey> for VerificationKeyBytes[src]

impl From<VerificationKey> for [u8; 32][src]

impl Serialize for VerificationKey[src]

impl<'_> TryFrom<&'_ [u8]> for VerificationKey[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<[u8; 32]> for VerificationKey[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<VerificationKeyBytes> for VerificationKey[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.