pub struct AesBlock(/* private fields */);Implementations§
Source§impl AesBlock
impl AesBlock
pub const fn new(value: [u8; 16]) -> Self
pub const fn to_bytes(self) -> [u8; 16]
pub fn is_zero(self) -> bool
Sourcepub fn enc(self, round_key: Self) -> Self
pub fn enc(self, round_key: Self) -> Self
Performs one round of AES encryption function (ShiftRows->SubBytes->MixColumns->AddRoundKey)
Sourcepub fn enc_last(self, round_key: Self) -> Self
pub fn enc_last(self, round_key: Self) -> Self
Performs one round of AES encryption function without MixColumns (ShiftRows->SubBytes->AddRoundKey)
Sourcepub fn dec(self, round_key: Self) -> Self
pub fn dec(self, round_key: Self) -> Self
Performs one round of AES decryption function (InvShiftRows->InvSubBytes->InvMixColumns->AddRoundKey)
Source§impl AesBlock
impl AesBlock
Sourcepub fn chain_enc(self, keys: &[AesBlock]) -> AesBlock
pub fn chain_enc(self, keys: &[AesBlock]) -> AesBlock
Computes (self ^ keys[0]).enc(keys[1])...enc(keys[keys.len() - 1]) in the most optimized way
§Panics
If keys.len() == 0
Sourcepub fn chain_dec(self, keys: &[AesBlock]) -> AesBlock
pub fn chain_dec(self, keys: &[AesBlock]) -> AesBlock
Computes (self ^ keys[0]).dec(keys[1])...dec(keys[keys.len() - 1]) in the most optimized way
§Panics
If keys.len() == 0
Sourcepub fn chain_enc_with_last(self, keys: &[AesBlock]) -> AesBlock
pub fn chain_enc_with_last(self, keys: &[AesBlock]) -> AesBlock
Computes (self ^ keys[0]).enc(keys[1])...enc(keys[keys.len() - 2]).enc_last(keys[keys.len() - 1]) in the most optimized way
§Panics
If keys.len() < 2
Sourcepub fn chain_dec_with_last(self, keys: &[AesBlock]) -> AesBlock
pub fn chain_dec_with_last(self, keys: &[AesBlock]) -> AesBlock
Computes (self ^ keys[0]).dec(keys[1])...dec(keys[keys.len() - 2]).dec_last(keys[keys.len() - 1]) in the most optimized way
§Panics
If keys.len() < 2
Trait Implementations§
Source§impl BitAndAssign for AesBlock
impl BitAndAssign for AesBlock
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moreSource§impl BitOrAssign for AesBlock
impl BitOrAssign for AesBlock
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSource§impl BitXorAssign for AesBlock
impl BitXorAssign for AesBlock
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^= operation. Read more