[−][src]Function saber::firesaber::encapsulate
pub fn encapsulate(pk_cca: &PublicKey) -> (SharedSecret, Ciphertext)
Encapsulate a secret destined for pk_cca
.
Takes a reference to Bob's PublicKey
and returns a (SharedSecret
,
Ciphertext
) tuple.
Example
use saber::saber::{PublicKey, encapsulate}; // Assume `pk_buf` holds the bytes to a public key let public_key = saber::saber::PublicKey::from_bytes(&pk_buf).unwrap(); let (shared_secret, ciphertext) = encapsulate(&public_key);