Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

sph_blake.h
Go to the documentation of this file.
1 /* $Id: sph_blake.h 252 2011-06-07 17:55:14Z tp $ */
37 #ifndef SPH_BLAKE_H__
38 #define SPH_BLAKE_H__
39 
40 #ifdef __cplusplus
41 extern "C"{
42 #endif
43 
44 #include <stddef.h>
45 #include <crypto/sph_types.h>
46 
50 #define SPH_SIZE_blake224 224
51 
55 #define SPH_SIZE_blake256 256
56 
57 #if SPH_64
58 
62 #define SPH_SIZE_blake384 384
63 
67 #define SPH_SIZE_blake512 512
68 
69 #endif
70 
81 typedef struct {
82 #ifndef DOXYGEN_IGNORE
83  unsigned char buf[64]; /* first field, for alignment */
84  size_t ptr;
85  sph_u32 H[8];
86  sph_u32 S[4];
87  sph_u32 T0, T1;
88 #endif
90 
96 
102 
103 #if SPH_64
104 
115 typedef struct {
116 #ifndef DOXYGEN_IGNORE
117  unsigned char buf[128]; /* first field, for alignment */
118  size_t ptr;
119  sph_u64 H[8];
120  sph_u64 S[4];
121  sph_u64 T0, T1;
122 #endif
123 } sph_blake_big_context;
124 
129 typedef sph_blake_big_context sph_blake384_context;
130 
135 typedef sph_blake_big_context sph_blake512_context;
136 
137 #endif
138 
145 void sph_blake224_init(void *cc);
146 
155 void sph_blake224(void *cc, const void *data, size_t len);
156 
166 void sph_blake224_close(void *cc, void *dst);
167 
182  void *cc, unsigned ub, unsigned n, void *dst);
183 
190 void sph_blake256_init(void *cc);
191 
200 void sph_blake256(void *cc, const void *data, size_t len);
201 
211 void sph_blake256_close(void *cc, void *dst);
212 
227  void *cc, unsigned ub, unsigned n, void *dst);
228 
229 #if SPH_64
230 
237 void sph_blake384_init(void *cc);
238 
247 void sph_blake384(void *cc, const void *data, size_t len);
248 
258 void sph_blake384_close(void *cc, void *dst);
259 
273 void sph_blake384_addbits_and_close(
274  void *cc, unsigned ub, unsigned n, void *dst);
275 
282 void sph_blake512_init(void *cc);
283 
292 void sph_blake512(void *cc, const void *data, size_t len);
293 
303 void sph_blake512_close(void *cc, void *dst);
304 
318 void sph_blake512_addbits_and_close(
319  void *cc, unsigned ub, unsigned n, void *dst);
320 
321 #endif
322 
323 #ifdef __cplusplus
324 }
325 #endif
326 
327 #endif
void sph_blake224_close(void *cc, void *dst)
Terminate the current BLAKE-224 computation and output the result into the provided buffer...
Definition: blake.c:1014
#define H(x)
This structure is a context for BLAKE-224 and BLAKE-256 computations: it contains the intermediate va...
Definition: sph_blake.h:81
Basic type definitions.
void sph_blake256(void *cc, const void *data, size_t len)
Process some data bytes.
Definition: blake.c:1036
void sph_blake256_close(void *cc, void *dst)
Terminate the current BLAKE-256 computation and output the result into the provided buffer...
Definition: blake.c:1043
void sph_blake224(void *cc, const void *data, size_t len)
Process some data bytes.
Definition: blake.c:1007
#define S(x0, x1, x2, x3, cb, r)
Definition: jh.c:494
sph_blake_small_context sph_blake256_context
This structure is a context for BLAKE-256 computations.
Definition: sph_blake.h:101
unsigned long sph_u32
Definition: sph_types.h:870
sph_blake_small_context sph_blake224_context
This structure is a context for BLAKE-224 computations.
Definition: sph_blake.h:95
void sph_blake224_init(void *cc)
Initialize a BLAKE-224 context.
Definition: blake.c:1000
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 resul...
Definition: blake.c:1021
void sph_blake256_init(void *cc)
Initialize a BLAKE-256 context.
Definition: blake.c:1029
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 resul...
Definition: blake.c:1050
Released under the MIT license