[][src]Struct solana_libra_nextgen_crypto::vrf::ecvrf::VRFPublicKey

pub struct VRFPublicKey(_);

An ECVRF public key

Methods

impl VRFPublicKey[src]

pub fn verify(&self, proof: &Proof, alpha: &[u8]) -> Result<()>[src]

Given a Proof and an input, returns whether or not the proof is valid for the input and public key

Methods from Deref<Target = ed25519_PublicKey>

pub fn to_bytes(&self) -> [u8; 32][src]

Convert this public key to a byte array.

pub fn as_bytes(&'a self) -> &'a [u8; 32][src]

View this public key as a byte array.

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

Verify a signature on a message with this keypair's public key.

Return

Returns Ok(()) if the signature is valid, and Err otherwise.

pub fn verify_prehashed<D>(
    &self,
    prehashed_message: D,
    context: Option<&[u8]>,
    signature: &Signature
) -> Result<(), SignatureError> where
    D: Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>, 
[src]

Verify a signature on a prehashed_message using the Ed25519ph algorithm.

Inputs

  • prehashed_message is an instantiated hash digest with 512-bits of output which has had the message to be signed previously fed into its state.
  • context is an optional context string, up to 255 bytes inclusive, which may be used to provide additional domain separation. If not set, this will default to an empty string.
  • signature is a purported Ed25519ph Signature on the prehashed_message.

Returns

Returns true if the signature was a valid signature created by this Keypair on the prehashed_message.

Trait Implementations

impl<'a> From<&'a VRFPrivateKey> for VRFPublicKey[src]

impl PartialEq<VRFPublicKey> for VRFPublicKey[src]

impl Eq for VRFPublicKey[src]

impl Debug for VRFPublicKey[src]

impl Deref for VRFPublicKey[src]

type Target = ed25519_PublicKey

The resulting type after dereferencing.

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

type Error = CryptoMaterialError

The type returned in the event of a conversion error.

impl Serialize for VRFPublicKey[src]

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

Auto Trait Implementations

Blanket Implementations

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

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

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.

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

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

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

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

impl<T> TestOnlyHash for T where
    T: Serialize + ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,