pub trait MLKEMPublicKeyTrait<const k: usize, const PK_LEN: usize>: KEMPublicKey<PK_LEN> {
// Required methods
fn pk_decode(pk: &[u8; PK_LEN]) -> Result<Self, KEMError>;
fn A_hat(&self) -> Matrix<k, k>;
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]) -> Result<Self, KEMError>
fn pk_decode(pk: &[u8; PK_LEN]) -> Result<Self, KEMError>
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 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".