[][src]Struct oqs::kem::Kem

pub struct Kem { /* fields omitted */ }

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]

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]

Decapsulate the provided ciphertext

Trait Implementations

impl Drop for Kem[src]

impl Sync for Kem[src]

Auto Trait Implementations

impl RefUnwindSafe for Kem

impl !Send for Kem

impl Unpin for Kem

impl UnwindSafe for Kem

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.