Function ntrumls::generate_keys [] [src]

pub fn generate_keys(params: &ParamSet) -> Option<(PrivateKey, PublicKey)>

Generates a public and private key pair

This function generates a public and private key pair to use when signing and verifying a message. It needs the NTRUMLS parameter to use, and it will return an optional tuple, with the private key in the first position and the public key in the second position. If something goes wrong, None will be returned. Example:

use ntrumls::params::{ParamSet, XXX_20151024_743};

let params = XXX_20151024_743;
let (private_key, public_key) = ntrumls::generate_keys(&params).unwrap();