Function streamlined_ntru_prime::decapsulate
source · Expand description
Decapsulates ciphertext with a known private key. Returns a result containing the shared key.
Example
use streamlined_ntru_prime::*;
let (public_key, private_key) = generate_key();
let (cipher_text, shared_secret_encap) = encapsulate(public_key);
let shared_secret_decap = decapsulate(cipher_text, private_key)
.expect("Decapsulation error");
assert_eq!(shared_secret_encap, shared_secret_decap);