[][src]Struct rust_sike::kem::KEM

pub struct KEM<K> { /* fields omitted */ }

Key-encapsulation mechanism (ref Algorithm 2, Section 1.3.10)

Methods

impl<K: FiniteField + Clone + Debug> KEM<K>[src]

pub fn setup(params: PublicParameters<K>) -> Self[src]

Initialise the KEM

pub fn keygen(&self) -> Result<(Vec<u8>, SecretKey, PublicKey<K>), String>[src]

Generate a secret and a keypair

pub fn encaps(&self, pk: &PublicKey<K>) -> Result<(Ciphertext, Vec<u8>), String>[src]

Encapsulate the shared secret using the PKE encryption

pub fn decaps(
    &self,
    s: &[u8],
    sk: &SecretKey,
    pk: &PublicKey<K>,
    c: Ciphertext
) -> Result<Vec<u8>, String>
[src]

Decapsulate the shared secret using the PKE decryption

Auto Trait Implementations

impl<K> RefUnwindSafe for KEM<K> where
    K: RefUnwindSafe

impl<K> Send for KEM<K> where
    K: Send

impl<K> Sync for KEM<K> where
    K: Sync

impl<K> Unpin for KEM<K> where
    K: Unpin

impl<K> UnwindSafe for KEM<K> where
    K: UnwindSafe

Blanket Implementations

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

impl<T> Az for T[src]

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

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

impl<T> CheckedAs for T[src]

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

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

impl<T> OverflowingAs for T[src]

impl<T> SaturatingAs for T[src]

impl<T> StaticAs for 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WrappingAs for T[src]