[][src]Type Definition eva_crypto::generic::u8x4x4

type u8x4x4 = [u8x4; 4];

Trait Implementations

impl Ops for u8x4x4[src]

fn lrot(&self) -> Self[src]

use eva_crypto::generic::Ops;
assert_eq!(
    [[1, 2, 3, 4]; 4].lrot(),
    [
        [1, 2, 3, 4],
        [2, 3, 4, 1],
        [3, 4, 1, 2],
        [4, 1, 2, 3]
    ]
);

fn rrot(&self) -> Self[src]

use eva_crypto::generic::Ops;
assert_eq!(
    [[1, 2, 3, 4]; 4].lrot().rrot(),
    [[1, 2, 3, 4]; 4]
);

fn xor(&self, rhs: &Self) -> Self[src]

use eva_crypto::generic::Ops;
assert_eq!(
    [[0x1, 0x2, 0x3, 0x4]; 4].xor(&[[0x11, 0x22, 0x33, 0x44]; 4]),
    [[0x10, 0x20, 0x30, 0x40]; 4]
);

fn and(&self, rhs: &Self) -> Self[src]

use eva_crypto::generic::Ops;
assert_eq!(
    [[0x1, 0x2, 0x3, 0x4]; 4].and(&[[0x10, 0x20, 0x30, 0x40]; 4]),
    [[0; 4]; 4]
);

fn gmul(&self, rhs: &Self, bits: u8) -> Self[src]

use eva_crypto::generic::Ops;
assert_eq!(
    [
       [0x0e, 0x09, 0x0d, 0x0b],
       [0x0b, 0x0e, 0x09, 0x0d],
       [0x0d, 0x0b, 0x0e, 0x09],
       [0x09, 0x0d, 0x0b, 0x0e],
   ].gmul(
   &[
       [0x02, 0x01, 0x01, 0x03],
       [0x03, 0x02, 0x01, 0x01],
       [0x01, 0x03, 0x02, 0x01],
       [0x01, 0x01, 0x03, 0x02],
   ], 8),
   [[1, 0, 0, 0]; 4].rrot()
);

impl Permutation for u8x4x4[src]