Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

blake.c File Reference
#include <stddef.h>
#include <string.h>
#include <limits.h>
#include "sph_blake.h"
+ Include dependency graph for blake.c:

Go to the source code of this file.

Macros

#define Z00   0
 
#define Z01   1
 
#define Z02   2
 
#define Z03   3
 
#define Z04   4
 
#define Z05   5
 
#define Z06   6
 
#define Z07   7
 
#define Z08   8
 
#define Z09   9
 
#define Z0A   A
 
#define Z0B   B
 
#define Z0C   C
 
#define Z0D   D
 
#define Z0E   E
 
#define Z0F   F
 
#define Z10   E
 
#define Z11   A
 
#define Z12   4
 
#define Z13   8
 
#define Z14   9
 
#define Z15   F
 
#define Z16   D
 
#define Z17   6
 
#define Z18   1
 
#define Z19   C
 
#define Z1A   0
 
#define Z1B   2
 
#define Z1C   B
 
#define Z1D   7
 
#define Z1E   5
 
#define Z1F   3
 
#define Z20   B
 
#define Z21   8
 
#define Z22   C
 
#define Z23   0
 
#define Z24   5
 
#define Z25   2
 
#define Z26   F
 
#define Z27   D
 
#define Z28   A
 
#define Z29   E
 
#define Z2A   3
 
#define Z2B   6
 
#define Z2C   7
 
#define Z2D   1
 
#define Z2E   9
 
#define Z2F   4
 
#define Z30   7
 
#define Z31   9
 
#define Z32   3
 
#define Z33   1
 
#define Z34   D
 
#define Z35   C
 
#define Z36   B
 
#define Z37   E
 
#define Z38   2
 
#define Z39   6
 
#define Z3A   5
 
#define Z3B   A
 
#define Z3C   4
 
#define Z3D   0
 
#define Z3E   F
 
#define Z3F   8
 
#define Z40   9
 
#define Z41   0
 
#define Z42   5
 
#define Z43   7
 
#define Z44   2
 
#define Z45   4
 
#define Z46   A
 
#define Z47   F
 
#define Z48   E
 
#define Z49   1
 
#define Z4A   B
 
#define Z4B   C
 
#define Z4C   6
 
#define Z4D   8
 
#define Z4E   3
 
#define Z4F   D
 
#define Z50   2
 
#define Z51   C
 
#define Z52   6
 
#define Z53   A
 
#define Z54   0
 
#define Z55   B
 
#define Z56   8
 
#define Z57   3
 
#define Z58   4
 
#define Z59   D
 
#define Z5A   7
 
#define Z5B   5
 
#define Z5C   F
 
#define Z5D   E
 
#define Z5E   1
 
#define Z5F   9
 
#define Z60   C
 
#define Z61   5
 
#define Z62   1
 
#define Z63   F
 
#define Z64   E
 
#define Z65   D
 
#define Z66   4
 
#define Z67   A
 
#define Z68   0
 
#define Z69   7
 
#define Z6A   6
 
#define Z6B   3
 
#define Z6C   9
 
#define Z6D   2
 
#define Z6E   8
 
#define Z6F   B
 
#define Z70   D
 
#define Z71   B
 
#define Z72   7
 
#define Z73   E
 
#define Z74   C
 
#define Z75   1
 
#define Z76   3
 
#define Z77   9
 
#define Z78   5
 
#define Z79   0
 
#define Z7A   F
 
#define Z7B   4
 
#define Z7C   8
 
#define Z7D   6
 
#define Z7E   2
 
#define Z7F   A
 
#define Z80   6
 
#define Z81   F
 
#define Z82   E
 
#define Z83   9
 
#define Z84   B
 
#define Z85   3
 
#define Z86   0
 
#define Z87   8
 
#define Z88   C
 
#define Z89   2
 
#define Z8A   D
 
#define Z8B   7
 
#define Z8C   1
 
#define Z8D   4
 
#define Z8E   A
 
#define Z8F   5
 
#define Z90   A
 
#define Z91   2
 
#define Z92   8
 
#define Z93   4
 
#define Z94   7
 
#define Z95   6
 
#define Z96   1
 
#define Z97   5
 
#define Z98   F
 
#define Z99   B
 
#define Z9A   9
 
#define Z9B   E
 
#define Z9C   3
 
