Crypto++  8.8
Free C++ class library of cryptographic schemes
Macros | Functions
adv_simd.h File Reference

Template for AdvancedProcessBlocks and SIMD processing. More...

Go to the source code of this file.

Macros

#define MAYBE_CONST   const
 SunCC workaround. More...
 
#define MAYBE_UNCONST_CAST(T, x)   (x)
 SunCC workaround. More...
 
#define M128_CAST(x)   ((__m128i *)(void *)(x))
 Clang workaround. More...
 
#define CONST_M128_CAST(x)   ((const __m128i *)(const void *)(x))
 Clang workaround. More...
 

Functions

template<typename F1 , typename F6 , typename W >
size_t AdvancedProcessBlocks128_6x1_NEON (F1 func1, F6 func6, const W *subKeys, size_t rounds, const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags)
 AdvancedProcessBlocks for 1 and 6 blocks. More...
 
template<typename F1 , typename F4 , typename W >
size_t AdvancedProcessBlocks128_4x1_NEON (F1 func1, F4 func4, const W *subKeys, size_t rounds, const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags)
 AdvancedProcessBlocks for 1 and 4 blocks. More...
 
template<typename F2 , typename F6 , typename W >
size_t AdvancedProcessBlocks128_6x2_NEON (F2 func2, F6 func6, const W *subKeys, size_t rounds, const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags)
 AdvancedProcessBlocks for 2 and 6 blocks. More...
 
template<typename F2 , typename F6 , typename W >
size_t AdvancedProcessBlocks128_6x2_SSE (F2 func2, F6 func6, const W *subKeys, size_t rounds, const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags)
 AdvancedProcessBlocks for 2 and 6 blocks. More...
 
template<typename F1 , typename F4 , typename W >
size_t AdvancedProcessBlocks128_4x1_SSE (F1 func1, F4 func4, const W *subKeys, size_t rounds, const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags)
 AdvancedProcessBlocks for 1 and 4 blocks. More...
 
template<typename F1 , typename F4 , typename W >
size_t AdvancedProcessBlocks128_4x1_ALTIVEC (F1 func1, F4 func4, const W *subKeys, size_t rounds, const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags)
 AdvancedProcessBlocks for 1 and 4 blocks. More...
 
template<typename F1 , typename F6 , typename W >
size_t AdvancedProcessBlocks128_6x1_ALTIVEC (F1 func1, F6 func6, const W *subKeys, size_t rounds, const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags)
 AdvancedProcessBlocks for 1 and 6 blocks. More...
 

Detailed Description

Template for AdvancedProcessBlocks and SIMD processing.

Definition in file adv_simd.h.

Macro Definition Documentation

◆ MAYBE_CONST

#define MAYBE_CONST   const

SunCC workaround.

SunCC loses the const on AES_Enc_Block and AES_Dec_Block

See also
Issue 224, SunCC and failed compile for rijndael.cpp

Definition at line 590 of file adv_simd.h.

◆ MAYBE_UNCONST_CAST

#define MAYBE_UNCONST_CAST (   T,
 
)    (x)

SunCC workaround.

SunCC loses the const on AES_Enc_Block and AES_Dec_Block

See also
Issue 224, SunCC and failed compile for rijndael.cpp

Definition at line 595 of file adv_simd.h.

◆ M128_CAST

#define M128_CAST (   x)    ((__m128i *)(void *)(x))

Clang workaround.

Clang issues spurious alignment warnings

See also
Issue 20670, _mm_loadu_si128 parameter has wrong type

Definition at line 609 of file adv_simd.h.

◆ CONST_M128_CAST

#define CONST_M128_CAST (   x)    ((const __m128i *)(const void *)(x))

Clang workaround.

Clang issues spurious alignment warnings

See also
Issue 20670, _mm_loadu_si128 parameter has wrong type

Definition at line 614 of file adv_simd.h.

Function Documentation

◆ AdvancedProcessBlocks128_6x1_NEON()

template<typename F1 , typename F6 , typename W >
size_t AdvancedProcessBlocks128_6x1_NEON ( F1  func1,
F6  func6,
const W *  subKeys,
size_t  rounds,
const byte inBlocks,
const byte xorBlocks,
byte outBlocks,
size_t  length,
word32  flags 
)
inline

AdvancedProcessBlocks for 1 and 6 blocks.

Template Parameters
F1function to process 1 128-bit block
F6function to process 6 128-bit blocks
Wword type of the subkey table

AdvancedProcessBlocks128_6x1_NEON processes 6 and 2 NEON SIMD words at a time.

The subkey type is usually word32 or word64. F1 and F6 must use the same word type.

Definition at line 100 of file adv_simd.h.

◆ AdvancedProcessBlocks128_4x1_NEON()

