Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

groestl.c File Reference
#include <stddef.h>
#include <string.h>
#include "sph_groestl.h"
+ Include dependency graph for groestl.c:

Go to the source code of this file.

Macros

#define SPH_GROESTL_64   1
 
#define C32e(x)   SPH_C32(x)
 
#define dec32e_aligned   sph_dec32be_aligned
 
#define enc32e   sph_enc32be
 
#define B32_0(x)   ((x) >> 24)
 
#define B32_1(x)   (((x) >> 16) & 0xFF)
 
#define B32_2(x)   (((x) >> 8) & 0xFF)
 
#define B32_3(x)   ((x) & 0xFF)
 
#define R32u(u, d)   SPH_T32(((u) >> 16) | ((d) << 16))
 
#define R32d(u, d)   SPH_T32(((u) << 16) | ((d) >> 16))
 
#define PC32up(j, r)   ((sph_u32)((j) + (r)) << 24)
 
#define PC32dn(j, r)   0
 
#define QC32up(j, r)   SPH_C32(0xFFFFFFFF)
 
#define QC32dn(j, r)   ((sph_u32)(r) ^ SPH_T32(~(sph_u32)(j)))
 
#define DECL_STATE_SMALL   sph_u32 H[16];
 
#define READ_STATE_SMALL(sc)
 
#define WRITE_STATE_SMALL(sc)
 
#define XCAT(x, y)   XCAT_(x, y)
 
#define XCAT_(x, y)   x ## y
 
#define RSTT(d0, d1, a, b0, b1, b2, b3, b4, b5, b6, b7)
 
#define ROUND_SMALL_P(a, r)
 
#define ROUND_SMALL_Q(a, r)
 
#define PERM_SMALL_P(a)
 
#define PERM_SMALL_Q(a)
 
#define COMPRESS_SMALL
 
#define FINAL_SMALL
 
#define DECL_STATE_BIG   sph_u32 H[32];
 
#define READ_STATE_BIG(sc)
 
#define WRITE_STATE_BIG(sc)
 
#define RBTT(d0, d1, a, b0, b1, b2, b3, b4, b5, b6, b7)
 
#define ROUND_BIG_P(a, r)
 
#define ROUND_BIG_Q(a, r)
 
#define PERM_BIG_P(a)
 
#define PERM_BIG_Q(a)
 
#define COMPRESS_BIG
 
#define FINAL_BIG
 

Functions

static void groestl_small_init (sph_groestl_small_context *sc, unsigned out_size)
 
static void groestl_small_core (sph_groestl_small_context *sc, const void *data, size_t len)
 
static void groestl_small_close (sph_groestl_small_context *sc, unsigned ub, unsigned n, void *dst, size_t out_len)
 
static void groestl_big_init (sph_groestl_big_context *sc, unsigned out_size)
 
static void groestl_big_core (sph_groestl_big_context *sc, const void *data, size_t len)
 
static void groestl_big_close (sph_groestl_big_context *sc, unsigned ub, unsigned n, void *dst, size_t out_len)
 
void sph_groestl224_init (void *cc)
 Initialize a Groestl-224 context. More...
 
void sph_groestl224 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_groestl224_close (void *cc, void *dst)
 Terminate the current Groestl-224 computation and output the result into the provided buffer. More...
 
void sph_groestl224_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_groestl256_init (void *cc)
 Initialize a Groestl-256 context. More...
 
void sph_groestl256 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_groestl256_close (void *cc, void *dst)
 Terminate the current Groestl-256 computation and output the result into the provided buffer. More...
 
void sph_groestl256_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_groestl384_init (void *cc)
 Initialize a Groestl-384 context. More...
 
void sph_groestl384 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_groestl384_close (void *cc, void *dst)
 Terminate the current Groestl-384 computation and output the result into the provided buffer. More...
 
void sph_groestl384_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_groestl512_init (void *cc)
 Initialize a Groestl-512 context. More...
 
void sph_groestl512 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_groestl512_close (void *cc, void *dst)
 Terminate the current Groestl-512 computation and output the result into the provided buffer. More...
 
void sph_groestl512_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...
 

Variables

static const sph_u32 T0up []
 
static const sph_u32 T0dn []
 
static const sph_u32 T1up []
 
static const sph_u32 T1dn []
 
static const sph_u32 T2up []
 
