pub enum KynVdfError {
InvalidProofLength {
expected: usize,
actual: usize,
},
InvalidSeed(String),
InvalidDiscriminantSize(usize),
DiscriminantError(String),
FormDeserializationError(String),
InvalidDiscriminantIdentity,
ArithmeticError(String),
InvalidIterations(u64),
VerificationFailed,
}Expand description
Domain-specific errors returned during Class Group operations and Wesolowski VDF verification.
Every variant carries a human-readable message describing the exact failure point.
Callers should treat KynVdfError::VerificationFailed as a clean “proof rejected”
signal, and all other variants as malformed or invalid inputs.
Variants§
InvalidProofLength
The proof byte slice is shorter than the required minimum.
Chia-format proofs must be exactly 200 bytes (y || π, each 100 bytes).
InvalidSeed(String)
The challenge seed passed to crate::create_discriminant was empty or invalid.
Seeds must be non-empty byte slices. Longer seeds (≥32 bytes) are recommended for security.
InvalidDiscriminantSize(usize)
The discriminant bit-size is zero, not a multiple of 8, or otherwise unsupported.
Valid values are multiples of 8 (e.g. 512, 1024, 2048).
DiscriminantError(String)
Discriminant generation or prime hashing failed unexpectedly.
FormDeserializationError(String)
A quadratic form could not be serialized or deserialized from the Chia BQFC format.
This typically means the proof bytes are corrupted, truncated, or were produced by an incompatible implementation.
InvalidDiscriminantIdentity
The deserialized or constructed quadratic form does not satisfy the fundamental discriminant identity $b^2 - 4ac = D$.
Indicates a corrupted proof or an incorrect discriminant was used for verification.
ArithmeticError(String)
An extended GCD, modular inverse, or other class group arithmetic step failed.
InvalidIterations(u64)
The iteration count passed to verify is zero.
A VDF with zero iterations is undefined — the minimum meaningful value is 1.
VerificationFailed
Verification completed without error but the proof equation does not hold:
π^B · x^r ≠ y.
This is the expected error when a valid but incorrect proof is presented.
Trait Implementations§
Source§impl Clone for KynVdfError
impl Clone for KynVdfError
Source§fn clone(&self) -> KynVdfError
fn clone(&self) -> KynVdfError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KynVdfError
impl Debug for KynVdfError
Source§impl Display for KynVdfError
impl Display for KynVdfError
impl Eq for KynVdfError
Source§impl Error for KynVdfError
impl Error for KynVdfError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()