#define Z9D   C
 
#define Z9E   D
 
#define Z9F   0
 
#define Mx(r, i)   Mx_(Z ## r ## i)
 
#define Mx_(n)   Mx__(n)
 
#define Mx__(n)   M ## n
 
#define CSx(r, i)   CSx_(Z ## r ## i)
 
#define CSx_(n)   CSx__(n)
 
#define CSx__(n)   CS ## n
 
#define CS0   SPH_C32(0x243F6A88)
 
#define CS1   SPH_C32(0x85A308D3)
 
#define CS2   SPH_C32(0x13198A2E)
 
#define CS3   SPH_C32(0x03707344)
 
#define CS4   SPH_C32(0xA4093822)
 
#define CS5   SPH_C32(0x299F31D0)
 
#define CS6   SPH_C32(0x082EFA98)
 
#define CS7   SPH_C32(0xEC4E6C89)
 
#define CS8   SPH_C32(0x452821E6)
 
#define CS9   SPH_C32(0x38D01377)
 
#define CSA   SPH_C32(0xBE5466CF)
 
#define CSB   SPH_C32(0x34E90C6C)
 
#define CSC   SPH_C32(0xC0AC29B7)
 
#define CSD   SPH_C32(0xC97C50DD)
 
#define CSE   SPH_C32(0x3F84D5B5)
 
#define CSF   SPH_C32(0xB5470917)
 
#define GS(m0, m1, c0, c1, a, b, c, d)
 
#define ROUND_S(r)
 
#define DECL_STATE32
 
#define READ_STATE32(state)
 
#define WRITE_STATE32(state)
 
#define COMPRESS32
 

Functions

static void blake32_init (sph_blake_small_context *sc, const sph_u32 *iv, const sph_u32 *salt)
 
static void blake32 (sph_blake_small_context *sc, const void *data, size_t len)
 
static void blake32_close (sph_blake_small_context *sc, unsigned ub, unsigned n, void *dst, size_t out_size_w32)
 
void sph_blake224_init (void *cc)
 Initialize a BLAKE-224 context. More...
 
void sph_blake224 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_blake224_close (void *cc, void *dst)
 Terminate the current BLAKE-224 computation and output the result into the provided buffer. More...
 
void sph_blake224_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_blake256_init (void *cc)
 Initialize a BLAKE-256 context. More...
 
void sph_blake256 (void *cc, const void *data, size_t len)
 Process some data bytes. More...
 
void sph_blake256_close (void *cc, void *dst)
 Terminate the current BLAKE-256 computation and output the result into the provided buffer. More...
 
void sph_blake256_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...
 

Variables

static const sph_u32 IV224 [8]
 
static const sph_u32 IV256 [8]
 
static const sph_u32 salt_zero_small [4] = { 0, 0, 0, 0 }
 

Macro Definition Documentation

◆ COMPRESS32

#define COMPRESS32

Definition at line 565 of file blake.c.

Referenced by blake32().

◆ CS0

#define CS0   SPH_C32(0x243F6A88)

Definition at line 304 of file blake.c.

◆ CS1

#define CS1   SPH_C32(0x85A308D3)

Definition at line 305 of file blake.c.

◆ CS2

#define CS2   SPH_C32(0x13198A2E)

Definition at line 306 of file blake.c.

◆ CS3

#define CS3   SPH_C32(0x03707344)

Definition at line 307 of file blake.c.

◆ CS4

#define CS4   SPH_C32(0xA4093822)

Definition at line 308 of file blake.c.

◆ CS5

#define CS5   SPH_C32(0x299F31D0)

Definition at line 309 of file blake.c.

◆ CS6

#define CS6   SPH_C32(0x082EFA98)

Definition at line 310 of file blake.c.

◆ CS7

#define CS7   SPH_C32(0xEC4E6C89)

Definition at line 311 of file blake.c.

◆ CS8

#define CS8   SPH_C32(0x452821E6)

Definition at line 312 of file blake.c.

◆ CS9

#define CS9   SPH_C32(0x38D01377)

Definition at line 313 of file blake.c.

◆ CSA

#define CSA   SPH_C32(0xBE5466CF)

Definition at line 314 of file blake.c.

◆ CSB

#define CSB   SPH_C32(0x34E90C6C)

Definition at line 315 of file blake.c.

