[−][src]Struct solana_libra_nextgen_crypto::vrf::ecvrf::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]
&self,
message: &[u8],
signature: &Signature
) -> Result<(), SignatureError>
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]
&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>>,
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 Ed25519phSignature
on theprehashed_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]
fn from(private_key: &'a VRFPrivateKey) -> Self
[src]
impl PartialEq<VRFPublicKey> for VRFPublicKey
[src]
fn eq(&self, other: &VRFPublicKey) -> bool
[src]
fn ne(&self, other: &VRFPublicKey) -> bool
[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.
fn deref(&self) -> &Self::Target
[src]
impl<'_> TryFrom<&'_ [u8]> for VRFPublicKey
[src]
type Error = CryptoMaterialError
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8]) -> Result<VRFPublicKey, CryptoMaterialError>
[src]
impl Serialize for VRFPublicKey
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for VRFPublicKey
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Sync for VRFPublicKey
impl Send for VRFPublicKey
impl Unpin for VRFPublicKey
impl RefUnwindSafe for VRFPublicKey
impl UnwindSafe for VRFPublicKey
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> TestOnlyHash for T where
T: Serialize + ?Sized,
T: Serialize + ?Sized,
fn test_only_hash(&self) -> HashValue
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,