1 /* hashfunction_descriptor.h */
3 #ifndef HASHFUNCTION_DESCRIPTOR_H_
4 #define HASHFUNCTION_DESCRIPTOR_H_
6 #include <avr/pgmspace.h>
10 typedef void(*void_fpt)(void);
13 typedef void(*hf_init_fpt)(void*);
14 typedef void(*hf_nextBlock_fpt)(void*, const void*);
15 typedef void(*hf_lastBlock_fpt)(void*, const void*, uint16_t);
16 typedef void(*hf_ctx2hash_fpt)(void*, void*);
17 typedef void(*hf_free_fpt)(void*);
18 typedef void(*hf_mem_fpt)(void*, const void*, uint32_t);
21 #define HFDESC_TYPE_HASHFUNCTION 0x02
24 /** typefield, always 2 for hash functions */
25 uint8_t type; /* 2 == hashfunction */
26 /** flags, currently unused should be set to zero */
28 /** name, flash pointer to the name string */
30 /** ctxsize_B, size of the hash context in bytes */
32 /** blocksize_b, size of an input block in bits */
34 /** hashsize_b, size of the output hash value in bits */
36 /** init, function pointer to the algorithms init function */
38 /** nextBlock, function pointer to the algorithms nextBlock function */
39 hf_nextBlock_fpt nextBlock;
40 /** lastBlock, function pointer to the algorithms lastBlock function */
41 hf_lastBlock_fpt lastBlock;
42 /** ctx2hash, function pointer to the algorithms ctx2hash function */
43 hf_ctx2hash_fpt ctx2hash;
44 /** free, function pointer to the algorithms free function or NULL if
45 * there is no such function */
47 /** mem, function pointer to a function which hashes a message in RAM
48 * completely or NULL if there is no such function */
50 } hfdesc_t; /* hashfunction descriptor type */
57 #endif /* HASHFUNCTION_DESCRIPTOR_H_ */