Botan 2.19.3
Crypto and TLS for C&
Namespaces | Macros
gost_28147.cpp File Reference
#include <botan/gost_28147.h>
#include <botan/exceptn.h>
#include <botan/loadstor.h>
#include <botan/rotate.h>

Go to the source code of this file.

Namespaces

namespace  Botan
 

Macros

#define GOST_2ROUND(N1, N2, R1, R2)
 

Macro Definition Documentation

◆ GOST_2ROUND

#define GOST_2ROUND (   N1,
  N2,
  R1,
  R2 
)
Value:
do { \
uint32_t T0 = N1 + m_EK[R1]; \
N2 ^= m_SBOX[get_byte(3, T0)] | \
m_SBOX[get_byte(2, T0)+256] | \
m_SBOX[get_byte(1, T0)+512] | \
m_SBOX[get_byte(0, T0)+768]; \
\
uint32_t T1 = N2 + m_EK[R2]; \
N1 ^= m_SBOX[get_byte(3, T1)] | \
m_SBOX[get_byte(2, T1)+256] | \
m_SBOX[get_byte(1, T1)+512] | \
m_SBOX[get_byte(0, T1)+768]; \
} while(0)

Definition at line 96 of file gost_28147.cpp.

97 { \
98 uint32_t T0 = N1 + m_EK[R1]; \
99 N2 ^= m_SBOX[get_byte(3, T0)] | \
100 m_SBOX[get_byte(2, T0)+256] | \
101 m_SBOX[get_byte(1, T0)+512] | \
102 m_SBOX[get_byte(0, T0)+768]; \
103 \
104 uint32_t T1 = N2 + m_EK[R2]; \
105 N1 ^= m_SBOX[get_byte(3, T1)] | \
106 m_SBOX[get_byte(2, T1)+256] | \
107 m_SBOX[get_byte(1, T1)+512] | \
108 m_SBOX[get_byte(0, T1)+768]; \
109 } while(0)
constexpr uint8_t get_byte(size_t byte_num, T input)
Definition loadstor.h:41