pub fn create_forward_secure_key_pair(
    seed: Randomness,
    associated_data: &[u8],
) -> FsEncryptionKeySetWithPop {
    let mut rng = crypto::RAND_ChaCha20::new(seed.get());
    let (lib_public_key_with_pop, lib_secret_key) =
        crypto::kgen(associated_data, &SYS_PARAMS, &mut rng);
    let (public_key, pop) = public_key_from_miracl(&lib_public_key_with_pop);
    let secret_key = secret_key_from_miracl(&lib_secret_key);
    FsEncryptionKeySetWithPop {
        public_key,
        pop,
        secret_key,
    }
}
/// Generates a forward secure key pair.
///
/// # Arguments
/// * `seed` - randomness used to seed the PRNG for generating the keys. It must
///   be treated as a secret.
/// * `associated_data` - public information for the Proof of Possession of the
///   key.
Generates a forward secure key pair.
Generates a forward secure key pair .
pub fn create_forward_secure_key_pair(
    seed: Randomness,
    associated_data: &[u8],
) -> FsEncryptionKeySetWithPop {
    let mut rng = crypto::RAND_ChaCha20::new(seed.get());
    let (lib_public_key_with_pop, lib_secret_key) =
        crypto::kgen(associated_data, &SYS_PARAMS, &mut rng);
    let (public_key, pop) = public_key_from_miracl(&lib_public_key_with_pop);
    let secret_key = secret_key_from_miracl(&lib_secret_key);
    FsEncryptionKeySetWithPop {
        public_key,
        pop,
        secret_key,
    }
}
pub fn create_forward_secure_key_pair ( seed : Randomness , associated_data : & [ u8 ] , ) -> FsEncryptionKeySetWithPop { let mut rng = crypto :: RAND_ChaCha20 :: new ( seed . get ( ) ) ; let ( lib_public_key_with_pop , lib_secret_key ) = crypto :: kgen ( associated_data , & SYS_PARAMS , & mut rng ) ; let ( public_key , pop ) = public_key_from_miracl ( & lib_public_key_with_pop ) ; let secret_key = secret_key_from_miracl ( & lib_secret_key ) ; FsEncryptionKeySetWithPop { public_key , pop , secret_key , } }
Generates a forward secure key pair.
Generates a forward secure key pair .
seed
Randomness
associated_data
&[u8]
seed
Randomness
associated_data
&[u8]