vrf-rs 0.0.0

Fast and extensible Elliptic Curve Verifiable Random Function (VRF) library; currently supporting secp256k1 and secp256r1 curves
Documentation
use thiserror::Error;

/// VRF errors
#[derive(Error, Debug, PartialEq)]
pub enum VrfError {
    #[error("affine: cannot convert from bytes to affine point")]
    AffineFromBytes,
    #[error("encode_to_curve: cannot find a valid EC point using TAI")]
    EncodeToCurveTai,
    #[error("decode_proof: invalid proof (pi) length")]
    InvalidPiLength,
    #[error("verify: invalid proof")]
    InvalidProof,
    #[error("scalar: cannot convert from bytes to scalar")]
    ScalarFromBytes,
    #[error("verify: invalid public key")]
    VerifyInvalidKey,
}

pub type Result<T, E = VrfError> = core::result::Result<T, E>;