7#include <botan/internal/chacha.h>
9#include <botan/internal/simd_32.h>
14void ChaCha::chacha_simd32_x4(uint8_t output[64 * 4], uint32_t state[16],
size_t rounds) {
16 const SIMD_4x32 CTR0 = SIMD_4x32(0, 1, 2, 3);
18 const uint32_t C = 0xFFFFFFFF - state[12];
19 const SIMD_4x32 CTR1 = SIMD_4x32(0, C < 1, C < 2, C < 3);
38 for(
size_t r = 0; r != rounds / 2; ++r) {
109 R15 = R15.rotl<16>();
110 R12 = R12.rotl<16>();
111 R13 = R13.rotl<16>();
112 R14 = R14.rotl<16>();
124 R05 = R05.rotl<12>();
125 R06 = R06.rotl<12>();
126 R07 = R07.rotl<12>();
127 R04 = R04.rotl<12>();
182 R00.store_le(output + 0 * 16);
183 R04.store_le(output + 1 * 16);
184 R08.store_le(output + 2 * 16);
185 R12.store_le(output + 3 * 16);
186 R01.store_le(output + 4 * 16);
187 R05.store_le(output + 5 * 16);
188 R09.store_le(output + 6 * 16);
189 R13.store_le(output + 7 * 16);
190 R02.store_le(output + 8 * 16);
191 R06.store_le(output + 9 * 16);
192 R10.store_le(output + 10 * 16);
193 R14.store_le(output + 11 * 16);
194 R03.store_le(output + 12 * 16);
195 R07.store_le(output + 13 * 16);
196 R11.store_le(output + 14 * 16);
197 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