// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. //! Defines the CipherSuite trait to specify the underlying primitives for OPAQUE use crate::{ errors::InternalPakeError, group::Group, keypair::{Key, KeyPair}, slow_hash::SlowHash, }; use generic_array::typenum::{U32, U64}; use rand_core::{CryptoRng, RngCore}; /// Configures the underlying primitives used in OPAQUE pub trait CipherSuite { type Aead: aead::NewAead + aead::Aead; type Group: Group; type KeyFormat: KeyPair + PartialEq; type SlowHash: SlowHash; /// Generating a random key pair given a cryptographic rng fn generate_random_keypair( rng: &mut R, ) -> Result { Self::KeyFormat::generate_random(rng) } }