Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 27 variants Verification(String), IndexBeyondSize { index: u64, size: u64, }, WrongProofSize { got: usize, want: usize, }, InvalidHashLength { got: usize, want: usize, }, RootMismatch, EmptyTreeConsistency, SizeRegression { size1: u64, size2: u64, }, NonEmptyEqualSizeProof, MalformedLeaf(String), MalformedTile(String), MalformedCheckpoint(String), MalformedNote(String), InvalidSignature { name: String, key_id: u32, }, NoTrustedSignature, HybridSignature(String), MalformedNamespace(String), Vrf(String), VrfProofInvalid, CommitmentMismatch, MalformedConiksProof(String), ConiksRootMismatch, MalformedPolicy(String), PolicyMigrationRejected(String), PostureMismatch { declared: String, observed: String, }, UnknownNamespacePolicy(String), SequenceRegression { namespace: String, current: u64, requested: u64, }, SequenceOverflow { namespace: String, },
}
Expand description

All possible errors from transparency-log operations.

The enum is #[non_exhaustive]: downstream code must include a wildcard arm so new variants in later slices are not a breaking change.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Verification(String)

A generic verification failure with a human-readable explanation.

Prefer one of the specific variants below where it applies; this exists for cases that do not warrant a dedicated variant.

§

IndexBeyondSize

A leaf index was greater than or equal to the tree size.

Inclusion proofs require 0 <= index < size.

Fields

§index: u64

The requested leaf index.

§size: u64

The tree size the proof was verified against.

§

WrongProofSize

The supplied proof had the wrong number of hashes for the given (index, size) (inclusion) or (size1, size2) (consistency).

Fields

§got: usize

The number of hashes actually supplied.

§want: usize

The number of hashes the proof shape requires.

§

InvalidHashLength

A hash in a proof, leaf, or root did not have the expected byte length (RFC 6962 SHA-256 nodes are always 32 bytes).

Fields

§got: usize

The actual byte length.

§want: usize

The expected byte length.

§

RootMismatch

A recomputed root did not match the supplied/expected root.

This is the headline negative outcome of inclusion and consistency verification: the proof did not bind the claimed leaf/old-tree to the supplied root.

§

EmptyTreeConsistency

A consistency proof was requested from an empty (size-0) tree, which is not meaningful: there is no earlier root to be consistent with.

§

SizeRegression

size2 < size1 for a consistency proof. Consistency is only defined when the second (newer) tree is at least as large as the first.

Fields

§size1: u64

The earlier (smaller) tree size.

§size2: u64

The later (claimed larger) tree size.

§

NonEmptyEqualSizeProof

A consistency proof between two equal tree sizes carried a non-empty proof. When size1 == size2 the proof MUST be empty and the two roots MUST be equal.

§

MalformedLeaf(String)

The canonical leaf encoding was malformed (e.g. a length-prefixed field would overrun the available bytes, or a context label is invalid).

§

MalformedTile(String)

A C2SP tlog-tiles tile coordinate or tile-path component was invalid (e.g. level out of range, partial-tile width out of 1..=255, or a path that does not match tile/<L>/<N>[.p/<W>]).

§

MalformedCheckpoint(String)

A C2SP checkpoint note body was malformed (missing origin/size/root lines, a non-decimal or leading-zero size, an empty extension line, or a root hash that is not exactly 32 bytes once base64-decoded).

§

MalformedNote(String)

A C2SP signed-note could not be parsed (not valid UTF-8, a forbidden ASCII control character, no blank-line/signature separator, or a malformed signature line / verifier key).

§

InvalidSignature

A signature line referenced a known key (matching name and key id) but the signature failed to verify. Per the C2SP signed-note spec the whole note is rejected in this case.

Fields

§name: String

The key name from the verifier / signature line.

§key_id: u32

The 4-byte key id, as a big-endian u32.

§

NoTrustedSignature

The note parsed correctly but no signature from any supplied trusted key verified, so the note text MUST NOT be trusted.

§

HybridSignature(String)

An additive hybrid post-quantum composite signature could not be produced or its key material could not be decoded/derived (via the metamorphic-crypto composite primitive). A verification failure of an otherwise well-formed line is reported as Error::InvalidSignature instead, matching the classical path and the C2SP signed-note rule.

§

MalformedNamespace(String)

A CONIKS namespace label was malformed (empty, or containing a byte outside the printable-ASCII-excluding-/ set). The namespace is the per-tenant domain separator threaded through every VRF, commitment, and prefix-tree hash, so it must be unambiguous.

§

Vrf(String)

A VRF operation failed structurally (e.g. a key/proof of the wrong byte length, or a proof component that is not a valid curve point). A VRF proof that is well-formed but does not verify against (public_key, alpha) is reported as Error::VrfProofInvalid, not this variant.

§

VrfProofInvalid

A VRF proof was well-formed but did not verify: the claimed identity→index binding is not authentic under the namespace’s VRF public key. CONIKS lookup/absence proofs are rejected in this case, because the private index they rely on is unproven.

§

CommitmentMismatch

A commitment failed to open: the supplied (value, opening) does not reproduce the committed digest. The commitment binds an index to a value (SHA3-512, post-quantum), so a mismatch means the proof does not bind the claimed value.

§

MalformedConiksProof(String)

A CONIKS lookup or absence proof was structurally malformed (e.g. an authentication-path component of the wrong length, or a sibling bitmap inconsistent with the supplied sibling hashes).

§

ConiksRootMismatch

A CONIKS lookup or absence proof was well-formed but did not verify: the authentication path did not recompute the expected directory root. This is the headline negative outcome of CONIKS proof verification.

§

MalformedPolicy(String)

A NamespacePolicy record was structurally malformed: an unknown enum tag, a length-prefixed field that overruns the buffer, an invalid namespace, a prev_policy_hash that is present but not exactly 64 bytes, or a field combination that is illegal in this format version (e.g. a commitment_hash that does not match the one derived from security_level, a vrf_mode other than Classical, or PureCnsa2 at a level below Cat-5).

§

PolicyMigrationRejected(String)

A proposed policy migration was rejected: the new version does not chain to the prior one (prev_policy_hash / policy_schema_version / effective_from discontinuity), or it would weaken the namespace’s declared posture (e.g. Cat-5 → Cat-3, a commitment-hash downgrade, or a VRF-mode downgrade). Migrations are append-only and may only strengthen; a weakening is surfaced here rather than silently applied.

§

PostureMismatch

The declared == observed check failed: an artifact’s observed crypto posture does not match the declared NamespacePolicy posture. This is the headline negative outcome of policy enforcement — a checkpoint signature, CONIKS VRF suite, or commitment-hash parameter that disagrees with what the active policy version requires is a hard rejection (no silent downgrade).

Fields

§declared: String

The posture the active policy version declares.

§observed: String

The posture actually observed on the artifact.

§

UnknownNamespacePolicy(String)

No NamespacePolicy version is in force for the requested tree position (or the policy chain is empty), so a verifier cannot resolve which posture an entry at that position was required to use. An entry can only be enforced against a policy whose half-open validity range [effective_from_n, effective_from_{n+1}) contains its position.

§

SequenceRegression

A per-namespace monotonic Sequencer was asked to re-seat (via resume_from) to a position below its current one. Rewinding would re-issue an already-assigned position and break the append-only ordering, so it is rejected rather than silently applied.

Fields

§namespace: String

The namespace whose sequencer was being re-seated.

§current: u64

The sequencer’s current next-position.

§requested: u64

The (rejected) lower position that was requested.

§

SequenceOverflow

A Sequencer block reservation would advance the per-namespace position past u64::MAX. Not reachable in practice (it would require more than 2^64 appends in one namespace).

Fields

§namespace: String

The namespace whose reservation overflowed.

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Error

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Eq for Error

Source§

impl Error for Error

1.30.0 · 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 PartialEq for Error

Source§

fn eq(&self, other: &Error) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl UnwindSafe for Error

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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 = Infallible

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.