static const sph_u32 T2dn []
 
static const sph_u32 T3up []
 
static const sph_u32 T3dn []
 

Macro Definition Documentation

◆ B32_0

#define B32_0 (   x)    ((x) >> 24)

Definition at line 131 of file groestl.c.

◆ B32_1

#define B32_1 (   x)    (((x) >> 16) & 0xFF)

Definition at line 132 of file groestl.c.

◆ B32_2

#define B32_2 (   x)    (((x) >> 8) & 0xFF)

Definition at line 133 of file groestl.c.

◆ B32_3

#define B32_3 (   x)    ((x) & 0xFF)

Definition at line 134 of file groestl.c.

◆ C32e

#define C32e (   x)    SPH_C32(x)

Definition at line 128 of file groestl.c.

◆ COMPRESS_BIG

#define COMPRESS_BIG
Value:
do { \
sph_u32 g[32], m[32]; \
size_t u; \
for (u = 0; u < 32; u ++) { \
m[u] = dec32e_aligned(buf + (u << 2)); \
g[u] = m[u] ^ H[u]; \
} \
PERM_BIG_P(g); \
PERM_BIG_Q(m); \
for (u = 0; u < 32; u ++) \
H[u] ^= g[u] ^ m[u]; \
} while (0)
#define H(x)
#define dec32e_aligned
Definition: groestl.c:129

Definition at line 2713 of file groestl.c.

Referenced by groestl_big_core().

◆ COMPRESS_SMALL

#define COMPRESS_SMALL
Value:
do { \
sph_u32 g[16], m[16]; \
size_t u; \
for (u = 0; u < 16; u ++) { \
m[u] = dec32e_aligned(buf + (u << 2)); \
g[u] = m[u] ^ H[u]; \
} \
PERM_SMALL_P(g); \
PERM_SMALL_Q(m); \
for (u = 0; u < 16; u ++) \
H[u] ^= g[u] ^ m[u]; \
} while (0)
#define H(x)
#define dec32e_aligned
Definition: groestl.c:129

Definition at line 2330 of file groestl.c.

Referenced by groestl_small_core().

◆ dec32e_aligned

#define dec32e_aligned   sph_dec32be_aligned

Definition at line 129 of file groestl.c.

◆ DECL_STATE_BIG

#define DECL_STATE_BIG   sph_u32 H[32];

Definition at line 2352 of file groestl.c.

Referenced by groestl_big_close(), and groestl_big_core().

◆ DECL_STATE_SMALL

#define DECL_STATE_SMALL   sph_u32 H[16];

Definition at line 2205 of file groestl.c.

Referenced by groestl_small_close(), and groestl_small_core().

◆ enc32e

#define enc32e   sph_enc32be

Definition at line 130 of file groestl.c.

Referenced by groestl_big_close(), and groestl_small_close().

◆ FINAL_BIG

#define FINAL_BIG
Value:
do { \
sph_u32 x[32]; \
size_t u; \
memcpy(x, H, sizeof x); \
PERM_BIG_P(x); \
for (u = 0; u < 32; u ++) \
H[u] ^= x[u]; \
} while (0)
#define H(x)

Definition at line 2726 of file groestl.c.

Referenced by groestl_big_close().

◆ FINAL_SMALL

#define FINAL_SMALL
Value:
do { \
sph_u32 x[16]; \
size_t u; \
memcpy(x, H, sizeof x); \
PERM_SMALL_P(x); \
for (u = 0; u < 16; u ++) \
H[u] ^= x[u]; \
} while (0)
#define H(x)

Definition at line 2343 of file groestl.c.

Referenced by groestl_small_close().

◆ PC32dn

#define PC32dn (   j,
 
)    0

Definition at line 140 of file groestl.c.

◆ PC32up

#define PC32up (   j,
 
)    ((sph_u32)((j) + (r)) << 24)

Definition at line 139 of file groestl.c.

◆ PERM_BIG_P

#define PERM_BIG_P (   a)
Value:
do { \
int r; \
for (r = 0; r < 14; r += 2) { \
ROUND_BIG_P(a, r + 0); \
ROUND_BIG_P(a, r + 1); \
} \
} while (0)

Definition at line 2695 of file groestl.c.

◆ PERM_BIG_Q

