pub trait CryptoFactory {
    type E: Encrypter;
    type D: Decrypter;
    type M: Mac;

    // Required methods
    fn new_enc(&self, key: &AES128) -> Self::E;
    fn new_dec(&self, key: &AES128) -> Self::D;
    fn new_mac(&self, key: &AES128) -> Self::M;
}
Expand description

Represents an abstraction over the crypto functions.

This trait provides a way to pick a different implementation of the crypto primitives.

Required Associated Types§

Required Methods§

source

fn new_enc(&self, key: &AES128) -> Self::E

Method that creates an Encrypter.

source

fn new_dec(&self, key: &AES128) -> Self::D

Method that creates a Decrypter.

source

fn new_mac(&self, key: &AES128) -> Self::M

Method that creates a MAC calculator.

Implementors§

source§

impl CryptoFactory for DefaultFactory

§

type E = Aes128

§

type D = Aes128

§

type M = CoreWrapper<CmacCore<Aes128>>