Function ntru::generate_public [] [src]

pub fn generate_public(
    params: &EncParams,
    private: &PrivateKey,
    rand_context: &RandContext
) -> Result<PublicKey, Error>

New public key

Generates a new public key for an existing private key. The new public key can be used interchangeably with the existing public key(s). Generating n keys via ntru::generate_multiple_key_pairs() is more efficient than generating one and then calling ntru_gen_pub() n-1 times, so if the number of public keys needed is known beforehand and if speed matters, ntru_gen_key_pair_multi() should be used. Note that when decrypting, the public key of the key pair passed into ntru_decrypt() must match the public key used for encrypting the message. If a deterministic RNG is used, the key will be deterministic for a given random seed; otherwise, the key will be completely random.