#define PERM_BIG_Q (   a)
Value:
do { \
int r; \
for (r = 0; r < 14; r += 2) { \
ROUND_BIG_Q(a, r + 0); \
ROUND_BIG_Q(a, r + 1); \
} \
} while (0)

Definition at line 2703 of file groestl.c.

◆ PERM_SMALL_P

#define PERM_SMALL_P (   a)
Value:
do { \
int r; \
for (r = 0; r < 10; r += 2) { \
ROUND_SMALL_P(a, r + 0); \
ROUND_SMALL_P(a, r + 1); \
} \
} while (0)

Definition at line 2312 of file groestl.c.

◆ PERM_SMALL_Q

#define PERM_SMALL_Q (   a)
Value:
do { \
int r; \
for (r = 0; r < 10; r += 2) { \
ROUND_SMALL_Q(a, r + 0); \
ROUND_SMALL_Q(a, r + 1); \
} \
} while (0)

Definition at line 2320 of file groestl.c.

◆ QC32dn

#define QC32dn (   j,
 
)    ((sph_u32)(r) ^ SPH_T32(~(sph_u32)(j)))

Definition at line 142 of file groestl.c.

◆ QC32up

#define QC32up (   j,
 
)    SPH_C32(0xFFFFFFFF)

Definition at line 141 of file groestl.c.

◆ R32d

#define R32d (   u,
 
)    SPH_T32(((u) << 16) | ((d) >> 16))

Definition at line 137 of file groestl.c.

◆ R32u

#define R32u (   u,
 
)    SPH_T32(((u) >> 16) | ((d) << 16))

Definition at line 136 of file groestl.c.

◆ RBTT

#define RBTT (   d0,
  d1,
  a,
  b0,
  b1,
  b2,
  b3,
  b4,
  b5,
  b6,
  b7 
)
Value:
do { \
t[d0] = T0up[B32_0(a[b0])] \
^ T1up[B32_1(a[b1])] \
^ T2up[B32_2(a[b2])] \
^ T3up[B32_3(a[b3])] \
^ T0dn[B32_0(a[b4])] \
^ T1dn[B32_1(a[b5])] \
^ T2dn[B32_2(a[b6])] \
^ T3dn[B32_3(a[b7])]; \
t[d1] = T0dn[B32_0(a[b0])] \
^ T1dn[B32_1(a[b1])] \
^ T2dn[B32_2(a[b2])] \
^ T3dn[B32_3(a[b3])] \
^ T0up[B32_0(a[b4])] \
^ T1up[B32_1(a[b5])] \
^ T2up[B32_2(a[b6])] \
^ T3up[B32_3(a[b7])]; \
} while (0)
static const sph_u32 T2dn[]
Definition: groestl.c:2004
static const sph_u32 T2up[]
Definition: groestl.c:1937
#define B32_3(x)
Definition: groestl.c:134
static const sph_u32 T1up[]
Definition: groestl.c:1803
static const sph_u32 T3dn[]
Definition: groestl.c:2138
#define B32_1(x)
Definition: groestl.c:132
static const sph_u32 T0up[]
Definition: groestl.c:1669
static const sph_u32 T0dn[]
Definition: groestl.c:1736
static const sph_u32 T3up[]
Definition: groestl.c:2071
#define B32_2(x)
Definition: groestl.c:133
static const sph_u32 T1dn[]
Definition: groestl.c:1870
#define B32_0(x)
Definition: groestl.c:131

Definition at line 2394 of file groestl.c.

◆ READ_STATE_BIG

#define READ_STATE_BIG (   sc)
Value:
do { \
memcpy(H, (sc)->state.narrow, sizeof H); \
} while (0)
#define H(x)

Definition at line 2355 of file groestl.c.

Referenced by groestl_big_close(), and groestl_big_core().

◆ READ_STATE_SMALL

#define READ_STATE_SMALL (   sc)
Value:
do { \
memcpy(H, (sc)->state.narrow, sizeof H); \
} while (0)
#define H(x)

Definition at line 2208 of file groestl.c.

Referenced by groestl_small_close(), and groestl_small_core().

◆ ROUND_BIG_P

#define ROUND_BIG_P (   a,
 
)

Definition at line 2539 of file groestl.c.

◆ ROUND_BIG_Q

#define ROUND_BIG_Q (   a,
 
)

Definition at line 2608 of file groestl.c.

