Raven Core  3.0.0
P2P Digital Currency
Macros | Typedefs | Functions
simd.c File Reference
#include <stddef.h>
#include <string.h>
#include <limits.h>
#include "sph_simd.h"
Include dependency graph for simd.c:

Go to the source code of this file.

Macros

#define C32   SPH_C32
 
#define T32   SPH_T32
 
#define ROL32   SPH_ROTL32
 
#define XCAT(x, y)   XCAT_(x, y)
 
#define XCAT_(x, y)   x ## y
 
#define REDS1(x)   (((x) & 0xFF) - ((x) >> 8))
 
#define REDS2(x)   (((x) & 0xFFFF) + ((x) >> 16))
 
#define FFT_LOOP(rb, hk, as, id)
 
#define FFT8(xb, xs, d)
 
#define FFT16(xb, xs, rb)
 
#define FFT32(xb, xs, rb, id)
 
#define FFT64(xb, xs, rb, id)
 
#define FFT128(xb, xs, rb, id)
 
#define FFT256(xb, xs, rb, id)
 
#define INNER(l, h, mm)
 
#define W_SMALL(sb, o1, o2, mm)
 
#define WS_0_0   W_SMALL( 4, 0, 1, 185)
 
#define WS_0_1   W_SMALL( 6, 0, 1, 185)
 
#define WS_0_2   W_SMALL( 0, 0, 1, 185)
 
#define WS_0_3   W_SMALL( 2, 0, 1, 185)
 
#define WS_0_4   W_SMALL( 7, 0, 1, 185)
 
#define WS_0_5   W_SMALL( 5, 0, 1, 185)
 
#define WS_0_6   W_SMALL( 3, 0, 1, 185)
 
#define WS_0_7   W_SMALL( 1, 0, 1, 185)
 
#define WS_1_0   W_SMALL(15, 0, 1, 185)
 
#define WS_1_1   W_SMALL(11, 0, 1, 185)
 
#define WS_1_2   W_SMALL(12, 0, 1, 185)
 
#define WS_1_3   W_SMALL( 8, 0, 1, 185)
 
#define WS_1_4   W_SMALL( 9, 0, 1, 185)
 
#define WS_1_5   W_SMALL(13, 0, 1, 185)
 
#define WS_1_6   W_SMALL(10, 0, 1, 185)
 
#define WS_1_7   W_SMALL(14, 0, 1, 185)
 
#define WS_2_0   W_SMALL(17, -128, -64, 233)
 
#define WS_2_1   W_SMALL(18, -128, -64, 233)
 
#define WS_2_2   W_SMALL(23, -128, -64, 233)
 
#define WS_2_3   W_SMALL(20, -128, -64, 233)
 
#define WS_2_4   W_SMALL(22, -128, -64, 233)
 
#define WS_2_5   W_SMALL(21, -128, -64, 233)
 
#define WS_2_6   W_SMALL(16, -128, -64, 233)
 
#define WS_2_7   W_SMALL(19, -128, -64, 233)
 
#define WS_3_0   W_SMALL(30, -191, -127, 233)
 
#define WS_3_1   W_SMALL(24, -191, -127, 233)
 
#define WS_3_2   W_SMALL(25, -191, -127, 233)
 
#define WS_3_3   W_SMALL(31, -191, -127, 233)
 
#define WS_3_4   W_SMALL(27, -191, -127, 233)
 
#define WS_3_5   W_SMALL(29, -191, -127, 233)
 
#define WS_3_6   W_SMALL(28, -191, -127, 233)
 
#define WS_3_7   W_SMALL(26, -191, -127, 233)
 
#define W_BIG(sb, o1, o2, mm)
 
#define WB_0_0   W_BIG( 4, 0, 1, 185)
 
#define WB_0_1   W_BIG( 6, 0, 1, 185)
 
#define WB_0_2   W_BIG( 0, 0, 1, 185)
 
#define WB_0_3   W_BIG( 2, 0, 1, 185)
 
#define WB_0_4   W_BIG( 7, 0, 1, 185)
 
#define WB_0_5   W_BIG( 5, 0, 1, 185)
 
#define WB_0_6   W_BIG( 3, 0, 1, 185)
 
#define WB_0_7   W_BIG( 1, 0, 1, 185)
 
#define WB_1_0   W_BIG(15, 0, 1, 185)
 
#define WB_1_1   W_BIG(11, 0, 1, 185)
 
#define WB_1_2   W_BIG(12, 0, 1, 185)
 
#define WB_1_3   W_BIG( 8, 0, 1, 185)
 
#define WB_1_4   W_BIG( 9, 0, 1, 185)
 
#define WB_1_5   W_BIG(13, 0, 1, 185)
 
#define WB_1_6   W_BIG(10, 0, 1, 185)
 
#define WB_1_7   W_BIG(14, 0, 1, 185)
 
#define WB_2_0   W_BIG(17, -256, -128, 233)
 
#define WB_2_1   W_BIG(18, -256, -128, 233)
 
#define WB_2_2   W_BIG(23, -256, -128, 233)
 
#define WB_2_3   W_BIG(20, -256, -128, 233)
 
#define WB_2_4   W_BIG(22, -256, -128, 233)
 
#define WB_2_5   W_BIG(21, -256, -128, 233)
 
#define WB_2_6   W_BIG(16, -256, -128, 233)
 
#define WB_2_7   W_BIG(19, -256, -128, 233)
 
#define WB_3_0   W_BIG(30, -383, -255, 233)
 
#define WB_3_1   W_BIG(24, -383, -255, 233)
 
#define WB_3_2   W_BIG(25, -383, -255, 233)
 
#define WB_3_3   W_BIG(31, -383, -255, 233)
 
#define WB_3_4   W_BIG(27, -383, -255, 233)
 
#define WB_3_5   W_BIG(29, -383, -255, 233)
 
#define WB_3_6   W_BIG(28, -383, -255, 233)
 
#define WB_3_7   W_BIG(26, -383, -255, 233)
 
#define IF(x, y, z)   ((((y) ^ (z)) & (x)) ^ (z))
 
#define MAJ(x, y, z)   (((x) & (y)) | (((x) | (y)) & (z)))
 
#define PP4_0_0   1
 
#define PP4_0_1   0
 
#define PP4_0_2   3
 
#define PP4_0_3   2
 
#define PP4_1_0   2
 
#define PP4_1_1   3
 
#define PP4_1_2   0
 
#define PP4_1_3   1
 
#define PP4_2_0   3
 
#define PP4_2_1   2
 
#define PP4_2_2   1
 
#define PP4_2_3   0
 
#define PP8_0_0   1
 
#define PP8_0_1   0
 
#define PP8_0_2   3
 
#define PP8_0_3   2
 
#define PP8_0_4   5
 
#define PP8_0_5   4
 
#define PP8_0_6   7
 
#define PP8_0_7   6
 
#define PP8_1_0   6
 
#define PP8_1_1   7
 
#define PP8_1_2   4
 
#define PP8_1_3   5
 
#define PP8_1_4   2
 
