Trait irmaseal_core::kem::IBKEM
source · [−]pub trait IBKEM: Clone {
type Pk: Compress;
type Sk: Compress;
type Usk: Compress;
type Ct: Compress + Default;
type Id: Copy + Default + Derive;
const IDENTIFIER: &'static str;
const PK_BYTES: usize;
const SK_BYTES: usize;
const USK_BYTES: usize;
const CT_BYTES: usize;
fn setup<R>(rng: &mut R) -> (Self::Pk, Self::Sk)
where
R: Rng + CryptoRng;
fn extract_usk<R>(
pk: Option<&Self::Pk>,
sk: &Self::Sk,
id: &Self::Id,
rng: &mut R
) -> Self::Usk
where
R: Rng + CryptoRng;
fn encaps<R>(
pk: &Self::Pk,
id: &Self::Id,
rng: &mut R
) -> (Self::Ct, SharedSecret)
where
R: Rng + CryptoRng;
fn decaps(
mpk: Option<&Self::Pk>,
usk: &Self::Usk,
ct: &Self::Ct
) -> Result<SharedSecret, Error>;
}
Expand description
Identity-based key encapsulation mechanism (IBKEM).
Associated Types
Associated Constants
const IDENTIFIER: &'static str
const IDENTIFIER: &'static str
Scheme identifier.
Required methods
Creates a MSK, MPK pair.
Extract a user secret key for an identity using the MSK.
Optionally requires the system’s public key.
Encapsulate a shared secret using the master public key and an identity.
Decrypt a ciphertext using a user secret key to retrieve the shared secret.
Optionally requires a public key to perform this operation.
For some schemes this operation can fail explicitly, e.g., when an illegitimate ciphertext is used as input.