◆ ROUND_SMALL_P

#define ROUND_SMALL_P (   a,
 
)
Value:
do { \
sph_u32 t[16]; \
a[0x0] ^= PC32up(0x00, r); \
a[0x1] ^= PC32dn(0x00, r); \
a[0x2] ^= PC32up(0x10, r); \
a[0x3] ^= PC32dn(0x10, r); \
a[0x4] ^= PC32up(0x20, r); \
a[0x5] ^= PC32dn(0x20, r); \
a[0x6] ^= PC32up(0x30, r); \
a[0x7] ^= PC32dn(0x30, r); \
a[0x8] ^= PC32up(0x40, r); \
a[0x9] ^= PC32dn(0x40, r); \
a[0xA] ^= PC32up(0x50, r); \
a[0xB] ^= PC32dn(0x50, r); \
a[0xC] ^= PC32up(0x60, r); \
a[0xD] ^= PC32dn(0x60, r); \
a[0xE] ^= PC32up(0x70, r); \
a[0xF] ^= PC32dn(0x70, r); \
RSTT(0x0, 0x1, a, 0x0, 0x2, 0x4, 0x6, 0x9, 0xB, 0xD, 0xF); \
RSTT(0x2, 0x3, a, 0x2, 0x4, 0x6, 0x8, 0xB, 0xD, 0xF, 0x1); \
RSTT(0x4, 0x5, a, 0x4, 0x6, 0x8, 0xA, 0xD, 0xF, 0x1, 0x3); \
RSTT(0x6, 0x7, a, 0x6, 0x8, 0xA, 0xC, 0xF, 0x1, 0x3, 0x5); \
RSTT(0x8, 0x9, a, 0x8, 0xA, 0xC, 0xE, 0x1, 0x3, 0x5, 0x7); \
RSTT(0xA, 0xB, a, 0xA, 0xC, 0xE, 0x0, 0x3, 0x5, 0x7, 0x9); \
RSTT(0xC, 0xD, a, 0xC, 0xE, 0x0, 0x2, 0x5, 0x7, 0x9, 0xB); \
RSTT(0xE, 0xF, a, 0xE, 0x0, 0x2, 0x4, 0x7, 0x9, 0xB, 0xD); \
memcpy(a, t, sizeof t); \
} while (0)
#define PC32up(j, r)
Definition: groestl.c:139
#define PC32dn(j, r)
Definition: groestl.c:140

Definition at line 2238 of file groestl.c.

◆ ROUND_SMALL_Q

#define ROUND_SMALL_Q (   a,
 
)
Value:
do { \
sph_u32 t[16]; \
a[0x0] ^= QC32up(0x00, r); \
a[0x1] ^= QC32dn(0x00, r); \
a[0x2] ^= QC32up(0x10, r); \
a[0x3] ^= QC32dn(0x10, r); \
a[0x4] ^= QC32up(0x20, r); \
a[0x5] ^= QC32dn(0x20, r); \
a[0x6] ^= QC32up(0x30, r); \
a[0x7] ^= QC32dn(0x30, r); \
a[0x8] ^= QC32up(0x40, r); \
a[0x9] ^= QC32dn(0x40, r); \
a[0xA] ^= QC32up(0x50, r); \
a[0xB] ^= QC32dn(0x50, r); \
a[0xC] ^= QC32up(0x60, r); \
a[0xD] ^= QC32dn(0x60, r); \
a[0xE] ^= QC32up(0x70, r); \
a[0xF] ^= QC32dn(0x70, r); \
RSTT(0x0, 0x1, a, 0x2, 0x6, 0xA, 0xE, 0x1, 0x5, 0x9, 0xD); \
RSTT(0x2, 0x3, a, 0x4, 0x8, 0xC, 0x0, 0x3, 0x7, 0xB, 0xF); \
RSTT(0x4, 0x5, a, 0x6, 0xA, 0xE, 0x2, 0x5, 0x9, 0xD, 0x1); \
RSTT(0x6, 0x7, a, 0x8, 0xC, 0x0, 0x4, 0x7, 0xB, 0xF, 0x3); \
RSTT(0x8, 0x9, a, 0xA, 0xE, 0x2, 0x6, 0x9, 0xD, 0x1, 0x5); \
RSTT(0xA, 0xB, a, 0xC, 0x0, 0x4, 0x8, 0xB, 0xF, 0x3, 0x7); \
RSTT(0xC, 0xD, a, 0xE, 0x2, 0x6, 0xA, 0xD, 0x1, 0x5, 0x9); \
RSTT(0xE, 0xF, a, 0x0, 0x4, 0x8, 0xC, 0xF, 0x3, 0x7, 0xB); \
memcpy(a, t, sizeof t); \
} while (0)
#define QC32dn(j, r)
Definition: groestl.c:142
#define QC32up(j, r)
Definition: groestl.c:141

