pub struct VrfStruct<Curve, Hasher> {
pub curve: Curve,
pub hasher: Hasher,
pub suite_id: u8,
}Fields§
§curve: Curve§hasher: Hasher§suite_id: u8ECVRF suite string as specific by RFC9381
Implementations§
Source§impl<C, D> VrfStruct<C, D>where
C: CurveArithmetic,
C::FieldBytesSize: ModulusSize,
C::AffinePoint: FromEncodedPoint<C>,
C::ProjectivePoint: ToEncodedPoint<C> + CofactorGroup,
D: Digest + BlockSizeUser + FixedOutput<OutputSize = C::FieldBytesSize> + FixedOutputReset,
impl<C, D> VrfStruct<C, D>where
C: CurveArithmetic,
C::FieldBytesSize: ModulusSize,
C::AffinePoint: FromEncodedPoint<C>,
C::ProjectivePoint: ToEncodedPoint<C> + CofactorGroup,
D: Digest + BlockSizeUser + FixedOutput<OutputSize = C::FieldBytesSize> + FixedOutputReset,
Sourcepub fn verify(
&self,
public_key: &[u8],
pi: &[u8],
alpha: &[u8],
) -> Result<GenericArray<u8, C::FieldBytesSize>>
pub fn verify( &self, public_key: &[u8], pi: &[u8], alpha: &[u8], ) -> Result<GenericArray<u8, C::FieldBytesSize>>
Verifies the provided VRF proof and computes the VRF hash output.
Spec: ECVRF_verify function (section 5.2).
§Arguments
y- A slice representing the public key in octets.pi- A slice of octets representing the VRF proof.alpha- A slice containing the input data, to be hashed.
§Returns
- If successful, a vector of octets with the VRF hash output.
Sourcepub fn proof_to_hash(
&self,
pi: &[u8],
) -> Result<GenericArray<u8, C::FieldBytesSize>>
pub fn proof_to_hash( &self, pi: &[u8], ) -> Result<GenericArray<u8, C::FieldBytesSize>>
Auto Trait Implementations§
impl<Curve, Hasher> Freeze for VrfStruct<Curve, Hasher>
impl<Curve, Hasher> RefUnwindSafe for VrfStruct<Curve, Hasher>where
Curve: RefUnwindSafe,
Hasher: RefUnwindSafe,
impl<Curve, Hasher> Send for VrfStruct<Curve, Hasher>
impl<Curve, Hasher> Sync for VrfStruct<Curve, Hasher>
impl<Curve, Hasher> Unpin for VrfStruct<Curve, Hasher>
impl<Curve, Hasher> UnwindSafe for VrfStruct<Curve, Hasher>where
Curve: UnwindSafe,
Hasher: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more