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