Definition at line 2267 of file groestl.c.

◆ RSTT

#define RSTT (   d0,
  d1,
  a,
  b0,
  b1,
  b2,
  b3,
  b4,
  b5,
  b6,
  b7 
)
Value:
do { \
t[d0] = T0up[B32_0(a[b0])] \
^ T1up[B32_1(a[b1])] \
^ T2up[B32_2(a[b2])] \
^ T3up[B32_3(a[b3])] \
^ T0dn[B32_0(a[b4])] \
^ T1dn[B32_1(a[b5])] \
^ T2dn[B32_2(a[b6])] \
^ T3dn[B32_3(a[b7])]; \
t[d1] = T0dn[B32_0(a[b0])] \
^ T1dn[B32_1(a[b1])] \
^ T2dn[B32_2(a[b2])] \
^ T3dn[B32_3(a[b3])] \
^ T0up[B32_0(a[b4])] \
^ T1up[B32_1(a[b5])] \
^ T2up[B32_2(a[b6])] \
^ T3up[B32_3(a[b7])]; \
} while (0)
static const sph_u32 T2dn[]
Definition: groestl.c:2004
static const sph_u32 T2up[]
Definition: groestl.c:1937
#define B32_3(x)
Definition: groestl.c:134
static const sph_u32 T1up[]
Definition: groestl.c:1803
static const sph_u32 T3dn[]
Definition: groestl.c:2138
#define B32_1(x)
Definition: groestl.c:132
static const sph_u32 T0up[]
Definition: groestl.c:1669
static const sph_u32 T0dn[]
Definition: groestl.c:1736
static const sph_u32 T3up[]
Definition: groestl.c:2071
#define B32_2(x)
Definition: groestl.c:133
static const sph_u32 T1dn[]
Definition: groestl.c:1870
#define B32_0(x)
Definition: groestl.c:131

Definition at line 2219 of file groestl.c.

◆ SPH_GROESTL_64

#define SPH_GROESTL_64   1

Definition at line 54 of file groestl.c.

◆ WRITE_STATE_BIG

#define WRITE_STATE_BIG (   sc)
Value:
do { \
memcpy((sc)->state.narrow, H, sizeof H); \
} while (0)
#define H(x)

Definition at line 2359 of file groestl.c.

Referenced by groestl_big_core().

◆ WRITE_STATE_SMALL

#define WRITE_STATE_SMALL (   sc)
Value:
do { \
memcpy((sc)->state.narrow, H, sizeof H); \
} while (0)
#define H(x)

Definition at line 2212 of file groestl.c.

Referenced by groestl_small_core().

◆ XCAT

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

Definition at line 2216 of file groestl.c.

◆ XCAT_

#define XCAT_ (   x,
 
)    x ## y

Definition at line 2217 of file groestl.c.

Function Documentation

◆ groestl_big_close()

◆ groestl_big_core()

◆ groestl_big_init()

◆ groestl_small_close()

◆ groestl_small_core()

◆ groestl_small_init()

◆ sph_groestl224()

