Skip to main content

keypairfrom

Function keypairfrom 

Source
pub fn keypairfrom<R>(
    public: &mut [u8; 1184],
    secret: &mut [u8; 2400],
    rng: &mut R,
) -> Result<Keypair, KyberLibError>
where R: RngCore + CryptoRng,
Expand description

Verify that given secret and public key matches and put them in the KeyPair structure after zeroize them if asked.

ยงExample

let mut rng = rand::thread_rng();
let keys = keypair(&mut rng)?;
let mut public = keys.public;
let mut secret = keys.secret;
let _ = keypairfrom(&mut public, &mut secret, &mut rng)?;