Fabcoin Core  0.16.2
P2P Digital Currency
Macros | Functions
sha3.c File Reference
#include "sha3.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for sha3.c:

Go to the source code of this file.

Macros

#define rol(x, s)   (((x) << s) | ((x) >> (64 - s)))
 
#define REPEAT6(e)   e e e e e e
 
#define REPEAT24(e)   REPEAT6(e e e e)
 
#define REPEAT5(e)   e e e e e
 
#define FOR5(v, s, e)
 
#define _(S)   do { S } while (0)
 
#define FOR(i, ST, L, S)   _(for (size_t i = 0; i < L; i += ST) { S; })
 
#define mkapply_ds(NAME, S)
 
#define mkapply_sd(NAME, S)
 
#define P   keccakf
 
#define Plen   200
 
#define foldP(I, L, F)
 
#define defsha3(bits)
 

Functions

 mkapply_ds (xorin, dst^[i]=src[i])
 

Macro Definition Documentation

#define _ (   S)    do { S } while (0)

Definition at line 85 of file sha3.c.

#define defsha3 (   bits)
Value:
int sha3_##bits(uint8_t* out, size_t outlen, \
const uint8_t* in, size_t inlen) { \
if (outlen > (bits/8)) { \
return -1; \
} \
return hash(out, outlen, in, inlen, 200 - (bits / 4), 0x01); \
}
if(a.IndicesBefore(b, len, lenIndices))
Definition: equihash.cpp:243

Definition at line 140 of file sha3.c.

#define foldP (   I,
  L,
  F 
)
Value:
while (L >= rate) { \
F(a, I, rate); \
P(a); \
I += rate; \
L -= rate; \
}
#define P
#define a(i)
#define F(x, y, z)
Definition: Hash.cpp:79
#define I(x, y, z)
Definition: Hash.cpp:82
#define FOR (   i,
  ST,
  L,
  S 
)    _(for (size_t i = 0; i < L; i += ST) { S; })

Definition at line 86 of file sha3.c.

#define FOR5 (   v,
  s,
  e 
)
Value:
v = 0; \
REPEAT5(e; v += s;)
#define REPEAT5(e)
Definition: sha3.c:41
#define e(i)
Definition: sha.cpp:733

Definition at line 42 of file sha3.c.

#define mkapply_ds (   NAME,
  S 
)
Value:
static inline void NAME(uint8_t* dst, \
const uint8_t* src, \
size_t len) { \
FOR(i, 1, len, S); \
}
#define FOR(i, ST, L, S)
Definition: sha3.c:86
#define S(a)
Definition: mars.cpp:50

Definition at line 88 of file sha3.c.

#define mkapply_sd (   NAME,
  S 
)
Value:
static inline void NAME(const uint8_t* src, \
uint8_t* dst, \
size_t len) { \
FOR(i, 1, len, S); \
}
#define FOR(i, ST, L, S)
Definition: sha3.c:86
#define S(a)
Definition: mars.cpp:50

Definition at line 94 of file sha3.c.

#define P   keccakf
#define Plen   200
#define REPEAT24 (   e)    REPEAT6(e e e e)

Definition at line 40 of file sha3.c.

#define REPEAT5 (   e)    e e e e e

Definition at line 41 of file sha3.c.

#define REPEAT6 (   e)    e e e e e e

Definition at line 39 of file sha3.c.

#define rol (   x,
 
)    (((x) << s) | ((x) >> (64 - s)))

Definition at line 38 of file sha3.c.

Function Documentation

mkapply_ds ( xorin  ,
dst^  [i] = src[i] 
)

Definition at line 101 of file sha3.c.