Raven Core  3.0.0
P2P Digital Currency
sph_hamsi.h
Go to the documentation of this file.
1 /* $Id: sph_hamsi.h 216 2010-06-08 09:46:57Z tp $ */
35 #ifndef SPH_HAMSI_H__
36 #define SPH_HAMSI_H__
37 
38 #include <stddef.h>
39 #include "sph_types.h"
40 
41 #ifdef __cplusplus
42 extern "C"{
43 #endif
44 
48 #define SPH_SIZE_hamsi224 224
49 
53 #define SPH_SIZE_hamsi256 256
54 
58 #define SPH_SIZE_hamsi384 384
59 
63 #define SPH_SIZE_hamsi512 512
64 
75 typedef struct {
76 #ifndef DOXYGEN_IGNORE
77  unsigned char partial[4];
78  size_t partial_len;
79  sph_u32 h[8];
80 #if SPH_64
81  sph_u64 count;
82 #else
83  sph_u32 count_high, count_low;
84 #endif
85 #endif
87 
93 
99 
110 typedef struct {
111 #ifndef DOXYGEN_IGNORE
112  unsigned char partial[8];
113  size_t partial_len;
114  sph_u32 h[16];
115 #if SPH_64
116  sph_u64 count;
117 #else
118  sph_u32 count_high, count_low;
119 #endif
120 #endif
122 
128 
134 
141 void sph_hamsi224_init(void *cc);
142 
151 void sph_hamsi224(void *cc, const void *data, size_t len);
152 
162 void sph_hamsi224_close(void *cc, void *dst);
163 
178  void *cc, unsigned ub, unsigned n, void *dst);
179 
186 void sph_hamsi256_init(void *cc);
187 
196 void sph_hamsi256(void *cc, const void *data, size_t len);
197 
207 void sph_hamsi256_close(void *cc, void *dst);
208 
223  void *cc, unsigned ub, unsigned n, void *dst);
224 
231 void sph_hamsi384_init(void *cc);
232 
241 void sph_hamsi384(void *cc, const void *data, size_t len);
242 
252 void sph_hamsi384_close(void *cc, void *dst);
253 
268  void *cc, unsigned ub, unsigned n, void *dst);
269 
276 void sph_hamsi512_init(void *cc);
277 
286 void sph_hamsi512(void *cc, const void *data, size_t len);
287 
297 void sph_hamsi512_close(void *cc, void *dst);
298 
313  void *cc, unsigned ub, unsigned n, void *dst);
314 
315 
316 
317 #ifdef __cplusplus
318 }
319 #endif
320 
321 #endif
void sph_hamsi224_init(void *cc)
Initialize a Hamsi-224 context.
Definition: sph_hamsi.c:747
void sph_hamsi384_close(void *cc, void *dst)
Terminate the current Hamsi-384 computation and output the result into the provided buffer...
Definition: sph_hamsi.c:821
void sph_hamsi384_init(void *cc)
Initialize a Hamsi-384 context.
Definition: sph_hamsi.c:807
Basic type definitions.
void sph_hamsi512_close(void *cc, void *dst)
Terminate the current Hamsi-512 computation and output the result into the provided buffer...
Definition: sph_hamsi.c:851
void sph_hamsi512_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: sph_hamsi.c:859
sph_hamsi_big_context sph_hamsi384_context
This structure is a context for Hamsi-384 computations.
Definition: sph_hamsi.h:127
void sph_hamsi256_init(void *cc)
Initialize a Hamsi-256 context.
Definition: sph_hamsi.c:777
void sph_hamsi224(void *cc, const void *data, size_t len)
Process some data bytes.
Definition: sph_hamsi.c:754
void sph_hamsi224_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: sph_hamsi.c:769
sph_hamsi_big_context sph_hamsi512_context
This structure is a context for Hamsi-512 computations.
Definition: sph_hamsi.h:133
This structure is a context for Hamsi-384 and Hamsi-512 computations: it contains the intermediate va...
Definition: sph_hamsi.h:110
void sph_hamsi256_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: sph_hamsi.c:799
sph_hamsi_small_context sph_hamsi224_context
This structure is a context for Hamsi-224 computations.
Definition: sph_hamsi.h:92
void sph_hamsi512(void *cc, const void *data, size_t len)
Process some data bytes.
Definition: sph_hamsi.c:844
sph_hamsi_small_context sph_hamsi256_context
This structure is a context for Hamsi-256 computations.
Definition: sph_hamsi.h:98
void sph_hamsi224_close(void *cc, void *dst)
Terminate the current Hamsi-224 computation and output the result into the provided buffer...
Definition: sph_hamsi.c:761
void sph_hamsi512_init(void *cc)
Initialize a Hamsi-512 context.
Definition: sph_hamsi.c:837
void sph_hamsi384(void *cc, const void *data, size_t len)
Process some data bytes.
Definition: sph_hamsi.c:814
void sph_hamsi384_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: sph_hamsi.c:829
unsigned long sph_u32
Definition: sph_types.h:870
This structure is a context for Hamsi-224 and Hamsi-256 computations: it contains the intermediate va...
Definition: sph_hamsi.h:75
void sph_hamsi256(void *cc, const void *data, size_t len)
Process some data bytes.
Definition: sph_hamsi.c:784
void sph_hamsi256_close(void *cc, void *dst)
Terminate the current Hamsi-256 computation and output the result into the provided buffer...
Definition: sph_hamsi.c:791