Struct tss_esapi::abstraction::cipher::Cipher
source · pub struct Cipher { /* private fields */ }
Expand description
Block cipher identifiers
Structure useful for handling an abstract representation of ciphers. Ciphers are defined foremost through their symmetric algorithm and, depending on the type of that algorithm, on a set of other values.
Implementations§
source§impl Cipher
impl Cipher
sourcepub fn aes(mode: SymmetricMode, key_bits: u16) -> Result<Self>
pub fn aes(mode: SymmetricMode, key_bits: u16) -> Result<Self>
Constructor for AES cipher identifier
key_bits
must be one of 128, 192 or 256.
sourcepub fn camellia(mode: SymmetricMode, key_bits: u16) -> Result<Self>
pub fn camellia(mode: SymmetricMode, key_bits: u16) -> Result<Self>
Constructor for Camellia cipher identifier
key_bits
must be one of 128, 192 or 256.
sourcepub fn tdes(mode: SymmetricMode, key_bits: u16) -> Result<Self>
pub fn tdes(mode: SymmetricMode, key_bits: u16) -> Result<Self>
Constructor for Triple DES cipher identifier
key_bits
must be one of 56, 112 or 168.
sourcepub fn sm4(mode: SymmetricMode) -> Self
pub fn sm4(mode: SymmetricMode) -> Self
Constructor for SM4 cipher identifier
sourcepub fn xor(hash: HashingAlgorithm) -> Self
pub fn xor(hash: HashingAlgorithm) -> Self
Constructor for XOR “cipher” identifier
sourcepub fn object_type() -> AlgorithmIdentifier
pub fn object_type() -> AlgorithmIdentifier
Get general object type for symmetric ciphers.
sourcepub fn mode(self) -> Option<SymmetricMode>
pub fn mode(self) -> Option<SymmetricMode>
Get the cipher mode.
sourcepub fn hash(self) -> Option<HashingAlgorithm>
pub fn hash(self) -> Option<HashingAlgorithm>
Get the hash algorithm used with an XOR cipher
sourcepub fn algorithm(&self) -> SymmetricAlgorithm
pub fn algorithm(&self) -> SymmetricAlgorithm
Get the symmetrical algorithm for the cipher.
sourcepub fn aes_128_cfb() -> Self
pub fn aes_128_cfb() -> Self
Constructor for 128 bit AES in CFB mode.
sourcepub fn aes_256_cfb() -> Self
pub fn aes_256_cfb() -> Self
Constructor for 256 bit AES in CFB mode.