Skip to main content

ciphertext_from_slice

Function ciphertext_from_slice 

Source
pub fn ciphertext_from_slice<P: MlKemParams>(
    bytes: &[u8],
) -> Result<P::CiphertextBytes, KyberLibError>
Expand description

Validate a borrowed byte slice and copy it into the parameter-set’s concrete CiphertextBytes buffer.

§Errors

KyberLibError::InvalidLength if bytes.len() != P::CIPHERTEXT_BYTES.