Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

sph_jh.h
Go to the documentation of this file.
1 /* $Id: sph_jh.h 216 2010-06-08 09:46:57Z tp $ */
36 #ifndef SPH_JH_H__
37 #define SPH_JH_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_jh224 224
50 
54 #define SPH_SIZE_jh256 256
55 
59 #define SPH_SIZE_jh384 384
60 
64 #define SPH_SIZE_jh512 512
65 
76 typedef struct {
77 #ifndef DOXYGEN_IGNORE
78  unsigned char buf[64]; /* first field, for alignment */
79  size_t ptr;
80  union {
81 #if SPH_64
82  sph_u64 wide[16];
83 #endif
84  sph_u32 narrow[32];
85  } H;
86 #if SPH_64
87  sph_u64 block_count;
88 #else
89  sph_u32 block_count_high, block_count_low;
90 #endif
91 #endif
93 
98 
103 
108 
113 
120 void sph_jh224_init(void *cc);
121 
130 void sph_jh224(void *cc, const void *data, size_t len);
131 
141 void sph_jh224_close(void *cc, void *dst);
142 
157  void *cc, unsigned ub, unsigned n, void *dst);
158 
165 void sph_jh256_init(void *cc);
166 
175 void sph_jh256(void *cc, const void *data, size_t len);
176 
186 void sph_jh256_close(void *cc, void *dst);
187 
202  void *cc, unsigned ub, unsigned n, void *dst);
203 
210 void sph_jh384_init(void *cc);
211 
220 void sph_jh384(void *cc, const void *data, size_t len);
221 
231 void sph_jh384_close(void *cc, void *dst);
232 
247  void *cc, unsigned ub, unsigned n, void *dst);
248 
255 void sph_jh512_init(void *cc);
256 
265 void sph_jh512(void *cc, const void *data, size_t len);
266 
276 void sph_jh512_close(void *cc, void *dst);
277 
292  void *cc, unsigned ub, unsigned n, void *dst);
293 
294 #ifdef __cplusplus
295 }
296 #endif
297 
298 #endif
void sph_jh224_close(void *cc, void *dst)
Terminate the current JH-224 computation and output the result into the provided buffer.
Definition: jh.c:1018
void sph_jh256_init(void *cc)
Initialize a JH-256 context.
Definition: jh.c:1032
#define H(x)
void sph_jh512_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: jh.c:1109
void sph_jh224_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: jh.c:1025
Basic type definitions.
void sph_jh256_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: jh.c:1053
sph_jh_context sph_jh512_context
Type for a JH-512 context (identical to the common context).
Definition: sph_jh.h:112
void sph_jh224(void *cc, const void *data, size_t len)
Process some data bytes.
Definition: jh.c:1011
void sph_jh512_init(void *cc)
Initialize a JH-512 context.
Definition: jh.c:1088
void sph_jh256_close(void *cc, void *dst)
Terminate the current JH-256 computation and output the result into the provided buffer.
Definition: jh.c:1046
sph_jh_context sph_jh224_context
Type for a JH-224 context (identical to the common context).
Definition: sph_jh.h:97
sph_jh_context sph_jh384_context
Type for a JH-384 context (identical to the common context).
Definition: sph_jh.h:107
void sph_jh384(void *cc, const void *data, size_t len)
Process some data bytes.
Definition: jh.c:1067
void sph_jh512(void *cc, const void *data, size_t len)
Process some data bytes.
Definition: jh.c:1095
void sph_jh384_close(void *cc, void *dst)
Terminate the current JH-384 computation and output the result into the provided buffer.
Definition: jh.c:1074
void sph_jh224_init(void *cc)
Initialize a JH-224 context.
Definition: jh.c:1004
size_t ptr
Definition: sph_jh.h:79
unsigned long sph_u32
Definition: sph_types.h:870
sph_jh_context sph_jh256_context
Type for a JH-256 context (identical to the common context).
Definition: sph_jh.h:102
void sph_jh256(void *cc, const void *data, size_t len)
Process some data bytes.
Definition: jh.c:1039
This structure is a context for JH computations: it contains the intermediate values and some data fr...
Definition: sph_jh.h:76
void sph_jh384_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: jh.c:1081
sph_u32 block_count_low
Definition: sph_jh.h:89
void sph_jh512_close(void *cc, void *dst)
Terminate the current JH-512 computation and output the result into the provided buffer.
Definition: jh.c:1102
void sph_jh384_init(void *cc)
Initialize a JH-384 context.
Definition: jh.c:1060
Released under the MIT license