pub enum VerifyError {
Show 13 variants
Io(Error),
InvalidLine {
line: usize,
reason: String,
},
BrokenChain {
line: usize,
expected: String,
actual: String,
},
Empty,
SeedMissing,
DuplicateSeed,
UnknownDerivation(String),
MalformedEntropy(String),
DrawMismatch {
path: String,
},
DrawTooLong {
path: String,
len: usize,
max: usize,
},
PathMismatch {
path: String,
expected_prefix: String,
},
EpochMismatch {
step: String,
recorded: u32,
expected: u32,
},
DuplicateDrawPath {
path: String,
},
}Expand description
Verification failure modes.
Variants§
Io(Error)
Underlying I/O error reading the transcript.
InvalidLine
A line did not parse as a [ChainedFact].
BrokenChain
The chain is broken: a line’s prev_hash did not match the
expected value computed from the previous line.
Fields
Empty
The transcript file has zero lines.
SeedMissing
A value was drawn (or a contribution folded) before any
EntropySeeded fact established the source.
DuplicateSeed
A second EntropySeeded fact appeared. The source is seeded exactly
once at ceremony start; accepting a re-seed would let a crafted
transcript swap the seed mid-stream and have later draws “verify”
against a seed of the forger’s choosing.
UnknownDerivation(String)
The seed fact declares a derivation scheme the verifier does not
recognise. Never trust an unknown scheme (the JWT-alg lesson).
MalformedEntropy(String)
A recorded hex value (the seed m or a drawn value) did not decode.
DrawMismatch
A drawn value does not match what re-derivation from the recorded seed and path produces: the source was tampered with.
DrawTooLong
A recorded draw is longer than HKDF-Expand can produce
(MAX_DRAW_LEN bytes), so it cannot
have come from the real source. Rejected up front: attempting the
re-derivation would abort the verifier instead of failing the check.
Fields
PathMismatch
A draw’s recorded path does not start with the
<epoch>/<step>/ prefix the verifier rebuilds from its own fold
count and the step named on the fact, so the draw is attributed to
the wrong epoch or step.
Fields
EpochMismatch
A contribution’s recorded epoch does not match its position in the fold sequence (first contribution is epoch 1, and so on).
Fields
DuplicateDrawPath
The same derivation path was drawn twice. The runtime never reuses a path, so a duplicate means the record was edited or replayed.
Trait Implementations§
Source§impl Debug for VerifyError
impl Debug for VerifyError
Source§impl Display for VerifyError
impl Display for VerifyError
Source§impl Error for VerifyError
impl Error for VerifyError
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()