Botan
3.11.1
Crypto and TLS for C&
src
lib
utils
simd
simd_avx2
simd_avx2_gfni.h
Go to the documentation of this file.
1
/*
2
* (C) 2024 Jack Lloyd
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6
7
#ifndef BOTAN_SIMD_AVX2_GFNI_H_
8
#define BOTAN_SIMD_AVX2_GFNI_H_
9
10
#include <botan/internal/simd_avx2.h>
11
12
#include <botan/internal/gfni_utils.h>
13
#include <botan/internal/isa_extn.h>
14
15
namespace
Botan
{
16
17
template
<u
int
64_t A, u
int
8_t B>
18
BOTAN_FORCE_INLINE
BOTAN_FN_ISA_AVX2_GFNI
SIMD_8x32
gf2p8affine
(
const
SIMD_8x32
& x) {
19
return
SIMD_8x32
(_mm256_gf2p8affine_epi64_epi8(x.
raw
(), _mm256_set1_epi64x(A), B));
20
}
21
22
template
<u
int
64_t A, u
int
8_t B>
23
BOTAN_FORCE_INLINE
BOTAN_FN_ISA_AVX2_GFNI
SIMD_8x32
gf2p8affineinv
(
const
SIMD_8x32
& x) {
24
return
SIMD_8x32
(_mm256_gf2p8affineinv_epi64_epi8(x.
raw
(), _mm256_set1_epi64x(A), B));
25
}
26
27
BOTAN_FORCE_INLINE
BOTAN_FN_ISA_AVX2_GFNI
SIMD_8x32
gf2p8mul
(
const
SIMD_8x32
& a,
const
SIMD_8x32
& b) {
28
return
SIMD_8x32
(_mm256_gf2p8mul_epi8(a.
raw
(), b.
raw
()));
29
}
30
31
}
// namespace Botan
32
33
#endif
Botan::SIMD_8x32
Definition
simd_avx2.h:19
Botan::SIMD_8x32::raw
__m256i BOTAN_FN_ISA_AVX2 raw() const noexcept
Definition
simd_avx2.h:340
BOTAN_FORCE_INLINE
#define BOTAN_FORCE_INLINE
Definition
compiler.h:87
Botan
Definition
alg_id.cpp:13
Botan::gf2p8affineinv
BOTAN_FORCE_INLINE BOTAN_FN_ISA_AVX2_GFNI SIMD_8x32 gf2p8affineinv(const SIMD_8x32 &x)
Definition
simd_avx2_gfni.h:23
Botan::gf2p8mul
BOTAN_FORCE_INLINE BOTAN_FN_ISA_AVX2_GFNI SIMD_8x32 gf2p8mul(const SIMD_8x32 &a, const SIMD_8x32 &b)
Definition
simd_avx2_gfni.h:27
Botan::gf2p8affine
BOTAN_FORCE_INLINE BOTAN_FN_ISA_AVX2_GFNI SIMD_8x32 gf2p8affine(const SIMD_8x32 &x)
Definition
simd_avx2_gfni.h:18
Generated by
1.15.0