pub enum DeviceDek {
Software(DekKeypair),
Hardware(P256HybridDek),
}Expand description
This device’s Device Encryption Key, in whichever of the two compositions the design allows.
Both expose the same two operations — publish a public encapsulation key, decapsulate a
ciphertext sealed to it — so every caller is agnostic to where the classical half lives. The
two byte formats are length-disjoint — X-Wing’s DekKeypair and the P-256 hybrid’s
P256HybridDek publish and accept different lengths — so a ciphertext for one is rejected
outright by the other rather than silently recovering a wrong secret.
Variants§
Software(DekKeypair)
Software fallback. X-Wing (X25519 + ML-KEM-768), both halves in software. The composition every host can run, including those with no secure element and the TPM-1.2 / no-TPM tail the design excludes from hardware binding by name.
Hardware(P256HybridDek)
Hardware-bound. P-256 ECDH inside the secure element + a software-sealed ML-KEM-768
half (P256HybridDek). The private P-256 scalar never leaves hardware, so this
variant cannot be reconstructed from the account file alone.
Implementations§
Source§impl DeviceDek
impl DeviceDek
Sourcepub fn public_bytes(&self) -> Vec<u8> ⓘ
pub fn public_bytes(&self) -> Vec<u8> ⓘ
The published public encapsulation-key bytes a sender wraps to. pk_M ‖ pk_X (1216 bytes)
for the software X-Wing DEK; ek_M ‖ pk_P (1249 bytes) for the hardware P-256 hybrid.
Sourcepub fn decapsulate(&self, ciphertext: &[u8]) -> Result<[u8; 32], CryptoError>
pub fn decapsulate(&self, ciphertext: &[u8]) -> Result<[u8; 32], CryptoError>
Recover the 32-byte shared secret from a ciphertext sealed to public_bytes.
For Hardware the classical half of this call happens inside the
element, so it can fail on a cancelled biometric or a missing key.
Sourcepub fn is_hardware_bound(&self) -> bool
pub fn is_hardware_bound(&self) -> bool
Whether the classical half of this DEK lives in a secure element.
Sourcepub fn binding(&self) -> DekBinding
pub fn binding(&self) -> DekBinding
How this DEK is recorded in the AccountFile.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DeviceDek
impl !UnwindSafe for DeviceDek
impl Freeze for DeviceDek
impl Send for DeviceDek
impl Sync for DeviceDek
impl Unpin for DeviceDek
impl UnsafeUnpin for DeviceDek
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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