pub trait MLKEMPublicKeyTrait<const k: usize, const PK_LEN: usize, const T_PACKED_LEN: usize>: KEMPublicKey<PK_LEN> {
// Required methods
fn pk_decode(pk: &[u8; PK_LEN]) -> Self;
fn t_hat_packed(&self) -> &[u8; T_PACKED_LEN];
fn rho(&self) -> &[u8; 32];
fn compute_hash(&self) -> [u8; 32];
}Expand description
General trait for all ML-KEM public keys types.
Required Methodsยง
Sourcefn pk_decode(pk: &[u8; PK_LEN]) -> Self
fn pk_decode(pk: &[u8; PK_LEN]) -> Self
Algorithm 23 pkDecode(๐๐) Reverses the procedure pkEncode. Input: Public key ๐๐ โ ๐น32+32๐(bitlen (๐โ1)โ๐). Output: ๐ โ ๐น32, ๐ญ1 โ ๐ ๐ with coefficients in [0, 2bitlen (๐โ1)โ๐ โ 1].
Sourcefn t_hat_packed(&self) -> &[u8; T_PACKED_LEN]
fn t_hat_packed(&self) -> &[u8; T_PACKED_LEN]
Get a ref to t_hat_packed byte array
Sourcefn compute_hash(&self) -> [u8; 32]
fn compute_hash(&self) -> [u8; 32]
Get the hash of the public key
Dyn Compatibilityยง
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".