Skip to main content

VerifyError

Enum VerifyError 

Source
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].

Fields

§line: usize

1-indexed line number.

§reason: String

Parse error.

§

BrokenChain

The chain is broken: a line’s prev_hash did not match the expected value computed from the previous line.

Fields

§line: usize

1-indexed line number where the break was detected.

§expected: String

The expected prev_hash (= hash of the previous line).

§actual: String

The prev_hash actually recorded on the line.

§

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.

Fields

§path: String

Derivation path of the mismatched draw.

§

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

§path: String

Derivation path of the oversized draw.

§len: usize

Recorded value length in bytes.

§max: usize

The HKDF-Expand output limit.

§

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

§path: String

Recorded derivation path.

§expected_prefix: String

The <epoch>/<step>/ prefix the verifier expected.

§

EpochMismatch

A contribution’s recorded epoch does not match its position in the fold sequence (first contribution is epoch 1, and so on).

Fields

§step: String

Step that recorded the contribution.

§recorded: u32

Epoch index recorded on the fact.

§expected: u32

Epoch index implied by the fold count.

§

DuplicateDrawPath

The same derivation path was drawn twice. The runtime never reuses a path, so a duplicate means the record was edited or replayed.

Fields

§path: String

The repeated derivation path.

Trait Implementations§

Source§

impl Debug for VerifyError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for VerifyError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for VerifyError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for VerifyError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.