7#include <botan/internal/chacha.h>
9#include <botan/assert.h>
10#include <botan/internal/simd_4x32.h>
15void ChaCha::chacha_simd32_x4(uint8_t output[64 * 4], uint32_t state[16],
size_t rounds) {
17 const SIMD_4x32 CTR0 = SIMD_4x32(0, 1, 2, 3);
19 const uint32_t C = 0xFFFFFFFF - state[12];
20 const SIMD_4x32 CTR1 = SIMD_4x32(0, C < 1, C < 2, C < 3);
39 for(
size_t r = 0; r != rounds / 2; ++r) {
110 R15 = R15.rotl<16>();
111 R12 = R12.rotl<16>();
112 R13 = R13.rotl<16>();
113 R14 = R14.rotl<16>();
125 R05 = R05.rotl<12>();
126 R06 = R06.rotl<12>();
127 R07 = R07.rotl<12>();
128 R04 = R04.rotl<12>();
183 R00.store_le(output + 0 * 16);
184 R04.store_le(output + 1 * 16);
185 R08.store_le(output + 2 * 16);
186 R12.store_le(output + 3 * 16);
187 R01.store_le(output + 4 * 16);
188 R05.store_le(output + 5 * 16);
189 R09.store_le(output + 6 * 16);
190 R13.store_le(output + 7 * 16);
191 R02.store_le(output + 8 * 16);
192 R06.store_le(output + 9 * 16);
193 R10.store_le(output + 10 * 16);
194 R14.store_le(output + 11 * 16);
195 R03.store_le(output + 12 * 16);
196 R07.store_le(output + 13 * 16);
197 R11.store_le(output + 14 * 16);
198 R15.store_le(output + 15 * 16);
#define BOTAN_ASSERT(expr, assertion_made)
static void transpose(SIMD_4x32 &B0, SIMD_4x32 &B1, SIMD_4x32 &B2, SIMD_4x32 &B3) noexcept
static SIMD_4x32 splat(uint32_t B) noexcept