gnunet-android

GNUnet for Android
Log | Files | Refs | README

crypto_onetimeauth_poly1305.h (2198B)


      1 #ifndef crypto_onetimeauth_poly1305_H
      2 #define crypto_onetimeauth_poly1305_H
      3 
      4 #include <stdint.h>
      5 #include <stdio.h>
      6 #include <stdlib.h>
      7 
      8 #include <sys/types.h>
      9 
     10 #include "export.h"
     11 
     12 #ifdef __cplusplus
     13 # ifdef __GNUC__
     14 #  pragma GCC diagnostic ignored "-Wlong-long"
     15 # endif
     16 extern "C" {
     17 #endif
     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             __attribute__ ((nonnull(1, 4)));
     40 
     41 SODIUM_EXPORT
     42 int crypto_onetimeauth_poly1305_verify(const unsigned char *h,
     43                                        const unsigned char *in,
     44                                        unsigned long long inlen,
     45                                        const unsigned char *k)
     46             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
     47 
     48 SODIUM_EXPORT
     49 int crypto_onetimeauth_poly1305_init(crypto_onetimeauth_poly1305_state *state,
     50                                      const unsigned char *key)
     51             __attribute__ ((nonnull));
     52 
     53 SODIUM_EXPORT
     54 int crypto_onetimeauth_poly1305_update(crypto_onetimeauth_poly1305_state *state,
     55                                        const unsigned char *in,
     56                                        unsigned long long inlen)
     57             __attribute__ ((nonnull(1)));
     58 
     59 SODIUM_EXPORT
     60 int crypto_onetimeauth_poly1305_final(crypto_onetimeauth_poly1305_state *state,
     61                                       unsigned char *out)
     62             __attribute__ ((nonnull));
     63 
     64 SODIUM_EXPORT
     65 void crypto_onetimeauth_poly1305_keygen(unsigned char k[crypto_onetimeauth_poly1305_KEYBYTES])
     66             __attribute__ ((nonnull));
     67 
     68 #ifdef __cplusplus
     69 }
     70 #endif
     71 
     72 #endif