Function ntru::encrypt
[−]
[src]
pub fn encrypt(msg: &[u8], public: &NtruEncPubKey, params: &NtruEncParams, rand_ctx: &NtruRandContext) -> Result<Box<[u8]>, NtruError>
Encrypts a message
If a deterministic RNG is used, the encrypted message will also be deterministic for a given
combination of plain text, key, and random seed. See P1363.1 section 9.2.2.
The parameters needed are the following:
* msg: The message to encrypt as an u8
slice.
* public: The public key to encrypt the message with.
* params: The NtruEncrypt parameters to use.
* and_ctx: An initialized random number generator.