X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=hashfunction_descriptor.h;fp=hashfunction_descriptor.h;h=8b5faedb0cfb4ac87a6deacc178629bbd150d750;hb=2dc047a070be7f0d64f4d4e7f4296a9650af07dc;hp=e1347dcaccbc54015e1dc71ea111706808263dd7;hpb=e08695bd5905f1306c16d617d044d97649b5e2ae;p=avr-crypto-lib.git diff --git a/hashfunction_descriptor.h b/hashfunction_descriptor.h index e1347dc..8b5faed 100644 --- a/hashfunction_descriptor.h +++ b/hashfunction_descriptor.h @@ -21,18 +21,31 @@ typedef void(*hf_mem_fpt)(void*, const void*, uint32_t); #define HFDESC_TYPE_HASHFUNCTION 0x02 typedef struct { + /** typefield, always 2 for hash functions */ uint8_t type; /* 2 == hashfunction */ + /** flags, currently unused should be set to zero */ uint8_t flags; + /** name, flash pointer to the name string */ PGM_P name; + /** ctxsize_B, size of the hash context in bytes */ uint16_t ctxsize_B; + /** blocksize_b, size of an input block in bits */ uint16_t blocksize_b; + /** hashsize_b, size of the output hash value in bits */ uint16_t hashsize_b; - + /** init, function pointer to the algorithms init function */ hf_init_fpt init; + /** nextBlock, function pointer to the algorithms nextBlock function */ hf_nextBlock_fpt nextBlock; + /** lastBlock, function pointer to the algorithms lastBlock function */ hf_lastBlock_fpt lastBlock; + /** ctx2hash, function pointer to the algorithms ctx2hash function */ hf_ctx2hash_fpt ctx2hash; + /** free, function pointer to the algorithms free function or NULL if + * there is no such function */ hf_free_fpt free; + /** mem, function pointer to a function which hashes a message in RAM + * completely or NULL if there is no such function */ hf_mem_fpt mem; } hfdesc_t; /* blockcipher descriptor type */