[−][src]Struct ed25519_zebra::VerificationKey
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 pointA
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
andR_bytes
MUST be encodings of pointsA
andR
respectively on the twisted Edwards form of Curve25519, and non-canonical encodings MUST be accepted; -
s_bytes
MUST represent an integers
less thanl
, 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]
fn clone(&self) -> VerificationKey
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for VerificationKey
[src]
impl Debug for VerificationKey
[src]
impl<'de> Deserialize<'de> for VerificationKey
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<'a> From<&'a SigningKey> for VerificationKey
[src]
fn from(sk: &'a SigningKey) -> VerificationKey
[src]
impl From<VerificationKey> for VerificationKeyBytes
[src]
fn from(vk: VerificationKey) -> VerificationKeyBytes
[src]
impl From<VerificationKey> for [u8; 32]
[src]
impl Serialize for VerificationKey
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'_> TryFrom<&'_ [u8]> for VerificationKey
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(slice: &[u8]) -> Result<VerificationKey, Error>
[src]
impl TryFrom<[u8; 32]> for VerificationKey
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: [u8; 32]) -> Result<Self, Self::Error>
[src]
impl TryFrom<VerificationKeyBytes> for VerificationKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for VerificationKey
impl Send for VerificationKey
impl Sync for VerificationKey
impl Unpin for VerificationKey
impl UnwindSafe for VerificationKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToHex for T where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,