◆ CSC

#define CSC   SPH_C32(0xC0AC29B7)

Definition at line 316 of file blake.c.

◆ CSD

#define CSD   SPH_C32(0xC97C50DD)

Definition at line 317 of file blake.c.

◆ CSE

#define CSE   SPH_C32(0x3F84D5B5)

Definition at line 318 of file blake.c.

◆ CSF

#define CSF   SPH_C32(0xB5470917)

Definition at line 319 of file blake.c.

◆ CSx

#define CSx (   r,
 
)    CSx_(Z ## r ## i)

Definition at line 300 of file blake.c.

◆ CSx_

#define CSx_ (   n)    CSx__(n)

Definition at line 301 of file blake.c.

◆ CSx__

#define CSx__ (   n)    CS ## n

Definition at line 302 of file blake.c.

◆ DECL_STATE32

#define DECL_STATE32
Value:
sph_u32 H0, H1, H2, H3, H4, H5, H6, H7; \
sph_u32 S0, S1, S2, S3, T0, T1;
unsigned long sph_u32
Definition: sph_types.h:870

Definition at line 474 of file blake.c.

Referenced by blake32().

◆ GS

#define GS (   m0,
  m1,
  c0,
  c1,
  a,
  b,
  c,
 
)
Value:
do { \
a = SPH_T32(a + b + (m0 ^ c1)); \
d = SPH_ROTR32(d ^ a, 16); \
c = SPH_T32(c + d); \
b = SPH_ROTR32(b ^ c, 12); \
a = SPH_T32(a + b + (m1 ^ c0)); \
d = SPH_ROTR32(d ^ a, 8); \
c = SPH_T32(c + d); \
b = SPH_ROTR32(b ^ c, 7); \
} while (0)
#define SPH_T32(x)
Definition: sph_types.h:932
#define SPH_ROTR32(x, n)
Definition: sph_types.h:934

Definition at line 376 of file blake.c.

◆ Mx

