1 /****************************************************************************** 2 * Filename: sw_poly1305-donna.h 3 * Revised: 2016-10-05 12:42:03 +0200 (Wed, 05 Oct 2016) 4 * Revision: 47308 5 ******************************************************************************/ 6 7 #ifndef POLY1305_DONNA_H 8 #define POLY1305_DONNA_H 9 10 #include <stddef.h> 11 12 typedef struct { 13 size_t aligner; 14 unsigned char opaque[136]; 15 } poly1305_context; 16 17 void poly1305_init(poly1305_context *ctx, const unsigned char key[32]); 18 void poly1305_update(poly1305_context *ctx, const unsigned char *m, size_t bytes); 19 void poly1305_finish(poly1305_context *ctx, unsigned char mac[16]); 20 void poly1305_auth(unsigned char mac[16], const unsigned char *m, size_t bytes, const unsigned char key[32]); 21 22 int poly1305_verify(const unsigned char mac1[16], const unsigned char mac2[16]); 23 int poly1305_power_on_self_test(void); 24 25 #endif /* POLY1305_DONNA_H */ 26