1 /* hashfunction_descriptor.h */
3 #ifndef HASHFUNCTION_DESCRIPTOR_H_
4 #define HASHFUNCTION_DESCRIPTOR_H_
9 typedef void(*void_fpt)(void);
12 typedef void(*hf_init_fpt)(void*);
13 typedef void(*hf_nextBlock_fpt)(void*, const void*);
14 typedef void(*hf_lastBlock_fpt)(void*, const void*, uint16_t);
15 typedef void(*hf_ctx2hash_fpt)(void*, void*);
16 typedef void(*hf_free_fpt)(void*);
17 typedef void(*hf_mem_fpt)(void*, const void*, uint32_t);
20 #define HFDESC_TYPE_HASHFUNCTION 0x02
23 /** typefield, always 2 for hash functions */
24 uint8_t type; /* 2 == hashfunction */
25 /** flags, currently unused should be set to zero */
27 /** name, flash pointer to the name string */
29 /** ctxsize_B, size of the hash context in bytes */
31 /** blocksize_b, size of an input block in bits */
33 /** hashsize_b, size of the output hash value in bits */
35 /** init, function pointer to the algorithms init function */
37 /** nextBlock, function pointer to the algorithms nextBlock function */
38 hf_nextBlock_fpt nextBlock;
39 /** lastBlock, function pointer to the algorithms lastBlock function */
40 hf_lastBlock_fpt lastBlock;
41 /** ctx2hash, function pointer to the algorithms ctx2hash function */
42 hf_ctx2hash_fpt ctx2hash;
43 /** free, function pointer to the algorithms free function or NULL if
44 * there is no such function */
46 /** mem, function pointer to a function which hashes a message in RAM
47 * completely or NULL if there is no such function */
49 } hfdesc_t; /* hashfunction descriptor type */
56 #endif /* HASHFUNCTION_DESCRIPTOR_H_ */