pub trait KemOperations {
// Required methods
fn generate_keypair(
&self,
algorithm: Algorithm,
randomness: Option<&[u8]>,
) -> Result<KemKeypair>;
fn encapsulate(
&self,
algorithm: Algorithm,
public_key: &KemPublicKey,
randomness: Option<&[u8]>,
) -> Result<(Vec<u8>, Vec<u8>)>;
fn decapsulate(
&self,
algorithm: Algorithm,
secret_key: &KemSecretKey,
ciphertext: &[u8],
) -> Result<Vec<u8>>;
fn derive_public_key(
&self,
algorithm: Algorithm,
secret_key: &KemSecretKey,
) -> Result<KemPublicKey>;
}Expand description
Key Encapsulation Mechanism operations
Required Methods§
fn generate_keypair( &self, algorithm: Algorithm, randomness: Option<&[u8]>, ) -> Result<KemKeypair>
fn encapsulate( &self, algorithm: Algorithm, public_key: &KemPublicKey, randomness: Option<&[u8]>, ) -> Result<(Vec<u8>, Vec<u8>)>
fn decapsulate( &self, algorithm: Algorithm, secret_key: &KemSecretKey, ciphertext: &[u8], ) -> Result<Vec<u8>>
fn derive_public_key( &self, algorithm: Algorithm, secret_key: &KemSecretKey, ) -> Result<KemPublicKey>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl KemOperations for LibQKemProvider
Available on crate feature
alloc only.