Home | History | Annotate | Line # | Download | only in sodium
      1 #ifndef crypto_onetimeauth_poly1305_H
      2 #define crypto_onetimeauth_poly1305_H
      3 
      4 #ifdef __cplusplus
      5 # ifdef __GNUC__
      6 #  pragma GCC diagnostic ignored "-Wlong-long"
      7 # endif
      8 extern "C" {
      9 #endif
     10 
     11 #include <stdint.h>
     12 #include <stdio.h>
     13 #include <stdlib.h>
     14 
     15 #include <sys/types.h>
     16 
     17 #include "export.h"
     18 
     19 typedef struct CRYPTO_ALIGN(16) crypto_onetimeauth_poly1305_state {
     20     unsigned char opaque[256];
     21 } crypto_onetimeauth_poly1305_state;
     22 
     23 SODIUM_EXPORT
     24 size_t crypto_onetimeauth_poly1305_statebytes(void);
     25 
     26 #define crypto_onetimeauth_poly1305_BYTES 16U
     27 SODIUM_EXPORT
     28 size_t crypto_onetimeauth_poly1305_bytes(void);
     29 
     30 #define crypto_onetimeauth_poly1305_KEYBYTES 32U
     31 SODIUM_EXPORT
     32 size_t crypto_onetimeauth_poly1305_keybytes(void);
     33 
     34 SODIUM_EXPORT
     35 int crypto_onetimeauth_poly1305(unsigned char *out,
     36                                 const unsigned char *in,
     37                                 unsigned long long inlen,
     38                                 const unsigned char *k);
     39 
     40 SODIUM_EXPORT
     41 int crypto_onetimeauth_poly1305_verify(const unsigned char *h,
     42                                        const unsigned char *in,
     43                                        unsigned long long inlen,
     44                                        const unsigned char *k)
     45             __attribute__ ((warn_unused_result));
     46 
     47 SODIUM_EXPORT
     48 int crypto_onetimeauth_poly1305_init(crypto_onetimeauth_poly1305_state *state,
     49                                      const unsigned char *key);
     50 
     51 SODIUM_EXPORT
     52 int crypto_onetimeauth_poly1305_update(crypto_onetimeauth_poly1305_state *state,
     53                                        const unsigned char *in,
     54                                        unsigned long long inlen);
     55 
     56 SODIUM_EXPORT
     57 int crypto_onetimeauth_poly1305_final(crypto_onetimeauth_poly1305_state *state,
     58                                       unsigned char *out);
     59 
     60 SODIUM_EXPORT
     61 void crypto_onetimeauth_poly1305_keygen(unsigned char k[crypto_onetimeauth_poly1305_KEYBYTES]);
     62 
     63 #ifdef __cplusplus
     64 }
     65 #endif
     66 
     67 #endif
     68