// Copyright 2023 Cryspen Sarl // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0
//! This module contains the trait and related errors for a KEM that takes array references as //! arguments and returns values as arrays. //! usesuper::arrayref;
/// A Key Encapsulation Mechanismd (KEM) that returns values insteaf of writing the results to /// `&mut` arguments. pubtrait Kem< const EK_LEN: usize, const DK_LEN: usize, const CT_LEN: usize, const SS_LEN: usize, const RAND_KEYGEN_LEN: usize, const RAND_ENCAPS_LEN: usize,
>
{ /// Generate a pair of encapsulation and decapsulation keys. /// It is the responsibility of the caller to ensure that the `rand` argument is actually /// random. fn keygen(rand: &[u8; RAND_KEYGEN_LEN]) -> Result<([u8; DK_LEN], [u8; EK_LEN]), KeyGenError>;
/// Encapsulate a shared secret towards a given encapsulation key. /// It is the responsibility of the caller to ensure that the `rand` argument is actually /// random. fn encaps(
ek: &[u8; EK_LEN],
rand: &[u8; RAND_ENCAPS_LEN],
) -> Result<([u8; SS_LEN], [u8; CT_LEN]), EncapsError>;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.