#define PP8_1_5   3
 
#define PP8_1_6   0
 
#define PP8_1_7   1
 
#define PP8_2_0   2
 
#define PP8_2_1   3
 
#define PP8_2_2   0
 
#define PP8_2_3   1
 
#define PP8_2_4   6
 
#define PP8_2_5   7
 
#define PP8_2_6   4
 
#define PP8_2_7   5
 
#define PP8_3_0   3
 
#define PP8_3_1   2
 
#define PP8_3_2   1
 
#define PP8_3_3   0
 
#define PP8_3_4   7
 
#define PP8_3_5   6
 
#define PP8_3_6   5
 
#define PP8_3_7   4
 
#define PP8_4_0   5
 
#define PP8_4_1   4
 
#define PP8_4_2   7
 
#define PP8_4_3   6
 
#define PP8_4_4   1
 
#define PP8_4_5   0
 
#define PP8_4_6   3
 
#define PP8_4_7   2
 
#define PP8_5_0   7
 
#define PP8_5_1   6
 
#define PP8_5_2   5
 
#define PP8_5_3   4
 
#define PP8_5_4   3
 
#define PP8_5_5   2
 
#define PP8_5_6   1
 
#define PP8_5_7   0
 
#define PP8_6_0   4
 
#define PP8_6_1   5
 
#define PP8_6_2   6
 
#define PP8_6_3   7
 
#define PP8_6_4   0
 
#define PP8_6_5   1
 
#define PP8_6_6   2
 
#define PP8_6_7   3
 
#define DECL_STATE_SMALL   u32 A0, A1, A2, A3, B0, B1, B2, B3, C0, C1, C2, C3, D0, D1, D2, D3;
 
#define READ_STATE_SMALL(sc)
 
#define WRITE_STATE_SMALL(sc)
 
#define DECL_STATE_BIG
 
#define READ_STATE_BIG(sc)
 
#define WRITE_STATE_BIG(sc)
 
#define STEP_ELT(n, w, fun, s, ppb)
 
#define STEP_SMALL(w0, w1, w2, w3, fun, r, s, pp4b)
 
#define STEP_BIG(w0, w1, w2, w3, w4, w5, w6, w7, fun, r, s, pp8b)
 
#define M3_0_0   0_
 
#define M3_1_0   1_
 
#define M3_2_0   2_
 
#define M3_3_0   0_
 
#define M3_4_0   1_
 
#define M3_5_0   2_
 
#define M3_6_0   0_
 
#define M3_7_0   1_
 
#define M3_0_1   1_
 
#define M3_1_1   2_
 
#define M3_2_1   0_
 
#define M3_3_1   1_
 
#define M3_4_1   2_
 
#define M3_5_1   0_
 
#define M3_6_1   1_
 
#define M3_7_1   2_
 
#define M3_0_2   2_
 
#define M3_1_2   0_
 
#define M3_2_2   1_
 
#define M3_3_2   2_
 
#define M3_4_2   0_
 
#define M3_5_2   1_
 
#define M3_6_2   2_
 
#define M3_7_2   0_
 
#define STEP_SMALL_(w, fun, r, s, pp4b)   STEP_SMALL w, fun, r, s, pp4b)
 
#define ONE_ROUND_SMALL(ri, isp, p0, p1, p2, p3)
 
#define M7_0_0   0_
 
#define M7_1_0   1_
 
#define M7_2_0   2_
 
#define M7_3_0   3_
 
#define M7_4_0   4_
 
#define M7_5_0   5_
 
#define M7_6_0   6_
 
#define M7_7_0   0_
 
#define M7_0_1   1_
 
#define M7_1_1   2_
 
#define M7_2_1   3_
 
#define M7_3_1   4_
 
#define M7_4_1   5_
 
#define M7_5_1   6_
 
#define M7_6_1   0_
 
#define M7_7_1   1_
 
#define M7_0_2   2_
 
#define M7_1_2   3_
 
#define M7_2_2   4_
 
#define M7_3_2   5_
 
#define M7_4_2   6_
 
#define M7_5_2   0_
 
#define M7_6_2   1_
 
#define M7_7_2   2_
 
#define M7_0_3   3_
 
#define M7_1_3   4_
 
#define M7_2_3   5_
 
#define M7_3_3   6_
 
#define M7_4_3   0_
 
#define M7_5_3   1_
 
#define M7_6_3   2_
 
#define M7_7_3   3_
 
#define STEP_BIG_(w, fun, r, s, pp8b)   STEP_BIG w, fun, r, s, pp8b)
 
#define ONE_ROUND_BIG(ri, isp, p0, p1, p2, p3)
 

Typedefs

typedef sph_u32 u32
 
typedef sph_s32 s32
 

Functions

void sph_simd224_init (void *cc)
 Initialize an SIMD-224 context. More...
 
void sph_simd224 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_simd224_close (void *cc, void *dst)
 Terminate the current SIMD-224 computation and output the result into the provided buffer. More...
 
void sph_simd224_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst)
 Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (28 bytes). More...
 
void sph_simd256_init (void *cc)
 Initialize an SIMD-256 context. More...
 
void sph_simd256 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_simd256_close (void *cc, void *dst)
 Terminate the current SIMD-256 computation and output the result into the provided buffer. More...
 
void sph_simd256_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst)
 Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (32 bytes). More...
 
void sph_simd384_init (void *cc)
 Initialize an SIMD-384 context. More...
 
void sph_simd384 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_simd384_close (void *cc, void *dst)
 Terminate the current SIMD-384 computation and output the result into the provided buffer. More...
 
void sph_simd384_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst)
 Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (48 bytes). More...
 
void sph_simd512_init (void *cc)
 Initialize an SIMD-512 context. More...
 
void sph_simd512 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_simd512_close (void *cc, void *dst)
 Terminate the current SIMD-512 computation and output the result into the provided buffer. More...
 
void sph_simd512_addbits_and_close (void *cc, unsigned ub, unsigned n, void *dst)
 Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (64 bytes). More...
 

Macro Definition Documentation

◆ C32

#define C32   SPH_C32

Definition at line 53 of file simd.c.

◆ DECL_STATE_BIG

#define DECL_STATE_BIG
Value:
u32 A0, A1, A2, A3, A4, A5, A6, A7; \
u32 B0, B1, B2, B3, B4, B5, B6, B7; \
u32 C0, C1, C2, C3, C4, C5, C6, C7; \
u32 D0, D1, D2, D3, D4, D5, D6, D7;
sph_u32 u32
Definition: simd.c:51

Definition at line 589 of file simd.c.

◆ DECL_STATE_SMALL

#define DECL_STATE_SMALL   u32 A0, A1, A2, A3, B0, B1, B2, B3, C0, C1, C2, C3, D0, D1, D2, D3;

Definition at line 548 of file simd.c.

◆ FFT128

#define FFT128 (   xb,
  xs,
  rb,
  id 
)
Value:
do { \
FFT64(xb, (xs) << 1, rb, XCAT(id, a)); \
FFT64((xb) + (xs), (xs) << 1, (rb) + 64, XCAT(id, b)); \
FFT_LOOP(rb, 64, 2, id); \
} while (0)
#define XCAT(x, y)
Definition: simd.c:57

