poly1305_donna.h 680 B

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