Skip to main content

public_key_len

Function public_key_len 

Source
pub const fn public_key_len<P: MlKemParams>() -> usize
Expand description

Length of the public encapsulation key for the parameter set P, as a const fn so it can be used in array dimensions inside const contexts.

ยงExample

use kyberlib::{MlKem768, MlKemParams, paramsets::public_key_len};

const PK_LEN: usize = public_key_len::<MlKem768>();
assert_eq!(PK_LEN, MlKem768::PUBLIC_KEY_BYTES);