template<typename F1 , typename F4 , typename W >
size_t AdvancedProcessBlocks128_4x1_NEON ( F1  func1,
F4  func4,
const W *  subKeys,
size_t  rounds,
const byte inBlocks,
const byte xorBlocks,
byte outBlocks,
size_t  length,
word32  flags 
)
inline

AdvancedProcessBlocks for 1 and 4 blocks.

Template Parameters
F1function to process 1 128-bit block
F4function to process 4 128-bit blocks
Wword type of the subkey table

AdvancedProcessBlocks128_4x1_NEON processes 4 and 1 NEON SIMD words at a time.

The subkey type is usually word32 or word64. V is the vector type and it is usually uint32x4_t or uint32x4_t. F1, F4, and W must use the same word and vector type.

Definition at line 254 of file adv_simd.h.

◆ AdvancedProcessBlocks128_6x2_NEON()

template<typename F2 , typename F6 , typename W >
size_t AdvancedProcessBlocks128_6x2_NEON ( F2  func2,
F6  func6,
const W *  subKeys,
size_t  rounds,
const byte inBlocks,
const byte xorBlocks,
byte outBlocks,
size_t  length,
word32  flags 
)
inline

AdvancedProcessBlocks for 2 and 6 blocks.

Template Parameters
F2function to process 2 128-bit blocks
F6function to process 6 128-bit blocks
Wword type of the subkey table

AdvancedProcessBlocks128_6x2_NEON processes 6 and 2 NEON SIMD words at a time. For a single block the template uses F2 with a zero block.

The subkey type is usually word32 or word64. F2 and F6 must use the same word type.

Definition at line 388 of file adv_simd.h.

◆ AdvancedProcessBlocks128_6x2_SSE()

template<typename F2 , typename F6 , typename W >
size_t AdvancedProcessBlocks128_6x2_SSE ( F2  func2,
F6  func6,
const W *  subKeys,
size_t  rounds,
const byte inBlocks,
const byte xorBlocks,
byte outBlocks,
size_t  length,
word32  flags 
)
inline

AdvancedProcessBlocks for 2 and 6 blocks.

Template Parameters
F2function to process 2 128-bit blocks
F6function to process 6 128-bit blocks
Wword type of the subkey table

AdvancedProcessBlocks128_6x2_SSE processes 6 and 2 SSE SIMD words at a time. For a single block the template uses F2 with a zero block.

The subkey type is usually word32 or word64. F2 and F6 must use the same word type.

Definition at line 635 of file adv_simd.h.

◆ AdvancedProcessBlocks128_4x1_SSE()

template<typename F1 , typename F4 , typename W >
size_t AdvancedProcessBlocks128_4x1_SSE ( F1  func1,
F4  func4,
const W *  subKeys,
size_t  rounds,
const byte inBlocks,
const byte xorBlocks,
byte outBlocks,
size_t  length,
word32  flags 
)
inline

AdvancedProcessBlocks for 1 and 4 blocks.

Template Parameters
F1function to process 1 128-bit block
F4function to process 4 128-bit blocks
Wword type of the subkey table

AdvancedProcessBlocks128_4x1_SSE processes 4 and 1 SSE SIMD words at a time.

The subkey type is usually word32 or word64. F1 and F4 must use the same word type.

Definition at line 830 of file adv_simd.h.

◆ AdvancedProcessBlocks128_4x1_ALTIVEC()

template<typename F1 , typename F4 , typename W >
size_t AdvancedProcessBlocks128_4x1_ALTIVEC ( F1  func1,
F4  func4,
const W *  subKeys,
size_t  rounds,
const byte inBlocks,
const byte xorBlocks,
byte outBlocks,
size_t  length,
word32  flags 
)
inline

AdvancedProcessBlocks for 1 and 4 blocks.

Template Parameters
F1function to process 1 128-bit block
F4function to process 4 128-bit blocks
Wword type of the subkey table

AdvancedProcessBlocks128_4x1_ALTIVEC processes 4 and 1 Altivec SIMD words at a time.

The subkey type is usually word32 or word64. F1 and F4 must use the same word type.

Definition at line 971 of file adv_simd.h.

◆ AdvancedProcessBlocks128_6x1_ALTIVEC()

template<typename F1 , typename F6 , typename W >
size_t AdvancedProcessBlocks128_6x1_ALTIVEC ( F1  func1,
F6  func6,
const W *  subKeys,
size_t  rounds,
const byte inBlocks,
const byte xorBlocks,
byte outBlocks,
size_t  length,
word32  flags 
)
inline

AdvancedProcessBlocks for 1 and 6 blocks.

Template Parameters
F1function to process 1 128-bit block
F6function to process 6 128-bit blocks
Wword type of the subkey table

AdvancedProcessBlocks128_6x1_ALTIVEC processes 6 and 1 Altivec SIMD words at a time.

The subkey type is usually word32 or word64. F1 and F6 must use the same word type.

Definition at line 1116 of file adv_simd.h.