void sph_groestl224 ( 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 Groestl-224 context
datathe input data
lenthe input data length (in bytes)

Definition at line 3018 of file groestl.c.

References groestl_small_core().

◆ sph_groestl224_addbits_and_close()

void sph_groestl224_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 Groestl-224 context
ubthe extra bits
nthe number of extra bits (0 to 7)
dstthe destination buffer

Definition at line 3032 of file groestl.c.

References groestl_small_close().

◆ sph_groestl224_close()

void sph_groestl224_close ( void *  cc,
void *  dst 
)

Terminate the current Groestl-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 Groestl-224 context
dstthe destination buffer

Definition at line 3025 of file groestl.c.

References groestl_small_close().

◆ sph_groestl224_init()

void sph_groestl224_init ( void *  cc)

Initialize a Groestl-224 context.

This process performs no memory allocation.

Parameters
ccthe Groestl-224 context (pointer to a sph_groestl224_context)

Definition at line 3011 of file groestl.c.

References groestl_small_init().

◆ sph_groestl256()

void sph_groestl256 ( 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 Groestl-256 context
datathe input data
lenthe input data length (in bytes)

Definition at line 3046 of file groestl.c.

References groestl_small_core().

◆ sph_groestl256_addbits_and_close()

void sph_groestl256_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 Groestl-256 context
ubthe extra bits
nthe number of extra bits (0 to 7)
dstthe destination buffer

Definition at line 3060 of file groestl.c.

References groestl_small_close().

◆ sph_groestl256_close()

void sph_groestl256_close ( void *  cc,
void *  dst 
)

Terminate the current Groestl-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 Groestl-256 context
dstthe destination buffer

Definition at line 3053 of file groestl.c.

References groestl_small_close().

◆ sph_groestl256_init()

void sph_groestl256_init ( void *  cc)

Initialize a Groestl-256 context.

This process performs no memory allocation.

Parameters
ccthe Groestl-256 context (pointer to a sph_groestl256_context)

Definition at line 3039 of file groestl.c.

References groestl_small_init().

◆ sph_groestl384()

void sph_groestl384 ( 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 Groestl-384 context
datathe input data
lenthe input data length (in bytes)

Definition at line 3074 of file groestl.c.

References groestl_big_core().

◆ sph_groestl384_addbits_and_close()

void sph_groestl384_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 Groestl-384 context
ubthe extra bits
nthe number of extra bits (0 to 7)
dstthe destination buffer

Definition at line 3088 of file groestl.c.

References groestl_big_close().

◆ sph_groestl384_close()

void sph_groestl384_close ( void *  cc,
void *  dst 
)

Terminate the current Groestl-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 Groestl-384 context
dstthe destination buffer

Definition at line 3081 of file groestl.c.

References groestl_big_close().

◆ sph_groestl384_init()

void sph_groestl384_init ( void *  cc)

Initialize a Groestl-384 context.

This process performs no memory allocation.

Parameters
ccthe Groestl-384 context (pointer to a sph_groestl384_context)

Definition at line 3067 of file groestl.c.

References groestl_big_init().

◆ sph_groestl512()

void sph_groestl512 ( 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 Groestl-512 context
datathe input data
lenthe input data length (in bytes)

Definition at line 3102 of file groestl.c.

References groestl_big_core().

Referenced by HashX11().

◆ sph_groestl512_addbits_and_close()

void sph_groestl512_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 Groestl-512 context
ubthe extra bits
nthe number of extra bits (0 to 7)
dstthe destination buffer

Definition at line 3116 of file groestl.c.

References groestl_big_close().

◆ sph_groestl512_close()

void sph_groestl512_close ( void *  cc,
void *  dst 
)

Terminate the current Groestl-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 Groestl-512 context
dstthe destination buffer

Definition at line 3109 of file groestl.c.

References groestl_big_close().

Referenced by HashX11().

◆ sph_groestl512_init()

void sph_groestl512_init ( void *  cc)

Initialize a Groestl-512 context.

This process performs no memory allocation.

Parameters
ccthe Groestl-512 context (pointer to a sph_groestl512_context)

Definition at line 3095 of file groestl.c.

References groestl_big_init().

Referenced by HashX11().

Variable Documentation

◆ T0dn

const sph_u32 T0dn[]
static

Definition at line 1736 of file groestl.c.

◆ T0up

const sph_u32 T0up[]
static

Definition at line 1669 of file groestl.c.

◆ T1dn

const sph_u32 T1dn[]
static

Definition at line 1870 of file groestl.c.

◆ T1up

const sph_u32 T1up[]
static

Definition at line 1803 of file groestl.c.

◆ T2dn

const sph_u32 T2dn[]
static

Definition at line 2004 of file groestl.c.

◆ T2up

const sph_u32 T2up[]
static

Definition at line 1937 of file groestl.c.

◆ T3dn

const sph_u32 T3dn[]
static

Definition at line 2138 of file groestl.c.

◆ T3up

const sph_u32 T3up[]
static

Definition at line 2071 of file groestl.c.

Released under the MIT license