Fabcoin Core  0.16.2
P2P Digital Currency
Macros
blake2b-round.h File Reference
#include "blake2b-load-sse2.h"
Include dependency graph for blake2b-round.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __BLAKE2B_ROUND_H__
 
#define LOAD(p)   _mm_load_si128( (const __m128i *)(p) )
 
#define STORE(p, r)   _mm_store_si128((__m128i *)(p), r)
 
#define LOADU(p)   _mm_loadu_si128( (const __m128i *)(p) )
 
#define STOREU(p, r)   _mm_storeu_si128((__m128i *)(p), r)
 
#define TOF(reg)   _mm_castsi128_ps((reg))
 
#define TOI(reg)   _mm_castps_si128((reg))
 
#define LIKELY(x)   __builtin_expect((x),1)
 
#define _mm_roti_epi64(r, c)   _mm_xor_si128(_mm_srli_epi64( (r), -(c) ),_mm_slli_epi64( (r), 64-(-c) ))
 
#define G1(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h, b0, b1)
 
#define G2(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h, b0, b1)
 
#define DIAGONALIZE(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h)
 
#define UNDIAGONALIZE(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h)
 
#define ROUND(r)
 
#define BLAKE2_ROUND(row1l, row1h, row2l, row2h, row3l, row3h, row4l, row4h)
 

Macro Definition Documentation

#define __BLAKE2B_ROUND_H__

Definition at line 15 of file blake2b-round.h.

#define _mm_roti_epi64 (   r,
  c 
)    _mm_xor_si128(_mm_srli_epi64( (r), -(c) ),_mm_slli_epi64( (r), 64-(-c) ))

Definition at line 39 of file blake2b-round.h.

#define BLAKE2_ROUND (   row1l,
  row1h,
  row2l,
  row2h,
  row3l,
  row3h,
  row4l,
  row4h 
)
Value:
G1(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h); \
G2(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h); \
DIAGONALIZE(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h); \
G1(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h); \
G2(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h); \
UNDIAGONALIZE(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h);
#define UNDIAGONALIZE(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h)
#define DIAGONALIZE(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h)
#define G2(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h, b0, b1)
Definition: blake2b-round.h:66
#define G1(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h, b0, b1)
Definition: blake2b-round.h:47

Definition at line 161 of file blake2b-round.h.

#define DIAGONALIZE (   row1l,
  row2l,
  row3l,
  row4l,
  row1h,
  row2h,
  row3h,
  row4h 
)
Value:
t0 = row4l;\
t1 = row2l;\
row4l = row3l;\
row3l = row3h;\
row3h = row4l;\
row4l = _mm_unpackhi_epi64(row4h, _mm_unpacklo_epi64(t0, t0)); \
row4h = _mm_unpackhi_epi64(t0, _mm_unpacklo_epi64(row4h, row4h)); \
row2l = _mm_unpackhi_epi64(row2l, _mm_unpacklo_epi64(row2h, row2h)); \
row2h = _mm_unpackhi_epi64(row2h, _mm_unpacklo_epi64(t1, t1))
#define t1

Definition at line 117 of file blake2b-round.h.

#define G1 (   row1l,
  row2l,
  row3l,
  row4l,
  row1h,
  row2h,
  row3h,
  row4h,
  b0,
  b1 
)
Value:
row1l = _mm_add_epi64(_mm_add_epi64(row1l, b0), row2l); \
row1h = _mm_add_epi64(_mm_add_epi64(row1h, b1), row2h); \
\
row4l = _mm_xor_si128(row4l, row1l); \
row4h = _mm_xor_si128(row4h, row1h); \
\
row4l = _mm_roti_epi64(row4l, (-32)); \
row4h = _mm_roti_epi64(row4h, (-32)); \
\
row3l = _mm_add_epi64(row3l, row4l); \
row3h = _mm_add_epi64(row3h, row4h); \
\
row2l = _mm_xor_si128(row2l, row3l); \
row2h = _mm_xor_si128(row2h, row3h); \
\
row2l = _mm_roti_epi64(row2l, (-24)); \
row2h = _mm_roti_epi64(row2h, (-24)); \
#define _mm_roti_epi64(r, c)
Definition: blake2b-round.h:39

