BeRTOS
|
00001 00048 #ifndef ALGO_MD2_H 00049 #define ALGO_MD2_H 00050 00051 #include "cfg/cfg_md2.h" 00052 #include <cfg/compiler.h> 00053 00054 #define NUM_COMPUTE_ROUNDS 18 ///< Number of compute rounds. 00055 #define COMPUTE_ARRAY_LEN CONFIG_MD2_BLOCK_LEN * 3 ///< Lenght of compute array. 00056 #define MD2_DIGEST_LEN CONFIG_MD2_BLOCK_LEN 00057 00060 typedef struct Md2Context 00061 { 00062 uint8_t buffer[CONFIG_MD2_BLOCK_LEN]; 00063 uint8_t state[CONFIG_MD2_BLOCK_LEN]; 00064 uint8_t checksum[CONFIG_MD2_BLOCK_LEN]; 00065 size_t counter; 00066 00067 } Md2Context; 00068 00069 void md2_init(Md2Context *context); 00070 void md2_update(Md2Context *context, const void *block_in, size_t block_len); 00071 uint8_t *md2_end(Md2Context *context); 00072 bool md2_test(void); 00073 00074 #endif /* ALGO_MD2_H */