7#include <botan/internal/salsa20.h>
9#include <botan/assert.h>
10#include <botan/internal/simd_avx2.h>
15void BOTAN_FN_ISA_AVX2 Salsa20::salsa20_avx2_x8(uint8_t output[64 * 8], uint32_t state[16],
size_t rounds) {
20 const SIMD_8x32 CTR_LO =
SIMD_8x32::splat(state[8]) + SIMD_8x32(0, 1, 2, 3, 4, 5, 6, 7);
32 SIMD_8x32 R08 = CTR_LO;
33 SIMD_8x32 R09 = CTR_HI;
41 for(
size_t r = 0; r != rounds / 2; ++r) {
103 R00.store_le(output);
104 R08.store_le(output + 32 * 1);
105 R01.store_le(output + 32 * 2);
106 R09.store_le(output + 32 * 3);
107 R02.store_le(output + 32 * 4);
108 R10.store_le(output + 32 * 5);
109 R03.store_le(output + 32 * 6);
110 R11.store_le(output + 32 * 7);
111 R04.store_le(output + 32 * 8);
112 R12.store_le(output + 32 * 9);
113 R05.store_le(output + 32 * 10);
114 R13.store_le(output + 32 * 11);
115 R06.store_le(output + 32 * 12);
116 R14.store_le(output + 32 * 13);
117 R07.store_le(output + 32 * 14);
118 R15.store_le(output + 32 * 15);
#define BOTAN_ASSERT(expr, assertion_made)
static BOTAN_FN_ISA_AVX2 void reset_registers() noexcept
static BOTAN_FN_ISA_AVX2 void transpose(SIMD_8x32 &B0, SIMD_8x32 &B1, SIMD_8x32 &B2, SIMD_8x32 &B3) noexcept
static BOTAN_FN_ISA_AVX2 void zero_registers() noexcept
static BOTAN_FN_ISA_AVX2 SIMD_8x32 splat(uint32_t B) noexcept
SIMD_8x32 BOTAN_FN_ISA_AVX2 unsigned_lt(const SIMD_8x32 &other) const noexcept
BOTAN_FORCE_INLINE constexpr T rotl(T input)