Definition at line 47 of file blake2b-round.h.

#define G2 (   row1l,
  row2l,
  row3l,
  row4l,
  row1h,
  row2h,
  row3h,
  row4h,
  b0,
  b1 
)
Value:
row1l = _mm_add_epi64(_mm_add_epi64(row1l, b0), row2l); \
row1h = _mm_add_epi64(_mm_add_epi64(row1h, b1), row2h); \
\
row4l = _mm_xor_si128(row4l, row1l); \
row4h = _mm_xor_si128(row4h, row1h); \
\
row4l = _mm_roti_epi64(row4l, (-16)); \
row4h = _mm_roti_epi64(row4h, (-16)); \
\
row3l = _mm_add_epi64(row3l, row4l); \
row3h = _mm_add_epi64(row3h, row4h); \
\
row2l = _mm_xor_si128(row2l, row3l); \
row2h = _mm_xor_si128(row2h, row3h); \
\
row2l = _mm_roti_epi64(row2l, (-63)); \
row2h = _mm_roti_epi64(row2h, (-63)); \
#define _mm_roti_epi64(r, c)
Definition: blake2b-round.h:39

Definition at line 66 of file blake2b-round.h.

#define LIKELY (   x)    __builtin_expect((x),1)

Definition at line 26 of file blake2b-round.h.

#define LOAD (   p)    _mm_load_si128( (const __m128i *)(p) )

Definition at line 17 of file blake2b-round.h.

#define LOADU (   p)    _mm_loadu_si128( (const __m128i *)(p) )

Definition at line 20 of file blake2b-round.h.

#define ROUND (   r)
Value:
LOAD_MSG_ ##r ##_1(b0, b1); \
G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \
LOAD_MSG_ ##r ##_2(b0, b1); \
G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \
DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); \
LOAD_MSG_ ##r ##_3(b0, b1); \
G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \
LOAD_MSG_ ##r ##_4(b0, b1); \
G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \
UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h);
#define UNDIAGONALIZE(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h)
#define DIAGONALIZE(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h)
#define G2(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h, b0, b1)
Definition: blake2b-round.h:66
#define G1(row1l, row2l, row3l, row4l, row1h, row2h, row3h, row4h, b0, b1)
Definition: blake2b-round.h:47

Definition at line 147 of file blake2b-round.h.

#define STORE (   p,
 
)    _mm_store_si128((__m128i *)(p), r)

Definition at line 18 of file blake2b-round.h.

#define STOREU (   p,
 
)    _mm_storeu_si128((__m128i *)(p), r)

Definition at line 21 of file blake2b-round.h.

#define TOF (   reg)    _mm_castsi128_ps((reg))

Definition at line 23 of file blake2b-round.h.

#define TOI (   reg)    _mm_castps_si128((reg))

Definition at line 24 of file blake2b-round.h.

#define UNDIAGONALIZE (   row1l,
  row2l,
  row3l,
  row4l,
  row1h,
  row2h,
  row3h,
  row4h 
)
Value:
t0 = row3l;\
row3l = row3h;\
row3h = t0;\
t0 = row2l;\
t1 = row4l;\
row2l = _mm_unpackhi_epi64(row2h, _mm_unpacklo_epi64(row2l, row2l)); \
row2h = _mm_unpackhi_epi64(t0, _mm_unpacklo_epi64(row2h, row2h)); \
row4l = _mm_unpackhi_epi64(row4l, _mm_unpacklo_epi64(row4h, row4h)); \
row4h = _mm_unpackhi_epi64(row4h, _mm_unpacklo_epi64(t1, t1))
#define t1

Definition at line 128 of file blake2b-round.h.