8#include <botan/internal/noekeon.h>
10#include <botan/internal/simd_32.h>
26 T ^=
T.rotl<8>() ^
T.rotr<8>();
36 T ^=
T.rotl<8>() ^
T.rotr<8>();
61void Noekeon::simd_encrypt_4(
const uint8_t in[], uint8_t out[])
const {
74 for(
size_t i = 0; i != 16; ++i) {
77 theta(A0, A1, A2, A3, K0, K1, K2, K3);
83 gamma(A0, A1, A2, A3);
91 theta(A0, A1, A2, A3, K0, K1, K2, K3);
96 A1.store_be(out + 16);
97 A2.store_be(out + 32);
98 A3.store_be(out + 48);
104void Noekeon::simd_decrypt_4(
const uint8_t in[], uint8_t out[])
const {
117 for(
size_t i = 0; i != 16; ++i) {
118 theta(A0, A1, A2, A3, K0, K1, K2, K3);
126 gamma(A0, A1, A2, A3);
133 theta(A0, A1, A2, A3, K0, K1, K2, K3);
139 A1.store_be(out + 16);
140 A2.store_be(out + 32);
141 A3.store_be(out + 48);
static SIMD_4x32 load_be(const void *in) noexcept
static void transpose(SIMD_4x32 &B0, SIMD_4x32 &B1, SIMD_4x32 &B2, SIMD_4x32 &B3) noexcept
static SIMD_4x32 splat(uint32_t B) noexcept
void theta(SIMD_4x32 &A0, SIMD_4x32 &A1, SIMD_4x32 &A2, SIMD_4x32 &A3, const SIMD_4x32 &K0, const SIMD_4x32 &K1, const SIMD_4x32 &K2, const SIMD_4x32 &K3)
void gamma(SIMD_4x32 &A0, SIMD_4x32 &A1, SIMD_4x32 &A2, SIMD_4x32 &A3)