Definition at line 245 of file simd.c.

◆ FFT16

#define FFT16 (   xb,
  xs,
  rb 
)
Value:
do { \
s32 d1_0, d1_1, d1_2, d1_3, d1_4, d1_5, d1_6, d1_7; \
s32 d2_0, d2_1, d2_2, d2_3, d2_4, d2_5, d2_6, d2_7; \
FFT8(xb, (xs) << 1, d1_); \
FFT8((xb) + (xs), (xs) << 1, d2_); \
q[(rb) + 0] = d1_0 + d2_0; \
q[(rb) + 1] = d1_1 + (d2_1 << 1); \
q[(rb) + 2] = d1_2 + (d2_2 << 2); \
q[(rb) + 3] = d1_3 + (d2_3 << 3); \
q[(rb) + 4] = d1_4 + (d2_4 << 4); \
q[(rb) + 5] = d1_5 + (d2_5 << 5); \
q[(rb) + 6] = d1_6 + (d2_6 << 6); \
q[(rb) + 7] = d1_7 + (d2_7 << 7); \
q[(rb) + 8] = d1_0 - d2_0; \
q[(rb) + 9] = d1_1 - (d2_1 << 1); \
q[(rb) + 10] = d1_2 - (d2_2 << 2); \
q[(rb) + 11] = d1_3 - (d2_3 << 3); \
q[(rb) + 12] = d1_4 - (d2_4 << 4); \
q[(rb) + 13] = d1_5 - (d2_5 << 5); \
q[(rb) + 14] = d1_6 - (d2_6 << 6); \
q[(rb) + 15] = d1_7 - (d2_7 << 7); \
} while (0)

Definition at line 176 of file simd.c.

◆ FFT256

#define FFT256 (   xb,
  xs,
  rb,
  id 
)
Value:
do { \
fft64(x + (xb) + ((xs) * 0), (xs) << 2, &q[(rb) + 0]); \
fft64(x + (xb) + ((xs) * 2), (xs) << 2, &q[(rb) + 64]); \
FFT_LOOP(rb, 64, 2, XCAT(id, aa)); \
fft64(x + (xb) + ((xs) * 1), (xs) << 2, &q[(rb) + 128]); \
fft64(x + (xb) + ((xs) * 3), (xs) << 2, &q[(rb) + 192]); \
FFT_LOOP((rb) + 128, 64, 2, XCAT(id, ab)); \
FFT_LOOP(rb, 128, 1, XCAT(id, a)); \
} while (0)
#define XCAT(x, y)
Definition: simd.c:57

Definition at line 273 of file simd.c.

◆ FFT32

#define FFT32 (   xb,
  xs,
  rb,
  id 
)
Value:
do { \
FFT16(xb, (xs) << 1, rb); \
FFT16((xb) + (xs), (xs) << 1, (rb) + 16); \
FFT_LOOP(rb, 16, 8, id); \
} while (0)

Definition at line 202 of file simd.c.

◆ FFT64

#define FFT64 (   xb,
  xs,
  rb,
  id 
)
Value:
do { \
FFT32(xb, (xs) << 1, rb, XCAT(id, a)); \
FFT32((xb) + (xs), (xs) << 1, (rb) + 32, XCAT(id, b)); \
FFT_LOOP(rb, 32, 4, id); \
} while (0)
#define XCAT(x, y)
Definition: simd.c:57

Definition at line 211 of file simd.c.

◆ FFT8

#define FFT8 (   xb,
  xs,
 
)
Value:
do { \
s32 x0 = x[(xb)]; \
s32 x1 = x[(xb) + (xs)]; \
s32 x2 = x[(xb) + 2 * (xs)]; \
s32 x3 = x[(xb) + 3 * (xs)]; \
s32 a0 = x0 + x2; \
s32 a1 = x0 + (x2 << 4); \
s32 a2 = x0 - x2; \
s32 a3 = x0 - (x2 << 4); \
s32 b0 = x1 + x3; \
s32 b1 = REDS1((x1 << 2) + (x3 << 6)); \
s32 b2 = (x1 << 4) - (x3 << 4); \
s32 b3 = REDS1((x1 << 6) + (x3 << 2)); \
d ## 0 = a0 + b0; \
d ## 1 = a1 + b1; \
d ## 2 = a2 + b2; \
d ## 3 = a3 + b3; \
d ## 4 = a0 - b0; \
d ## 5 = a1 - b1; \
d ## 6 = a2 - b2; \
d ## 7 = a3 - b3; \
} while (0)
#define REDS1(x)
Definition: simd.c:93

Definition at line 147 of file simd.c.

◆ FFT_LOOP

#define FFT_LOOP (   rb,
  hk,
  as,
  id 
)

Definition at line 102 of file simd.c.

◆ IF

#define IF (   x,
  y,
 
)    ((((y) ^ (z)) & (x)) ^ (z))

Definition at line 458 of file simd.c.

◆ INNER

#define INNER (   l,
  h,
  mm 
)
Value:
(((u32)((l) * (mm)) & 0xFFFFU) \
+ ((u32)((h) * (mm)) << 16))
sph_u32 u32
Definition: simd.c:51

Definition at line 373 of file simd.c.

◆ M3_0_0

#define M3_0_0   0_

Definition at line 705 of file simd.c.

◆ M3_0_1

#define M3_0_1   1_

Definition at line 714 of file simd.c.

◆ M3_0_2

#define M3_0_2   2_

Definition at line 723 of file simd.c.

◆ M3_1_0

#define M3_1_0   1_

Definition at line 706 of file simd.c.

◆ M3_1_1

#define M3_1_1   2_

Definition at line 715 of file simd.c.

◆ M3_1_2

#define M3_1_2   0_

Definition at line 724 of file simd.c.

◆ M3_2_0

#define M3_2_0   2_

Definition at line 707 of file simd.c.

◆ M3_2_1

#define M3_2_1   0_

Definition at line 716 of file simd.c.

◆ M3_2_2

#define M3_2_2   1_

Definition at line 725 of file simd.c.

◆ M3_3_0

#define M3_3_0   0_

Definition at line 708 of file simd.c.

◆ M3_3_1

#define M3_3_1   1_

Definition at line 717 of file simd.c.

◆ M3_3_2

#define M3_3_2   2_

Definition at line 726 of file simd.c.

◆ M3_4_0

#define M3_4_0   1_

Definition at line 709 of file simd.c.

◆ M3_4_1

#define M3_4_1   2_

Definition at line 718 of file simd.c.

◆ M3_4_2

#define M3_4_2   0_

Definition at line 727 of file simd.c.

◆ M3_5_0

#define M3_5_0   2_

Definition at line 710 of file simd.c.

◆ M3_5_1

#define M3_5_1   0_

Definition at line 719 of file simd.c.

◆ M3_5_2

#define M3_5_2   1_

Definition at line 728 of file simd.c.

