Skip to main content

p256_hardware_dek_round_trip

Function p256_hardware_dek_round_trip 

Source
pub fn p256_hardware_dek_round_trip(
    hardware: Arc<dyn FfiHardwareKeyAgreement>,
    key_alias: String,
    ml_seed: Vec<u8>,
) -> Result<bool, FfiError>
Expand description

Smoke the hardware-bound P-256 device encryption key across the FFI seam: enroll a key-agreement key in hardware under key_alias, publish the hybrid public key, encapsulate a fresh shared secret to it in software (the sender side), then decapsulate through the element’s ECDH. Returns true iff the two secrets match — proving the element’s ECDH composes into the hybrid KEM without the private scalar leaving hardware. ml_seed (32 bytes) is the software-sealed ML-KEM-768 half.

The DEK is not yet wired into workspace creation, so this focused round-trip is the composition’s on-device check — the DEK analogue of FfiWorkspace::create_with_p256_hardware_signer. Every step is one capsule-core call.