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

Master public key (Mpk).

Master secret key (Msk).

User secret key (Usk).

Ciphertext (Ct).

Identity.

Associated Constants

Scheme identifier.

Size of the master public key in bytes.

Size of the master secret key in bytes.

Size of the user secret key in bytes.

Size of the ciphertext in bytes.

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.

Implementors