◆ M3_6_0

#define M3_6_0   0_

Definition at line 711 of file simd.c.

◆ M3_6_1

#define M3_6_1   1_

Definition at line 720 of file simd.c.

◆ M3_6_2

#define M3_6_2   2_

Definition at line 729 of file simd.c.

◆ M3_7_0

#define M3_7_0   1_

Definition at line 712 of file simd.c.

◆ M3_7_1

#define M3_7_1   2_

Definition at line 721 of file simd.c.

◆ M3_7_2

#define M3_7_2   0_

Definition at line 730 of file simd.c.

◆ M7_0_0

#define M7_0_0   0_

Definition at line 753 of file simd.c.

◆ M7_0_1

#define M7_0_1   1_

Definition at line 762 of file simd.c.

◆ M7_0_2

#define M7_0_2   2_

Definition at line 771 of file simd.c.

◆ M7_0_3

#define M7_0_3   3_

Definition at line 780 of file simd.c.

◆ M7_1_0

#define M7_1_0   1_

Definition at line 754 of file simd.c.

◆ M7_1_1

#define M7_1_1   2_

Definition at line 763 of file simd.c.

◆ M7_1_2

#define M7_1_2   3_

Definition at line 772 of file simd.c.

◆ M7_1_3

#define M7_1_3   4_

Definition at line 781 of file simd.c.

◆ M7_2_0

#define M7_2_0   2_

Definition at line 755 of file simd.c.

◆ M7_2_1

#define M7_2_1   3_

Definition at line 764 of file simd.c.

◆ M7_2_2

#define M7_2_2   4_

Definition at line 773 of file simd.c.

◆ M7_2_3

#define M7_2_3   5_

Definition at line 782 of file simd.c.

◆ M7_3_0

#define M7_3_0   3_

Definition at line 756 of file simd.c.

◆ M7_3_1

#define M7_3_1   4_

Definition at line 765 of file simd.c.

◆ M7_3_2

#define M7_3_2   5_

Definition at line 774 of file simd.c.

◆ M7_3_3

#define M7_3_3   6_

Definition at line 783 of file simd.c.

◆ M7_4_0

#define M7_4_0   4_

Definition at line 757 of file simd.c.

◆ M7_4_1

#define M7_4_1   5_

Definition at line 766 of file simd.c.

◆ M7_4_2

#define M7_4_2   6_

Definition at line 775 of file simd.c.

◆ M7_4_3

#define M7_4_3   0_

Definition at line 784 of file simd.c.

◆ M7_5_0

#define M7_5_0   5_

Definition at line 758 of file simd.c.

◆ M7_5_1

#define M7_5_1   6_

Definition at line 767 of file simd.c.

◆ M7_5_2

#define M7_5_2   0_

Definition at line 776 of file simd.c.

◆ M7_5_3

#define M7_5_3   1_

Definition at line 785 of file simd.c.

◆ M7_6_0

#define M7_6_0   6_

Definition at line 759 of file simd.c.

◆ M7_6_1

#define M7_6_1   0_

Definition at line 768 of file simd.c.

◆ M7_6_2

#define M7_6_2   1_

Definition at line 777 of file simd.c.

◆ M7_6_3

#define M7_6_3   2_

Definition at line 786 of file simd.c.

◆ M7_7_0

#define M7_7_0   0_

Definition at line 760 of file simd.c.

◆ M7_7_1

#define M7_7_1   1_

Definition at line 769 of file simd.c.

◆ M7_7_2

#define M7_7_2   2_

Definition at line 778 of file simd.c.

◆ M7_7_3

#define M7_7_3   3_

Definition at line 787 of file simd.c.

◆ MAJ

#define MAJ (   x,
  y,
 
)    (((x) & (y)) | (((x) | (y)) & (z)))

Definition at line 459 of file simd.c.

◆ ONE_ROUND_BIG

