[][src]Trait rcmixed::traits::SymmetricAlgorithm

pub trait SymmetricAlgorithm {
    type Key: Serialize + DeserializeOwned + Default;

    const KEY_LENGTH: usize;

    fn encrypt(plain: &[u8], session_key: &Self::Key) -> Vec<u8>;
fn decrypt(cipher: &[u8], session_key: &Self::Key) -> Vec<u8>;
fn from_bytes(bytes: &[u8]) -> Option<Self::Key>;
fn to_bytes(&self) -> Vec<u8>; }

Associated Types

Loading content...

Associated Constants

Loading content...

Required methods

fn encrypt(plain: &[u8], session_key: &Self::Key) -> Vec<u8>

fn decrypt(cipher: &[u8], session_key: &Self::Key) -> Vec<u8>

fn from_bytes(bytes: &[u8]) -> Option<Self::Key>

fn to_bytes(&self) -> Vec<u8>

Loading content...

Implementors

Loading content...