Botan  2.7.0
Crypto and TLS for C++11
Namespaces | Macros
serpent_simd.cpp File Reference
#include <botan/serpent.h>
#include <botan/internal/serpent_sbox.h>
#include <botan/internal/simd_32.h>

Go to the source code of this file.

Namespaces

 Botan
 

Macros

#define i_transform(B0, B1, B2, B3)
 
#define key_xor(round, B0, B1, B2, B3)
 
#define transform(B0, B1, B2, B3)
 

Macro Definition Documentation

◆ i_transform

#define i_transform (   B0,
  B1,
  B2,
  B3 
)
Value:
do { \
B2 = B2.rotr<22>(); \
B0 = B0.rotr<5>(); \
B2 ^= B3 ^ B1.shl<7>(); \
B0 ^= B1 ^ B3; \
B3 = B3.rotr<7>(); \
B1 = B1.rotr<1>(); \
B3 ^= B2 ^ B0.shl<3>(); \
B1 ^= B0 ^ B2; \
B2 = B2.rotr<3>(); \
B0 = B0.rotr<13>(); \
} while(0)

Definition at line 39 of file serpent_simd.cpp.

Referenced by Botan::Serpent::decrypt_n().

◆ key_xor

#define key_xor (   round,
  B0,
  B1,
  B2,
  B3 
)
Value:
do { \
B0 ^= SIMD_32::splat(m_round_key[4*round ]); \
B1 ^= SIMD_32::splat(m_round_key[4*round+1]); \
B2 ^= SIMD_32::splat(m_round_key[4*round+2]); \
B3 ^= SIMD_32::splat(m_round_key[4*round+3]); \
} while(0)

Definition at line 14 of file serpent_simd.cpp.

◆ transform

#define transform (   B0,
  B1,
  B2,
  B3 
)
Value:
do { \
B0 = B0.rotl<13>(); \
B2 = B2.rotl<3>(); \
B1 ^= B0 ^ B2; \
B3 ^= B2 ^ B0.shl<3>(); \
B1 = B1.rotl<1>(); \
B3 = B3.rotl<7>(); \
B0 ^= B1 ^ B3; \
B2 ^= B3 ^ B1.shl<7>(); \
B0 = B0.rotl<5>(); \
B2 = B2.rotl<22>(); \
} while(0)

Definition at line 25 of file serpent_simd.cpp.

Referenced by Botan::ARIA_128::decrypt_n(), Botan::ARIA_192::decrypt_n(), Botan::ARIA_256::decrypt_n(), Botan::Serpent::encrypt_n(), Botan::ARIA_128::encrypt_n(), Botan::ARIA_192::encrypt_n(), and Botan::ARIA_256::encrypt_n().