Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

sph_bmw.h
Go to the documentation of this file.
1 /* $Id: sph_bmw.h 216 2010-06-08 09:46:57Z tp $ */
36 #ifndef SPH_BMW_H__
37 #define SPH_BMW_H__
38 
39 #ifdef __cplusplus
40 extern "C"{
41 #endif
42 
43 #include <stddef.h>
44 #include <crypto/sph_types.h>
45 
49 #define SPH_SIZE_bmw224 224
50 
54 #define SPH_SIZE_bmw256 256
55 
56 #if SPH_64
57 
61 #define SPH_SIZE_bmw384 384
62 
66 #define SPH_SIZE_bmw512 512
67 
68 #endif
69 
80 typedef struct {
81 #ifndef DOXYGEN_IGNORE
82  unsigned char buf[64]; /* first field, for alignment */
83  size_t ptr;
84  sph_u32 H[16];
85 #if SPH_64
86  sph_u64 bit_count;
87 #else
88  sph_u32 bit_count_high, bit_count_low;
89 #endif
90 #endif
92 
98 
104 
105 #if SPH_64
106 
117 typedef struct {
118 #ifndef DOXYGEN_IGNORE
119  unsigned char buf[128]; /* first field, for alignment */
120  size_t ptr;
121  sph_u64 H[16];
122  sph_u64 bit_count;
123 #endif
124 } sph_bmw_big_context;
125 
130 typedef sph_bmw_big_context sph_bmw384_context;
131 
136 typedef sph_bmw_big_context sph_bmw512_context;
137 
138 #endif
139 
146 void sph_bmw224_init(void *cc);
147 
156 void sph_bmw224(void *cc, const void *data, size_t len);
157 
167 void sph_bmw224_close(void *cc, void *dst);
168 
183  void *cc, unsigned ub, unsigned n, void *dst);
184 
191 void sph_bmw256_init(void *cc);
192 
201 void sph_bmw256(void *cc, const void *data, size_t len);
202 
212 void sph_bmw256_close(void *cc, void *dst);
213 
228  void *cc, unsigned ub, unsigned n, void *dst);
229 
230 #if SPH_64
231 
238 void sph_bmw384_init(void *cc);
239 
248 void sph_bmw384(void *cc, const void *data, size_t len);
249 
259 void sph_bmw384_close(void *cc, void *dst);
260 
274 void sph_bmw384_addbits_and_close(
275  void *cc, unsigned ub, unsigned n, void *dst);
276 
283 void sph_bmw512_init(void *cc);
284 
293 void sph_bmw512(void *cc, const void *data, size_t len);
294 
304 void sph_bmw512_close(void *cc, void *dst);
305 
319 void sph_bmw512_addbits_and_close(
320  void *cc, unsigned ub, unsigned n, void *dst);
321 
322 #endif
323 
324 #ifdef __cplusplus
325 }
326 #endif
327 
328 #endif
#define H(x)
Basic type definitions.
sph_bmw_small_context sph_bmw256_context
This structure is a context for BMW-256 computations.
Definition: sph_bmw.h:103
void sph_bmw224_close(void *cc, void *dst)
Terminate the current BMW-224 computation and output the result into the provided buffer...
Definition: bmw.c:859
void sph_bmw256_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: bmw.c:895
void sph_bmw224(void *cc, const void *data, size_t len)
Process some data bytes.
Definition: bmw.c:852
void sph_bmw224_init(void *cc)
Initialize a BMW-224 context.
Definition: bmw.c:845
void sph_bmw224_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: bmw.c:866
void sph_bmw256(void *cc, const void *data, size_t len)
Process some data bytes.
Definition: bmw.c:881
void sph_bmw256_close(void *cc, void *dst)
Terminate the current BMW-256 computation and output the result into the provided buffer...
Definition: bmw.c:888
void sph_bmw256_init(void *cc)
Initialize a BMW-256 context.
Definition: bmw.c:874
unsigned long sph_u32
Definition: sph_types.h:870
sph_bmw_small_context sph_bmw224_context
This structure is a context for BMW-224 computations.
Definition: sph_bmw.h:97
This structure is a context for BMW-224 and BMW-256 computations: it contains the intermediate values...
Definition: sph_bmw.h:80
sph_u32 bit_count_low
Definition: sph_bmw.h:88
Released under the MIT license