[−][src]Trait vrf::VRF
A trait containing the common capabilities for all Verifiable Random Functions (VRF) implementations.
Associated Types
type Error
Required methods
fn prove(&mut self, x: SecretKey, alpha: &[u8]) -> Result<Vec<u8>, Self::Error>
Generates proof from a secret key and a message.
Arguments
x
- A secret key.alpha
- A slice representing the message in octets.
Returns
- If successful, a vector of octets representing the proof of the VRF.
fn verify(
&mut self,
y: PublicKey,
pi: &[u8],
alpha: &[u8]
) -> Result<Vec<u8>, Self::Error>
&mut self,
y: PublicKey,
pi: &[u8],
alpha: &[u8]
) -> Result<Vec<u8>, Self::Error>
Implementors
impl<'_, '_> VRF<&'_ [u8], &'_ [u8]> for ECVRF
[src]
VRFs are objects capable of generating and verifying proofs.
type Error = Error
fn prove(&mut self, x: &[u8], alpha: &[u8]) -> Result<Vec<u8>, Error>
[src]
Generates proof from a secret key and message as specified in the VRF-draft-05 (section 5.1).
Arguments
x
- A slice representing the secret key in octets.alpha
- A slice representing the message in octets.
Returns
- If successful, a vector of octets representing the proof of the VRF.
fn verify(
&mut self,
y: &[u8],
pi: &[u8],
alpha: &[u8]
) -> Result<Vec<u8>, Error>
[src]
&mut self,
y: &[u8],
pi: &[u8],
alpha: &[u8]
) -> Result<Vec<u8>, Error>
Verifies the provided VRF proof and computes the VRF hash output as specified in VRF-draft-05 (section 5.3).
Arguments
y
- A slice representing the public key in octets.pi
- A slice of octets representing the VRF proof.
Returns
- If successful, a vector of octets with the VRF hash output.