#define Mx (   r,
 
)    Mx_(Z ## r ## i)

Definition at line 296 of file blake.c.

◆ Mx_

#define Mx_ (   n)    Mx__(n)

Definition at line 297 of file blake.c.

◆ Mx__

#define Mx__ (   n)    M ## n

Definition at line 298 of file blake.c.

◆ READ_STATE32

#define READ_STATE32 (   state)
Value:
do { \
H0 = (state)->H[0]; \
H1 = (state)->H[1]; \
H2 = (state)->H[2]; \
H3 = (state)->H[3]; \
H4 = (state)->H[4]; \
H5 = (state)->H[5]; \
H6 = (state)->H[6]; \
H7 = (state)->H[7]; \
S0 = (state)->S[0]; \
S1 = (state)->S[1]; \
S2 = (state)->S[2]; \
S3 = (state)->S[3]; \
T0 = (state)->T0; \
T1 = (state)->T1; \
} while (0)
#define H(x)
#define S(x0, x1, x2, x3, cb, r)
Definition: jh.c:494

Definition at line 478 of file blake.c.

Referenced by blake32().

◆ ROUND_S

#define ROUND_S (   r)
Value:
do { \
GS(Mx(r, 0), Mx(r, 1), CSx(r, 0), CSx(r, 1), V0, V4, V8, VC); \
GS(Mx(r, 2), Mx(r, 3), CSx(r, 2), CSx(r, 3), V1, V5, V9, VD); \
GS(Mx(r, 4), Mx(r, 5), CSx(r, 4), CSx(r, 5), V2, V6, VA, VE); \
GS(Mx(r, 6), Mx(r, 7), CSx(r, 6), CSx(r, 7), V3, V7, VB, VF); \
GS(Mx(r, 8), Mx(r, 9), CSx(r, 8), CSx(r, 9), V0, V5, VA, VF); \
GS(Mx(r, A), Mx(r, B), CSx(r, A), CSx(r, B), V1, V6, VB, VC); \
GS(Mx(r, C), Mx(r, D), CSx(r, C), CSx(r, D), V2, V7, V8, VD); \
GS(Mx(r, E), Mx(r, F), CSx(r, E), CSx(r, F), V3, V4, V9, VE); \
} while (0)
static const sph_u32 C[]
Definition: jh.c:370
#define CSx(r, i)
Definition: blake.c:300
#define Mx(r, i)
Definition: blake.c:296

Definition at line 410 of file blake.c.

◆ WRITE_STATE32

#define WRITE_STATE32 (   state)
Value:
do { \
(state)->H[0] = H0; \
(state)->H[1] = H1; \
(state)->H[2] = H2; \
(state)->H[3] = H3; \
(state)->H[4] = H4; \
(state)->H[5] = H5; \
(state)->H[6] = H6; \
(state)->H[7] = H7; \
(state)->S[0] = S0; \
(state)->S[1] = S1; \
(state)->S[2] = S2; \
(state)->S[3] = S3; \
(state)->T0 = T0; \
(state)->T1 = T1; \
} while (0)
#define H(x)
#define S(x0, x1, x2, x3, cb, r)
Definition: jh.c:494

Definition at line 495 of file blake.c.

Referenced by blake32().

◆ Z00

#define Z00   0

Definition at line 126 of file blake.c.

◆ Z01

#define Z01   1

Definition at line 127 of file blake.c.

◆ Z02

#define Z02   2

Definition at line 128 of file blake.c.

◆ Z03

#define Z03   3

Definition at line 129 of file blake.c.

◆ Z04

#define Z04   4

Definition at line 130 of file blake.c.

◆ Z05

#define Z05   5

Definition at line 131 of file blake.c.

◆ Z06

#define Z06   6

Definition at line 132 of file blake.c.

◆ Z07

#define Z07   7

Definition at line 133 of file blake.c.

◆ Z08

#define Z08   8

Definition at line 134 of file blake.c.

◆ Z09

#define Z09   9

Definition at line 135 of file blake.c.

◆ Z0A

#define Z0A   A

Definition at line 136 of file blake.c.

◆ Z0B

#define Z0B   B

Definition at line 137 of file blake.c.

◆ Z0C

#define Z0C   C

Definition at line 138 of file blake.c.

◆ Z0D

#define Z0D   D

Definition at line 139 of file blake.c.

◆ Z0E

#define Z0E   E

Definition at line 140 of file blake.c.

◆ Z0F

#define Z0F   F

Definition at line 141 of file blake.c.

◆ Z10

#define Z10   E

Definition at line 143 of file blake.c.

◆ Z11

#define Z11   A

Definition at line 144 of file blake.c.

◆ Z12

#define Z12   4

Definition at line 145 of file blake.c.

◆ Z13

#define Z13   8

Definition at line 146 of file blake.c.

◆ Z14

#define Z14   9

Definition at line 147 of file blake.c.

◆ Z15

#define Z15   F

Definition at line 148 of file blake.c.

◆ Z16

#define Z16   D

Definition at line 149 of file blake.c.

◆ Z17

#define Z17   6

Definition at line 150 of file blake.c.

◆ Z18

#define Z18   1

Definition at line 151 of file blake.c.

◆ Z19

#define Z19   C

Definition at line 152 of file blake.c.

◆ Z1A

#define Z1A   0

Definition at line 153 of file blake.c.

◆ Z1B

#define Z1B   2

Definition at line 154 of file blake.c.

◆ Z1C

#define Z1C   B

Definition at line 155 of file blake.c.

◆ Z1D

#define Z1D   7

Definition at line 156 of file blake.c.

◆ Z1E

#define Z1E   5

Definition at line 157 of file blake.c.

◆ Z1F

#define Z1F   3

Definition at line 158 of file blake.c.

◆ Z20

#define Z20   B

Definition at line 160 of file blake.c.

◆ Z21

#define Z21   8

Definition at line 161 of file blake.c.

◆ Z22

#define Z22   C

Definition at line 162 of file blake.c.

◆ Z23

#define Z23   0

Definition at line 163 of file blake.c.

◆ Z24

#define Z24   5

Definition at line 164 of file blake.c.

◆ Z25

#define Z25   2

Definition at line 165 of file blake.c.

◆ Z26

#define Z26   F

Definition at line 166 of file blake.c.

◆ Z27

#define Z27   D

Definition at line 167 of file blake.c.

◆ Z28

#define Z28   A

Definition at line 168 of file blake.c.

◆ Z29

#define Z29   E

Definition at line 169 of file blake.c.

◆ Z2A

#define Z2A   3

Definition at line 170 of file blake.c.

◆ Z2B

#define Z2B   6

Definition at line 171 of file blake.c.

◆ Z2C

#define Z2C   7

Definition at line 172 of file blake.c.

◆ Z2D

#define Z2D   1

Definition at line 173 of file blake.c.

◆ Z2E

#define Z2E   9

Definition at line 174 of file blake.c.

◆ Z2F

#define Z2F   4

Definition at line 175 of file blake.c.

◆ Z30

#define Z30   7

Definition at line 177 of file blake.c.

◆ Z31

#define Z31   9

Definition at line 178 of file blake.c.

◆ Z32

#define Z32   3

Definition at line 179 of file blake.c.

◆ Z33

#define Z33   1

Definition at line 180 of file blake.c.

◆ Z34

#define Z34   D

Definition at line 181 of file blake.c.

◆ Z35

#define Z35   C

Definition at line 182 of file blake.c.

◆ Z36

#define Z36   B

Definition at line 183 of file blake.c.

◆ Z37

#define Z37   E

Definition at line 184 of file blake.c.

◆ Z38

#define Z38   2

Definition at line 185 of file blake.c.

◆ Z39

#define Z39   6

Definition at line 186 of file blake.c.

◆ Z3A

#define Z3A   5

Definition at line 187 of file blake.c.

◆ Z3B

#define Z3B   A

Definition at line 188 of file blake.c.

◆ Z3C

#define Z3C   4

Definition at line 189 of file blake.c.

◆ Z3D

#define Z3D   0

Definition at line 190 of file blake.c.

◆ Z3E

#define Z3E   F

Definition at line 191 of file blake.c.

◆ Z3F

#define Z3F   8

Definition at line 192 of file blake.c.

◆ Z40

#define Z40   9

Definition at line 194 of file blake.c.

◆ Z41

#define Z41   0

Definition at line 195 of file blake.c.

◆ Z42

#define Z42   5

Definition at line 196 of file blake.c.

◆ Z43

#define Z43   7

Definition at line 197 of file blake.c.

◆ Z44

#define Z44   2

Definition at line 198 of file blake.c.

◆ Z45

#define Z45   4

Definition at line 199 of file blake.c.

◆ Z46

#define Z46   A

Definition at line 200 of file blake.c.

◆ Z47

#define Z47   F

Definition at line 201 of file blake.c.

◆ Z48

#define Z48   E

Definition at line 202 of file blake.c.

◆ Z49

#define Z49   1

Definition at line 203 of file blake.c.

◆ Z4A

#define Z4A   B

Definition at line 204 of file blake.c.

◆ Z4B

#define Z4B   C

Definition at line 205 of file blake.c.

◆ Z4C

#define Z4C   6

Definition at line 206 of file blake.c.

◆ Z4D

#define Z4D   8

Definition at line 207 of file blake.c.

◆ Z4E

#define Z4E   3

Definition at line 208 of file blake.c.

◆ Z4F

#define Z4F   D

Definition at line 209 of file blake.c.

◆ Z50

#define Z50   2

Definition at line 211 of file blake.c.

◆ Z51

#define Z51   C

Definition at line 212 of file blake.c.

◆ Z52

#define Z52   6

Definition at line 213 of file blake.c.

◆ Z53

#define Z53   A

Definition at line 214 of file blake.c.

◆ Z54

#define Z54   0

Definition at line 215 of file blake.c.

◆ Z55

#define Z55   B

Definition at line 216 of file blake.c.

◆ Z56

#define Z56   8

Definition at line 217 of file blake.c.

◆ Z57

#define Z57   3

Definition at line 218 of file blake.c.

◆ Z58

#define Z58   4

Definition at line 219 of file blake.c.

◆ Z59

#define Z59   D

Definition at line 220 of file blake.c.

◆ Z5A

#define Z5A   7

Definition at line 221 of file blake.c.

◆ Z5B

#define Z5B   5

Definition at line 222 of file blake.c.

◆ Z5C

#define Z5C   F

Definition at line 223 of file blake.c.

◆ Z5D

#define Z5D   E

Definition at line 224 of file blake.c.

◆ Z5E

#define Z5E   1

Definition at line 225 of file blake.c.

◆ Z5F

#define Z5F   9

Definition at line 226 of file blake.c.

◆ Z60

#define Z60   C

Definition at line 228 of file blake.c.

◆ Z61

#define Z61   5

Definition at line 229 of file blake.c.

◆ Z62

#define Z62   1

Definition at line 230 of file blake.c.

◆ Z63

#define Z63   F

Definition at line 231 of file blake.c.

◆ Z64

#define Z64   E

Definition at line 232 of file blake.c.

◆ Z65

#define Z65   D

Definition at line 233 of file blake.c.

◆ Z66

#define Z66   4

Definition at line 234 of file blake.c.

◆ Z67

#define Z67   A

Definition at line 235 of file blake.c.

◆ Z68

#define Z68   0

Definition at line 236 of file blake.c.

◆ Z69

#define Z69   7

Definition at line 237 of file blake.c.

◆ Z6A

#define Z6A   6

Definition at line 238 of file blake.c.

◆ Z6B

#define Z6B   3

Definition at line 239 of file blake.c.

◆ Z6C

#define Z6C   9

Definition at line 240 of file blake.c.

◆ Z6D

#define Z6D   2

Definition at line 241 of file blake.c.

◆ Z6E

#define Z6E   8

Definition at line 242 of file blake.c.

◆ Z6F

#define Z6F   B

Definition at line 243 of file blake.c.

◆ Z70

#define Z70   D

Definition at line 245 of file blake.c.

◆ Z71

#define Z71   B

Definition at line 246 of file blake.c.

◆ Z72

#define Z72   7

Definition at line 247 of file blake.c.

◆ Z73

#define Z73   E

Definition at line 248 of file blake.c.

◆ Z74

#define Z74   C

Definition at line 249 of file blake.c.

◆ Z75

#define Z75   1

Definition at line 250 of file blake.c.

◆ Z76

#define Z76   3

Definition at line 251 of file blake.c.

◆ Z77

#define Z77   9

Definition at line 252 of file blake.c.

◆ Z78

#define Z78   5

Definition at line 253 of file blake.c.

◆ Z79

#define Z79   0

Definition at line 254 of file blake.c.

◆ Z7A

#define Z7A   F

Definition at line 255 of file blake.c.

◆ Z7B

#define Z7B   4

Definition at line 256 of file blake.c.

◆ Z7C

#define Z7C   8

Definition at line 257 of file blake.c.

◆ Z7D

#define Z7D   6

Definition at line 258 of file blake.c.

◆ Z7E

#define Z7E   2

Definition at line 259 of file blake.c.

◆ Z7F

#define Z7F   A

Definition at line 260 of file blake.c.

◆ Z80

#define Z80   6

Definition at line 262 of file blake.c.

◆ Z81

#define Z81   F

Definition at line 263 of file blake.c.

◆ Z82

#define Z82   E

Definition at line 264 of file blake.c.

◆ Z83

#define Z83   9

Definition at line 265 of file blake.c.

◆ Z84

#define Z84   B

Definition at line 266 of file blake.c.

◆ Z85

#define Z85   3

Definition at line 267 of file blake.c.

◆ Z86

#define Z86   0

Definition at line 268 of file blake.c.

◆ Z87

#define Z87   8

Definition at line 269 of file blake.c.

◆ Z88

#define Z88   C

Definition at line 270 of file blake.c.

◆ Z89

#define Z89   2

Definition at line 271 of file blake.c.

◆ Z8A

#define Z8A   D

Definition at line 272 of file blake.c.

◆ Z8B

#define Z8B   7

Definition at line 273 of file blake.c.

◆ Z8C

#define Z8C   1

Definition at line 274 of file blake.c.

◆ Z8D

#define Z8D   4

Definition at line 275 of file blake.c.

◆ Z8E

#define Z8E   A

Definition at line 276 of file blake.c.

◆ Z8F

#define Z8F   5

Definition at line 277 of file blake.c.

◆ Z90

#define Z90   A

Definition at line 279 of file blake.c.

◆ Z91

#define Z91   2

Definition at line 280 of file blake.c.

◆ Z92

#define Z92   8

Definition at line 281 of file blake.c.

◆ Z93

#define Z93   4

Definition at line 282 of file blake.c.

◆ Z94

#define Z94   7

Definition at line 283 of file blake.c.

◆ Z95

#define Z95   6

Definition at line 284 of file blake.c.

◆ Z96

#define Z96   1

Definition at line 285 of file blake.c.

◆ Z97

#define Z97   5

Definition at line 286 of file blake.c.

◆ Z98

#define Z98   F

Definition at line 287 of file blake.c.

◆ Z99

#define Z99   B

Definition at line 288 of file blake.c.

◆ Z9A

#define Z9A   9

Definition at line 289 of file blake.c.

◆ Z9B

#define Z9B   E

Definition at line 290 of file blake.c.

◆ Z9C

#define Z9C   3

Definition at line 291 of file blake.c.

◆ Z9D

#define Z9D   C

Definition at line 292 of file blake.c.

◆ Z9E

#define Z9E   D

Definition at line 293 of file blake.c.

◆ Z9F

#define Z9F   0

Definition at line 294 of file blake.c.

Function Documentation

◆ blake32()

static void blake32 ( sph_blake_small_context sc,
const void *  data,
size_t  len 
)
static

◆ blake32_close()

static void blake32_close ( sph_blake_small_context sc,
unsigned  ub,
unsigned  n,
void *  dst,
size_t  out_size_w32 
)
static

◆ blake32_init()

static void blake32_init ( sph_blake_small_context sc,
const sph_u32 iv,
const sph_u32 salt 
)
static

◆ sph_blake224()

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

Definition at line 1007 of file blake.c.

References blake32().

◆ sph_blake224_addbits_and_close()

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

Definition at line 1021 of file blake.c.

References blake32_close(), and sph_blake224_init().

Referenced by sph_blake224_close().

◆ sph_blake224_close()

void sph_blake224_close ( void *  cc,
void *  dst 
)

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

Definition at line 1014 of file blake.c.

References sph_blake224_addbits_and_close().

◆ sph_blake224_init()

void sph_blake224_init ( void *  cc)

Initialize a BLAKE-224 context.

This process performs no memory allocation.

Parameters
ccthe BLAKE-224 context (pointer to a sph_blake224_context)

Definition at line 1000 of file blake.c.

References blake32_init(), IV224, and salt_zero_small.

Referenced by sph_blake224_addbits_and_close().

◆ sph_blake256()

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

Definition at line 1036 of file blake.c.

References blake32().

◆ sph_blake256_addbits_and_close()

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

Definition at line 1050 of file blake.c.

References blake32_close(), and sph_blake256_init().

Referenced by sph_blake256_close().

◆ sph_blake256_close()

void sph_blake256_close ( void *  cc,
void *  dst 
)

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

Definition at line 1043 of file blake.c.

References sph_blake256_addbits_and_close().

◆ sph_blake256_init()

void sph_blake256_init ( void *  cc)

Initialize a BLAKE-256 context.

This process performs no memory allocation.

Parameters
ccthe BLAKE-256 context (pointer to a sph_blake256_context)

Definition at line 1029 of file blake.c.

References blake32_init(), IV256, and salt_zero_small.

Referenced by sph_blake256_addbits_and_close().

Variable Documentation

◆ IV224

const sph_u32 IV224[8]
static
Initial value:
= {
SPH_C32(0xC1059ED8), SPH_C32(0x367CD507),
SPH_C32(0x3070DD17), SPH_C32(0xF70E5939),
SPH_C32(0xFFC00B31), SPH_C32(0x68581511),
SPH_C32(0x64F98FA7), SPH_C32(0xBEFA4FA4)
}
#define SPH_C32(x)
Definition: sph_types.h:873

Definition at line 59 of file blake.c.

Referenced by sph_blake224_init().

◆ IV256

const sph_u32 IV256[8]
static
Initial value:
= {
SPH_C32(0x6A09E667), SPH_C32(0xBB67AE85),
SPH_C32(0x3C6EF372), SPH_C32(0xA54FF53A),
SPH_C32(0x510E527F), SPH_C32(0x9B05688C),
SPH_C32(0x1F83D9AB), SPH_C32(0x5BE0CD19)
}
#define SPH_C32(x)
Definition: sph_types.h:873

Definition at line 66 of file blake.c.

Referenced by sph_blake256_init().

◆ salt_zero_small

const sph_u32 salt_zero_small[4] = { 0, 0, 0, 0 }
static

Definition at line 788 of file blake.c.

Referenced by sph_blake224_init(), and sph_blake256_init().

Released under the MIT license