pub trait VRF {
type Error;
fn prove(
&mut self,
pkey: &Rsa<Private>,
alpha_string: &[u8]
) -> Result<Vec<u8>, Self::Error>;
fn proof_to_hash(&mut self, pi_string: &[u8]) -> Result<Vec<u8>, Self::Error>;
fn verify(
&mut self,
public_key: &Rsa<Public>,
alpha_string: &[u8],
pi_string: &[u8]
) -> Result<Vec<u8>, Self::Error>;
}Expand description
A trait containing the common capabilities for VRF implementations
Required Associated Types
Required Methods
Generates proof from a private key and a message
Arguments:
pkey: a private keyalpha_string: octet string message represented by a slice
Returns:
- if successful, a vector of octets representing the VRF proof
Generates VRF hash output from the provided proof
Arguments:
pi_string: generated VRF proof
Returns:
- the VRF hash output
Verifies the provided VRF proof and computes the VRF hash output
Arguments:
public_key: a public keyalpha_string: VRF hash input, an octet stringpi_string: proof to be verified, an octet string
Returns:
- if successful, a vector of octets with the VRF hash output