[−][src]Struct oqs::kem::Kem
Contains a KEM algorithm
Implementations
impl Kem
[src]
pub fn new(algorithm: Algorithm) -> Result<Self>
[src]
Construct a new algorithm
pub fn name(&self) -> Cow<'_, str>
[src]
Get the name of the algorithm
pub fn version(&self) -> Cow<'_, str>
[src]
Get the version of the implementation
pub fn claimed_nist_level(&self) -> u8
[src]
Get the claimed nist level
pub fn is_ind_cca(&self) -> bool
[src]
Is the algorithm ind_cca secure
pub fn length_public_key(&self) -> usize
[src]
Get the length of the public key
pub fn length_secret_key(&self) -> usize
[src]
Get the length of the secret key
pub fn length_ciphertext(&self) -> usize
[src]
Get the length of the ciphertext
pub fn length_shared_secret(&self) -> usize
[src]
Get the length of a shared secret
pub fn secret_key_from_bytes<'a>(&self, buf: &'a [u8]) -> SecretKeyRef<'a>
[src]
Obtain a secret key objects from bytes
pub fn public_key_from_bytes<'a>(&self, buf: &'a [u8]) -> PublicKeyRef<'a>
[src]
Obtain a public key from bytes
pub fn ciphertext_from_bytes<'a>(&self, buf: &'a [u8]) -> CiphertextRef<'a>
[src]
Obtain a ciphertext from bytes
pub fn shared_secret_from_bytes<'a>(&self, buf: &'a [u8]) -> SharedSecretRef<'a>
[src]
Obtain a secret key from bytes
pub fn keypair(&self) -> Result<(PublicKey, SecretKey)>
[src]
Generate a new keypair
pub fn encapsulate<'a, P: Into<PublicKeyRef<'a>>>(
&self,
pk: P
) -> Result<(Ciphertext, SharedSecret)>
[src]
&self,
pk: P
) -> Result<(Ciphertext, SharedSecret)>
Encapsulate to the provided public key
pub fn decapsulate<'a, 'b, S: Into<SecretKeyRef<'a>>, C: Into<CiphertextRef<'b>>>(
&self,
sk: S,
ct: C
) -> Result<SharedSecret>
[src]
&self,
sk: S,
ct: C
) -> Result<SharedSecret>
Decapsulate the provided ciphertext
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,