Home | History | Annotate | Line # | Download | only in sodium
      1 #ifndef crypto_onetimeauth_H
      2 #define crypto_onetimeauth_H
      3 
      4 #include <stddef.h>
      5 
      6 #include "crypto_onetimeauth_poly1305.h"
      7 #include "export.h"
      8 
      9 #ifdef __cplusplus
     10 # ifdef __GNUC__
     11 #  pragma GCC diagnostic ignored "-Wlong-long"
     12 # endif
     13 extern "C" {
     14 #endif
     15 
     16 typedef crypto_onetimeauth_poly1305_state crypto_onetimeauth_state;
     17 
     18 SODIUM_EXPORT
     19 size_t  crypto_onetimeauth_statebytes(void);
     20 
     21 #define crypto_onetimeauth_BYTES crypto_onetimeauth_poly1305_BYTES
     22 SODIUM_EXPORT
     23 size_t  crypto_onetimeauth_bytes(void);
     24 
     25 #define crypto_onetimeauth_KEYBYTES crypto_onetimeauth_poly1305_KEYBYTES
     26 SODIUM_EXPORT
     27 size_t  crypto_onetimeauth_keybytes(void);
     28 
     29 #define crypto_onetimeauth_PRIMITIVE "poly1305"
     30 SODIUM_EXPORT
     31 const char *crypto_onetimeauth_primitive(void);
     32 
     33 SODIUM_EXPORT
     34 int crypto_onetimeauth(unsigned char *out, const unsigned char *in,
     35                        unsigned long long inlen, const unsigned char *k);
     36 
     37 SODIUM_EXPORT
     38 int crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in,
     39                               unsigned long long inlen, const unsigned char *k)
     40             __attribute__ ((warn_unused_result));
     41 
     42 SODIUM_EXPORT
     43 int crypto_onetimeauth_init(crypto_onetimeauth_state *state,
     44                             const unsigned char *key);
     45 
     46 SODIUM_EXPORT
     47 int crypto_onetimeauth_update(crypto_onetimeauth_state *state,
     48                               const unsigned char *in,
     49                               unsigned long long inlen);
     50 
     51 SODIUM_EXPORT
     52 int crypto_onetimeauth_final(crypto_onetimeauth_state *state,
     53                              unsigned char *out);
     54 
     55 SODIUM_EXPORT
     56 void crypto_onetimeauth_keygen(unsigned char k[crypto_onetimeauth_KEYBYTES]);
     57 
     58 #ifdef __cplusplus
     59 }
     60 #endif
     61 
     62 #endif
     63