[][src]Trait ez_pqcrypto::PostQuantumType

pub trait PostQuantumType {
    fn new_alice() -> Self
    where
        Self: Sized
;
fn new_bob(public_key: &[u8]) -> Self
    where
        Self: Sized
;
fn alice_on_receive_ciphertext(&mut self, ciphertext: &[u8]);
fn get_public_key(&self) -> &[u8];
fn get_secret_key(&self) -> &[u8];
fn get_ciphertext(&self) -> &[u8];
fn get_shared_secret(&self) -> &[u8]; fn encrypt_data<T: AsRef<[u8]>>(&self, input: T, output: &mut BytesMut)
    where
        Self: Sized
, { ... }
fn decrypt_data<T: AsRef<[u8]>>(&self, input: T, output: &mut BytesMut)
    where
        Self: Sized
, { ... } }

Used to get different algorithm types dynamically

Required methods

fn new_alice() -> Self where
    Self: Sized

Creates a new self for the initiating node

fn new_bob(public_key: &[u8]) -> Self where
    Self: Sized

Creates a new self for the receiving node

fn alice_on_receive_ciphertext(&mut self, ciphertext: &[u8])

Internally creates shared key after bob sends a response back to Alice

fn get_public_key(&self) -> &[u8]

Gets the public key

fn get_secret_key(&self) -> &[u8]

Gets the secret key (If node is Alice type)

fn get_ciphertext(&self) -> &[u8]

Gets the ciphertext

fn get_shared_secret(&self) -> &[u8]

Gets the shared secret

Loading content...

Provided methods

fn encrypt_data<T: AsRef<[u8]>>(&self, input: T, output: &mut BytesMut) where
    Self: Sized

Encrypts the data. Since this is meant for small data, no heavy optimization is used

fn decrypt_data<T: AsRef<[u8]>>(&self, input: T, output: &mut BytesMut) where
    Self: Sized

Decrypts the data

Loading content...

Implementors

Loading content...