#define ONE_ROUND_BIG (   ri,
  isp,
  p0,
  p1,
  p2,
  p3 
)
Value:
do { \
STEP_BIG_(WB_ ## ri ## 0, \
IF, p0, p1, XCAT(PP8_, M7_0_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 1, \
IF, p1, p2, XCAT(PP8_, M7_1_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 2, \
IF, p2, p3, XCAT(PP8_, M7_2_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 3, \
IF, p3, p0, XCAT(PP8_, M7_3_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 4, \
MAJ, p0, p1, XCAT(PP8_, M7_4_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 5, \
MAJ, p1, p2, XCAT(PP8_, M7_5_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 6, \
MAJ, p2, p3, XCAT(PP8_, M7_6_ ## isp)); \
STEP_BIG_(WB_ ## ri ## 7, \
MAJ, p3, p0, XCAT(PP8_, M7_7_ ## isp)); \
} while (0)
#define IF(x, y, z)
Definition: simd.c:458
#define XCAT(x, y)
Definition: simd.c:57
#define MAJ(x, y, z)
Definition: simd.c:459

Definition at line 791 of file simd.c.

◆ ONE_ROUND_SMALL

#define ONE_ROUND_SMALL (   ri,
  isp,
  p0,
  p1,
  p2,
  p3 
)
Value:
do { \
STEP_SMALL_(WS_ ## ri ## 0, \
IF, p0, p1, XCAT(PP4_, M3_0_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 1, \
IF, p1, p2, XCAT(PP4_, M3_1_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 2, \
IF, p2, p3, XCAT(PP4_, M3_2_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 3, \
IF, p3, p0, XCAT(PP4_, M3_3_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 4, \
MAJ, p0, p1, XCAT(PP4_, M3_4_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 5, \
MAJ, p1, p2, XCAT(PP4_, M3_5_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 6, \
MAJ, p2, p3, XCAT(PP4_, M3_6_ ## isp)); \
STEP_SMALL_(WS_ ## ri ## 7, \
MAJ, p3, p0, XCAT(PP4_, M3_7_ ## isp)); \
} while (0)
#define IF(x, y, z)
Definition: simd.c:458
#define XCAT(x, y)
Definition: simd.c:57
#define MAJ(x, y, z)
Definition: simd.c:459

Definition at line 734 of file simd.c.

◆ PP4_0_0

#define PP4_0_0   1

Definition at line 461 of file simd.c.

◆ PP4_0_1

#define PP4_0_1   0

Definition at line 462 of file simd.c.

◆ PP4_0_2

#define PP4_0_2   3

Definition at line 463 of file simd.c.

◆ PP4_0_3

#define PP4_0_3   2

Definition at line 464 of file simd.c.

◆ PP4_1_0

#define PP4_1_0   2

Definition at line 465 of file simd.c.

◆ PP4_1_1

#define PP4_1_1   3

Definition at line 466 of file simd.c.

◆ PP4_1_2

#define PP4_1_2   0

Definition at line 467 of file simd.c.

◆ PP4_1_3

#define PP4_1_3   1

Definition at line 468 of file simd.c.

◆ PP4_2_0

#define PP4_2_0   3

Definition at line 469 of file simd.c.

◆ PP4_2_1

#define PP4_2_1   2

Definition at line 470 of file simd.c.

◆ PP4_2_2

#define PP4_2_2   1

Definition at line 471 of file simd.c.

◆ PP4_2_3

#define PP4_2_3   0

Definition at line 472 of file simd.c.

◆ PP8_0_0

#define PP8_0_0   1

Definition at line 474 of file simd.c.

◆ PP8_0_1

#define PP8_0_1   0

Definition at line 475 of file simd.c.

◆ PP8_0_2

#define PP8_0_2   3

Definition at line 476 of file simd.c.

◆ PP8_0_3

#define PP8_0_3   2

Definition at line 477 of file simd.c.

◆ PP8_0_4

#define PP8_0_4   5

Definition at line 478 of file simd.c.

◆ PP8_0_5

#define PP8_0_5   4

Definition at line 479 of file simd.c.

◆ PP8_0_6

#define PP8_0_6   7

Definition at line 480 of file simd.c.

◆ PP8_0_7

#define PP8_0_7   6

Definition at line 481 of file simd.c.

◆ PP8_1_0

#define PP8_1_0   6

Definition at line 483 of file simd.c.

◆ PP8_1_1

#define PP8_1_1   7

Definition at line 484 of file simd.c.

◆ PP8_1_2

#define PP8_1_2   4

Definition at line 485 of file simd.c.

◆ PP8_1_3

#define PP8_1_3   5

Definition at line 486 of file simd.c.

◆ PP8_1_4

#define PP8_1_4   2

Definition at line 487 of file simd.c.

◆ PP8_1_5

#define PP8_1_5   3

Definition at line 488 of file simd.c.

◆ PP8_1_6

#define PP8_1_6   0

Definition at line 489 of file simd.c.

◆ PP8_1_7

#define PP8_1_7   1

Definition at line 490 of file simd.c.

◆ PP8_2_0

#define PP8_2_0   2

Definition at line 492 of file simd.c.

◆ PP8_2_1

#define PP8_2_1   3

Definition at line 493 of file simd.c.

◆ PP8_2_2

#define PP8_2_2   0

Definition at line 494 of file simd.c.

◆ PP8_2_3

#define PP8_2_3   1

Definition at line 495 of file simd.c.

◆ PP8_2_4

#define PP8_2_4   6

Definition at line 496 of file simd.c.

◆ PP8_2_5

#define PP8_2_5   7

Definition at line 497 of file simd.c.

◆ PP8_2_6

#define PP8_2_6   4

Definition at line 498 of file simd.c.

◆ PP8_2_7

#define PP8_2_7   5

Definition at line 499 of file simd.c.

◆ PP8_3_0

#define PP8_3_0   3

Definition at line 501 of file simd.c.

◆ PP8_3_1

#define PP8_3_1   2

Definition at line 502 of file simd.c.

◆ PP8_3_2

#define PP8_3_2   1

Definition at line 503 of file simd.c.

◆ PP8_3_3

#define PP8_3_3   0

Definition at line 504 of file simd.c.

◆ PP8_3_4

#define PP8_3_4   7

Definition at line 505 of file simd.c.

◆ PP8_3_5

#define PP8_3_5   6

Definition at line 506 of file simd.c.

◆ PP8_3_6

#define PP8_3_6   5

Definition at line 507 of file simd.c.

◆ PP8_3_7

#define PP8_3_7   4

Definition at line 508 of file simd.c.

◆ PP8_4_0

#define PP8_4_0   5

Definition at line 510 of file simd.c.

◆ PP8_4_1

#define PP8_4_1   4

Definition at line 511 of file simd.c.

◆ PP8_4_2

#define PP8_4_2   7

Definition at line 512 of file simd.c.

◆ PP8_4_3

#define PP8_4_3   6

Definition at line 513 of file simd.c.

◆ PP8_4_4

#define PP8_4_4   1

Definition at line 514 of file simd.c.

◆ PP8_4_5

#define PP8_4_5   0

Definition at line 515 of file simd.c.

◆ PP8_4_6

#define PP8_4_6   3

Definition at line 516 of file simd.c.

◆ PP8_4_7

#define PP8_4_7   2

Definition at line 517 of file simd.c.

◆ PP8_5_0

#define PP8_5_0   7

Definition at line 519 of file simd.c.

◆ PP8_5_1

#define PP8_5_1   6

Definition at line 520 of file simd.c.

◆ PP8_5_2

#define PP8_5_2   5

Definition at line 521 of file simd.c.

◆ PP8_5_3

#define PP8_5_3   4

Definition at line 522 of file simd.c.

◆ PP8_5_4

#define PP8_5_4   3

Definition at line 523 of file simd.c.

◆ PP8_5_5

#define PP8_5_5   2

Definition at line 524 of file simd.c.

◆ PP8_5_6

#define PP8_5_6   1

Definition at line 525 of file simd.c.

◆ PP8_5_7

#define PP8_5_7   0

Definition at line 526 of file simd.c.

◆ PP8_6_0

#define PP8_6_0   4

Definition at line 528 of file simd.c.

◆ PP8_6_1

#define PP8_6_1   5

Definition at line 529 of file simd.c.

◆ PP8_6_2

#define PP8_6_2   6

Definition at line 530 of file simd.c.

◆ PP8_6_3

#define PP8_6_3   7

Definition at line 531 of file simd.c.

◆ PP8_6_4

#define PP8_6_4   0

Definition at line 532 of file simd.c.

◆ PP8_6_5

#define PP8_6_5   1

Definition at line 533 of file simd.c.

◆ PP8_6_6

#define PP8_6_6   2

Definition at line 534 of file simd.c.

◆ PP8_6_7

#define PP8_6_7   3

Definition at line 535 of file simd.c.

◆ READ_STATE_BIG

#define READ_STATE_BIG (   sc)

Definition at line 595 of file simd.c.

◆ READ_STATE_SMALL

#define READ_STATE_SMALL (   sc)
Value:
do { \
A0 = (sc)->state[ 0]; \
A1 = (sc)->state[ 1]; \
A2 = (sc)->state[ 2]; \
A3 = (sc)->state[ 3]; \
B0 = (sc)->state[ 4]; \
B1 = (sc)->state[ 5]; \
B2 = (sc)->state[ 6]; \
B3 = (sc)->state[ 7]; \
C0 = (sc)->state[ 8]; \
C1 = (sc)->state[ 9]; \
C2 = (sc)->state[10]; \
C3 = (sc)->state[11]; \
D0 = (sc)->state[12]; \
D1 = (sc)->state[13]; \
D2 = (sc)->state[14]; \
D3 = (sc)->state[15]; \
} while (0)

Definition at line 551 of file simd.c.

◆ REDS1

#define REDS1 (   x)    (((x) & 0xFF) - ((x) >> 8))

Definition at line 93 of file simd.c.

◆ REDS2

#define REDS2 (   x)    (((x) & 0xFFFF) + ((x) >> 16))

Definition at line 94 of file simd.c.

◆ ROL32

#define ROL32   SPH_ROTL32

Definition at line 55 of file simd.c.

◆ STEP_BIG

#define STEP_BIG (   w0,
  w1,
  w2,
  w3,
  w4,
  w5,
  w6,
  w7,
  fun,
  r,
  s,
  pp8b 
)
Value:
do { \
u32 tA0 = ROL32(A0, r); \
u32 tA1 = ROL32(A1, r); \
u32 tA2 = ROL32(A2, r); \
u32 tA3 = ROL32(A3, r); \
u32 tA4 = ROL32(A4, r); \
u32 tA5 = ROL32(A5, r); \
u32 tA6 = ROL32(A6, r); \
u32 tA7 = ROL32(A7, r); \
STEP_ELT(0, w0, fun, s, pp8b); \
STEP_ELT(1, w1, fun, s, pp8b); \
STEP_ELT(2, w2, fun, s, pp8b); \
STEP_ELT(3, w3, fun, s, pp8b); \
STEP_ELT(4, w4, fun, s, pp8b); \
STEP_ELT(5, w5, fun, s, pp8b); \
STEP_ELT(6, w6, fun, s, pp8b); \
STEP_ELT(7, w7, fun, s, pp8b); \
} while (0)
#define ROL32
Definition: simd.c:55

Definition at line 686 of file simd.c.

◆ STEP_BIG_

#define STEP_BIG_ (   w,
  fun,
  r,
  s,
  pp8b 
)    STEP_BIG w, fun, r, s, pp8b)

Definition at line 789 of file simd.c.

◆ STEP_ELT

#define STEP_ELT (   n,
  w,
  fun,
  s,
  ppb 
)
Value:
do { \
u32 tt = T32(D ## n + (w) + fun(A ## n, B ## n, C ## n)); \
A ## n = T32(ROL32(tt, s) + XCAT(tA, XCAT(ppb, n))); \
D ## n = C ## n; \
C ## n = B ## n; \
B ## n = tA ## n; \
} while (0)
#define XCAT(x, y)
Definition: simd.c:57
#define T32
Definition: simd.c:54
#define ROL32
Definition: simd.c:55

Definition at line 667 of file simd.c.

◆ STEP_SMALL

#define STEP_SMALL (   w0,
  w1,
  w2,
  w3,
  fun,
  r,
  s,
  pp4b 
)
Value:
do { \
u32 tA0 = ROL32(A0, r); \
u32 tA1 = ROL32(A1, r); \
u32 tA2 = ROL32(A2, r); \
u32 tA3 = ROL32(A3, r); \
STEP_ELT(0, w0, fun, s, pp4b); \
STEP_ELT(1, w1, fun, s, pp4b); \
STEP_ELT(2, w2, fun, s, pp4b); \
STEP_ELT(3, w3, fun, s, pp4b); \
} while (0)
#define ROL32
Definition: simd.c:55

Definition at line 675 of file simd.c.

◆ STEP_SMALL_

#define STEP_SMALL_ (   w,
  fun,
  r,
  s,
  pp4b 
)    STEP_SMALL w, fun, r, s, pp4b)

Definition at line 732 of file simd.c.

◆ T32

#define T32   SPH_T32

Definition at line 54 of file simd.c.

◆ W_BIG

#define W_BIG (   sb,
  o1,
  o2,
  mm 
)
Value:
(INNER(q[16 * (sb) + 2 * 0 + o1], q[16 * (sb) + 2 * 0 + o2], mm), \
INNER(q[16 * (sb) + 2 * 1 + o1], q[16 * (sb) + 2 * 1 + o2], mm), \
INNER(q[16 * (sb) + 2 * 2 + o1], q[16 * (sb) + 2 * 2 + o2], mm), \
INNER(q[16 * (sb) + 2 * 3 + o1], q[16 * (sb) + 2 * 3 + o2], mm), \
INNER(q[16 * (sb) + 2 * 4 + o1], q[16 * (sb) + 2 * 4 + o2], mm), \
INNER(q[16 * (sb) + 2 * 5 + o1], q[16 * (sb) + 2 * 5 + o2], mm), \
INNER(q[16 * (sb) + 2 * 6 + o1], q[16 * (sb) + 2 * 6 + o2], mm), \
INNER(q[16 * (sb) + 2 * 7 + o1], q[16 * (sb) + 2 * 7 + o2], mm)
#define INNER(l, h, mm)
Definition: simd.c:373

Definition at line 415 of file simd.c.

◆ W_SMALL

#define W_SMALL (   sb,
  o1,
  o2,
  mm 
)
Value:
(INNER(q[8 * (sb) + 2 * 0 + o1], q[8 * (sb) + 2 * 0 + o2], mm), \
INNER(q[8 * (sb) + 2 * 1 + o1], q[8 * (sb) + 2 * 1 + o2], mm), \
INNER(q[8 * (sb) + 2 * 2 + o1], q[8 * (sb) + 2 * 2 + o2], mm), \
INNER(q[8 * (sb) + 2 * 3 + o1], q[8 * (sb) + 2 * 3 + o2], mm)
#define INNER(l, h, mm)
Definition: simd.c:373

Definition at line 376 of file simd.c.

◆ WB_0_0

#define WB_0_0   W_BIG( 4, 0, 1, 185)

Definition at line 425 of file simd.c.

◆ WB_0_1

#define WB_0_1   W_BIG( 6, 0, 1, 185)

Definition at line 426 of file simd.c.

◆ WB_0_2

#define WB_0_2   W_BIG( 0, 0, 1, 185)

Definition at line 427 of file simd.c.

◆ WB_0_3

#define WB_0_3   W_BIG( 2, 0, 1, 185)

Definition at line 428 of file simd.c.

◆ WB_0_4

#define WB_0_4   W_BIG( 7, 0, 1, 185)

Definition at line 429 of file simd.c.

◆ WB_0_5

#define WB_0_5   W_BIG( 5, 0, 1, 185)

Definition at line 430 of file simd.c.

◆ WB_0_6

#define WB_0_6   W_BIG( 3, 0, 1, 185)

Definition at line 431 of file simd.c.

◆ WB_0_7

#define WB_0_7   W_BIG( 1, 0, 1, 185)

Definition at line 432 of file simd.c.

◆ WB_1_0

#define WB_1_0   W_BIG(15, 0, 1, 185)

Definition at line 433 of file simd.c.

◆ WB_1_1

#define WB_1_1   W_BIG(11, 0, 1, 185)

Definition at line 434 of file simd.c.

◆ WB_1_2

#define WB_1_2   W_BIG(12, 0, 1, 185)

Definition at line 435 of file simd.c.

◆ WB_1_3

#define WB_1_3   W_BIG( 8, 0, 1, 185)

Definition at line 436 of file simd.c.

◆ WB_1_4

#define WB_1_4   W_BIG( 9, 0, 1, 185)

Definition at line 437 of file simd.c.

◆ WB_1_5

#define WB_1_5   W_BIG(13, 0, 1, 185)

Definition at line 438 of file simd.c.

◆ WB_1_6

#define WB_1_6   W_BIG(10, 0, 1, 185)

Definition at line 439 of file simd.c.

◆ WB_1_7

#define WB_1_7   W_BIG(14, 0, 1, 185)

Definition at line 440 of file simd.c.

◆ WB_2_0

#define WB_2_0   W_BIG(17, -256, -128, 233)

Definition at line 441 of file simd.c.

◆ WB_2_1

#define WB_2_1   W_BIG(18, -256, -128, 233)

Definition at line 442 of file simd.c.

◆ WB_2_2

#define WB_2_2   W_BIG(23, -256, -128, 233)

Definition at line 443 of file simd.c.

◆ WB_2_3

#define WB_2_3   W_BIG(20, -256, -128, 233)

Definition at line 444 of file simd.c.

◆ WB_2_4

#define WB_2_4   W_BIG(22, -256, -128, 233)

Definition at line 445 of file simd.c.

◆ WB_2_5

#define WB_2_5   W_BIG(21, -256, -128, 233)

Definition at line 446 of file simd.c.

◆ WB_2_6

#define WB_2_6   W_BIG(16, -256, -128, 233)

Definition at line 447 of file simd.c.

◆ WB_2_7

#define WB_2_7   W_BIG(19, -256, -128, 233)

Definition at line 448 of file simd.c.

◆ WB_3_0

#define WB_3_0   W_BIG(30, -383, -255, 233)

Definition at line 449 of file simd.c.

◆ WB_3_1

#define WB_3_1   W_BIG(24, -383, -255, 233)

Definition at line 450 of file simd.c.

◆ WB_3_2

#define WB_3_2   W_BIG(25, -383, -255, 233)

Definition at line 451 of file simd.c.

◆ WB_3_3

#define WB_3_3   W_BIG(31, -383, -255, 233)

Definition at line 452 of file simd.c.

◆ WB_3_4

#define WB_3_4   W_BIG(27, -383, -255, 233)

Definition at line 453 of file simd.c.

◆ WB_3_5

#define WB_3_5   W_BIG(29, -383, -255, 233)

Definition at line 454 of file simd.c.

◆ WB_3_6

#define WB_3_6   W_BIG(28, -383, -255, 233)

Definition at line 455 of file simd.c.

◆ WB_3_7

#define WB_3_7   W_BIG(26, -383, -255, 233)

Definition at line 456 of file simd.c.

◆ WRITE_STATE_BIG

#define WRITE_STATE_BIG (   sc)

Definition at line 630 of file simd.c.

◆ WRITE_STATE_SMALL

#define WRITE_STATE_SMALL (   sc)
Value:
do { \
(sc)->state[ 0] = A0; \
(sc)->state[ 1] = A1; \
(sc)->state[ 2] = A2; \
(sc)->state[ 3] = A3; \
(sc)->state[ 4] = B0; \
(sc)->state[ 5] = B1; \
(sc)->state[ 6] = B2; \
(sc)->state[ 7] = B3; \
(sc)->state[ 8] = C0; \
(sc)->state[ 9] = C1; \
(sc)->state[10] = C2; \
(sc)->state[11] = C3; \
(sc)->state[12] = D0; \
(sc)->state[13] = D1; \
(sc)->state[14] = D2; \
(sc)->state[15] = D3; \
} while (0)

Definition at line 570 of file simd.c.

◆ WS_0_0

#define WS_0_0   W_SMALL( 4, 0, 1, 185)

Definition at line 382 of file simd.c.

◆ WS_0_1

#define WS_0_1   W_SMALL( 6, 0, 1, 185)

Definition at line 383 of file simd.c.

◆ WS_0_2

#define WS_0_2   W_SMALL( 0, 0, 1, 185)

Definition at line 384 of file simd.c.

◆ WS_0_3

#define WS_0_3   W_SMALL( 2, 0, 1, 185)

Definition at line 385 of file simd.c.

◆ WS_0_4

#define WS_0_4   W_SMALL( 7, 0, 1, 185)

Definition at line 386 of file simd.c.

◆ WS_0_5

#define WS_0_5   W_SMALL( 5, 0, 1, 185)

Definition at line 387 of file simd.c.

◆ WS_0_6

#define WS_0_6   W_SMALL( 3, 0, 1, 185)

Definition at line 388 of file simd.c.

◆ WS_0_7

#define WS_0_7   W_SMALL( 1, 0, 1, 185)

Definition at line 389 of file simd.c.

◆ WS_1_0

#define WS_1_0   W_SMALL(15, 0, 1, 185)

Definition at line 390 of file simd.c.

◆ WS_1_1

#define WS_1_1   W_SMALL(11, 0, 1, 185)

Definition at line 391 of file simd.c.

◆ WS_1_2

#define WS_1_2   W_SMALL(12, 0, 1, 185)

Definition at line 392 of file simd.c.

◆ WS_1_3

#define WS_1_3   W_SMALL( 8, 0, 1, 185)

Definition at line 393 of file simd.c.

◆ WS_1_4

#define WS_1_4   W_SMALL( 9, 0, 1, 185)

Definition at line 394 of file simd.c.

◆ WS_1_5

#define WS_1_5   W_SMALL(13, 0, 1, 185)

Definition at line 395 of file simd.c.

◆ WS_1_6

#define WS_1_6   W_SMALL(10, 0, 1, 185)

Definition at line 396 of file simd.c.

◆ WS_1_7

#define WS_1_7   W_SMALL(14, 0, 1, 185)

Definition at line 397 of file simd.c.

◆ WS_2_0

#define WS_2_0   W_SMALL(17, -128, -64, 233)

Definition at line 398 of file simd.c.

◆ WS_2_1

#define WS_2_1   W_SMALL(18, -128, -64, 233)

Definition at line 399 of file simd.c.

◆ WS_2_2

#define WS_2_2   W_SMALL(23, -128, -64, 233)

Definition at line 400 of file simd.c.

◆ WS_2_3

#define WS_2_3   W_SMALL(20, -128, -64, 233)

Definition at line 401 of file simd.c.

◆ WS_2_4

#define WS_2_4   W_SMALL(22, -128, -64, 233)

Definition at line 402 of file simd.c.

◆ WS_2_5

#define WS_2_5   W_SMALL(21, -128, -64, 233)

Definition at line 403 of file simd.c.

◆ WS_2_6

#define WS_2_6   W_SMALL(16, -128, -64, 233)

Definition at line 404 of file simd.c.

◆ WS_2_7

#define WS_2_7   W_SMALL(19, -128, -64, 233)

Definition at line 405 of file simd.c.

◆ WS_3_0

#define WS_3_0   W_SMALL(30, -191, -127, 233)

Definition at line 406 of file simd.c.

◆ WS_3_1

#define WS_3_1   W_SMALL(24, -191, -127, 233)

Definition at line 407 of file simd.c.

◆ WS_3_2

#define WS_3_2   W_SMALL(25, -191, -127, 233)

Definition at line 408 of file simd.c.

◆ WS_3_3

#define WS_3_3   W_SMALL(31, -191, -127, 233)

Definition at line 409 of file simd.c.

◆ WS_3_4

#define WS_3_4   W_SMALL(27, -191, -127, 233)

Definition at line 410 of file simd.c.

◆ WS_3_5

#define WS_3_5   W_SMALL(29, -191, -127, 233)

Definition at line 411 of file simd.c.

◆ WS_3_6

#define WS_3_6   W_SMALL(28, -191, -127, 233)

Definition at line 412 of file simd.c.

◆ WS_3_7

#define WS_3_7   W_SMALL(26, -191, -127, 233)

Definition at line 413 of file simd.c.

◆ XCAT

#define XCAT (   x,
 
)    XCAT_(x, y)

Definition at line 57 of file simd.c.

◆ XCAT_

#define XCAT_ (   x,
 
)    x ## y

Definition at line 58 of file simd.c.

Typedef Documentation

◆ s32

typedef sph_s32 s32

Definition at line 52 of file simd.c.

◆ u32

typedef sph_u32 u32

Definition at line 51 of file simd.c.

Function Documentation

◆ sph_simd224()

void sph_simd224 ( void *  cc,
const void *  data,
size_t  len 
)

Process some data bytes.

It is acceptable that len is zero (in which case this function does nothing).

Parameters
ccthe SIMD-224 context
datathe input data
lenthe input data length (in bytes)

Definition at line 1705 of file simd.c.

◆ sph_simd224_addbits_and_close()

void sph_simd224_addbits_and_close ( void *  cc,
unsigned  ub,
unsigned  n,
void *  dst 
)

Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (28 bytes).

If bit number i in ub has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.

Parameters
ccthe SIMD-224 context
ubthe extra bits
nthe number of extra bits (0 to 7)
dstthe destination buffer

Definition at line 1717 of file simd.c.

Here is the caller graph for this function:

◆ sph_simd224_close()

void sph_simd224_close ( void *  cc,
void *  dst 
)

Terminate the current SIMD-224 computation and output the result into the provided buffer.

The destination buffer must be wide enough to accomodate the result (28 bytes). The context is automatically reinitialized.

Parameters
ccthe SIMD-224 context
dstthe destination buffer

Definition at line 1711 of file simd.c.

Here is the call graph for this function:

◆ sph_simd224_init()

void sph_simd224_init ( void *  cc)

Initialize an SIMD-224 context.

This process performs no memory allocation.

Parameters
ccthe SIMD-224 context (pointer to a sph_simd224_context)

Definition at line 1699 of file simd.c.

◆ sph_simd256()

void sph_simd256 ( void *  cc,
const void *  data,
size_t  len 
)

Process some data bytes.

It is acceptable that len is zero (in which case this function does nothing).

Parameters
ccthe SIMD-256 context
datathe input data
lenthe input data length (in bytes)

Definition at line 1730 of file simd.c.

◆ sph_simd256_addbits_and_close()

void sph_simd256_addbits_and_close ( void *  cc,
unsigned  ub,
unsigned  n,
void *  dst 
)

Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (32 bytes).

If bit number i in ub has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.

Parameters
ccthe SIMD-256 context
ubthe extra bits
nthe number of extra bits (0 to 7)
dstthe destination buffer

Definition at line 1742 of file simd.c.

Here is the caller graph for this function:

◆ sph_simd256_close()

void sph_simd256_close ( void *  cc,
void *  dst 
)

Terminate the current SIMD-256 computation and output the result into the provided buffer.

The destination buffer must be wide enough to accomodate the result (32 bytes). The context is automatically reinitialized.

Parameters
ccthe SIMD-256 context
dstthe destination buffer

Definition at line 1736 of file simd.c.

Here is the call graph for this function:

◆ sph_simd256_init()

void sph_simd256_init ( void *  cc)

Initialize an SIMD-256 context.

This process performs no memory allocation.

Parameters
ccthe SIMD-256 context (pointer to a sph_simd256_context)

Definition at line 1724 of file simd.c.

◆ sph_simd384()

void sph_simd384 ( void *  cc,
const void *  data,
size_t  len 
)

Process some data bytes.

It is acceptable that len is zero (in which case this function does nothing).

Parameters
ccthe SIMD-384 context
datathe input data
lenthe input data length (in bytes)

Definition at line 1755 of file simd.c.

◆ sph_simd384_addbits_and_close()

void sph_simd384_addbits_and_close ( void *  cc,
unsigned  ub,
unsigned  n,
void *  dst 
)

Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (48 bytes).

If bit number i in ub has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.

Parameters
ccthe SIMD-384 context
ubthe extra bits
nthe number of extra bits (0 to 7)
dstthe destination buffer

Definition at line 1767 of file simd.c.

Here is the caller graph for this function:

◆ sph_simd384_close()

void sph_simd384_close ( void *  cc,
void *  dst 
)

Terminate the current SIMD-384 computation and output the result into the provided buffer.

The destination buffer must be wide enough to accomodate the result (48 bytes). The context is automatically reinitialized.

Parameters
ccthe SIMD-384 context
dstthe destination buffer

Definition at line 1761 of file simd.c.

Here is the call graph for this function:

◆ sph_simd384_init()

void sph_simd384_init ( void *  cc)

Initialize an SIMD-384 context.

This process performs no memory allocation.

Parameters
ccthe SIMD-384 context (pointer to a sph_simd384_context)

Definition at line 1749 of file simd.c.

◆ sph_simd512()

void sph_simd512 ( void *  cc,
const void *  data,
size_t  len 
)

Process some data bytes.

It is acceptable that len is zero (in which case this function does nothing).

Parameters
ccthe SIMD-512 context
datathe input data
lenthe input data length (in bytes)

Definition at line 1780 of file simd.c.

Here is the caller graph for this function:

◆ sph_simd512_addbits_and_close()

void sph_simd512_addbits_and_close ( void *  cc,
unsigned  ub,
unsigned  n,
void *  dst 
)

Add a few additional bits (0 to 7) to the current computation, then terminate it and output the result in the provided buffer, which must be wide enough to accomodate the result (64 bytes).

If bit number i in ub has value 2^i, then the extra bits are those numbered 7 downto 8-n (this is the big-endian convention at the byte level). The context is automatically reinitialized.

Parameters
ccthe SIMD-512 context
ubthe extra bits
nthe number of extra bits (0 to 7)
dstthe destination buffer

Definition at line 1792 of file simd.c.

Here is the caller graph for this function:

◆ sph_simd512_close()

void sph_simd512_close ( void *  cc,
void *  dst 
)

Terminate the current SIMD-512 computation and output the result into the provided buffer.

The destination buffer must be wide enough to accomodate the result (64 bytes). The context is automatically reinitialized.

Parameters
ccthe SIMD-512 context
dstthe destination buffer

Definition at line 1786 of file simd.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sph_simd512_init()

void sph_simd512_init ( void *  cc)

Initialize an SIMD-512 context.

This process performs no memory allocation.

Parameters
ccthe SIMD-512 context (pointer to a sph_simd512_context)

Definition at line 1774 of file simd.c.

Here is the caller graph for this function: