#[non_exhaustive]pub enum WrapBehaviour {
Honest,
FailWrap,
FailUnwrap,
Passthrough,
WrongKeyOnUnwrap,
EmptyWrapWithRecall,
}Expand description
How a FakeDevice behaves when asked to wrap or unwrap.
Each variant is an adversary the tier self-test must refute. The vocabulary is deliberately wide: a fixture set that cannot express a given lie reports the guard against it as safe, so every clause of the self-test contract needs a variant that violates exactly that clause.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Honest
Correct: AES-256-GCM under the device key, round-trips.
FailWrap
wrap_key errors — models hardware that probes present but cannot be used.
FailUnwrap
wrap_key succeeds, unwrap_key errors.
Passthrough
wrap_key returns the content key verbatim — models a “wrapping” that
wraps nothing, leaving the key exportable with the blob.
WrongKeyOnUnwrap
unwrap_key returns a different key rather than failing — models a
provider whose round-trip silently does not reproduce the key.
EmptyWrapWithRecall
wrap_key returns an empty wrapped key while unwrap_key still
reproduces the right one from an internal slot.
Models a provider that emits nothing into the envelope but remembers the key out of band. It is the only way to violate just the “a wrap that returns nothing” clause of the self-test contract: a device that returned empty and then failed to unwrap would be refuted by the round-trip clause instead, leaving the empty-wrap guard untested. Such a provider would write envelopes carrying no wrapped key at all.
Trait Implementations§
Source§impl Clone for WrapBehaviour
impl Clone for WrapBehaviour
Source§fn clone(&self) -> WrapBehaviour
fn clone(&self) -> WrapBehaviour
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WrapBehaviour
Source§impl Debug for WrapBehaviour
impl Debug for WrapBehaviour
Source§impl Default for WrapBehaviour
impl Default for WrapBehaviour
Source§fn default() -> WrapBehaviour
fn default() -> WrapBehaviour
impl Eq for WrapBehaviour
Source§impl PartialEq for WrapBehaviour
impl PartialEq for WrapBehaviour
impl StructuralPartialEq for WrapBehaviour
Auto Trait Implementations§
impl Freeze for WrapBehaviour
impl RefUnwindSafe for WrapBehaviour
impl Send for WrapBehaviour
impl Sync for WrapBehaviour
impl Unpin for WrapBehaviour
impl UnsafeUnpin for WrapBehaviour
impl UnwindSafe for WrapBehaviour
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more