1#ifndef crypto_generichash_H 2#define crypto_generichash_H 3 4#include <stddef.h> 5 6#include "crypto_generichash_blake2b.h" 7#include "export.h" 8 9#ifdef __cplusplus 10# ifdef __GNUC__ 11# pragma GCC diagnostic ignored "-Wlong-long" 12# endif 13extern "C" { 14#endif 15 16#define crypto_generichash_BYTES_MIN crypto_generichash_blake2b_BYTES_MIN 17SODIUM_EXPORT 18size_t crypto_generichash_bytes_min(void); 19 20#define crypto_generichash_BYTES_MAX crypto_generichash_blake2b_BYTES_MAX 21SODIUM_EXPORT 22size_t crypto_generichash_bytes_max(void); 23 24#define crypto_generichash_BYTES crypto_generichash_blake2b_BYTES 25SODIUM_EXPORT 26size_t crypto_generichash_bytes(void); 27 28#define crypto_generichash_KEYBYTES_MIN crypto_generichash_blake2b_KEYBYTES_MIN 29SODIUM_EXPORT 30size_t crypto_generichash_keybytes_min(void); 31 32#define crypto_generichash_KEYBYTES_MAX crypto_generichash_blake2b_KEYBYTES_MAX 33SODIUM_EXPORT 34size_t crypto_generichash_keybytes_max(void); 35 36#define crypto_generichash_KEYBYTES crypto_generichash_blake2b_KEYBYTES 37SODIUM_EXPORT 38size_t crypto_generichash_keybytes(void); 39 40#define crypto_generichash_PRIMITIVE "blake2b" 41SODIUM_EXPORT 42const char *crypto_generichash_primitive(void); 43 44typedef crypto_generichash_blake2b_state crypto_generichash_state; 45 46SODIUM_EXPORT 47size_t crypto_generichash_statebytes(void); 48 49SODIUM_EXPORT 50int crypto_generichash(unsigned char *out, size_t outlen, 51 const unsigned char *in, unsigned long long inlen, 52 const unsigned char *key, size_t keylen); 53 54SODIUM_EXPORT 55int crypto_generichash_init(crypto_generichash_state *state, 56 const unsigned char *key, 57 const size_t keylen, const size_t outlen); 58 59SODIUM_EXPORT 60int crypto_generichash_update(crypto_generichash_state *state, 61 const unsigned char *in, 62 unsigned long long inlen); 63 64SODIUM_EXPORT 65int crypto_generichash_final(crypto_generichash_state *state, 66 unsigned char *out, const size_t outlen); 67 68SODIUM_EXPORT 69void crypto_generichash_keygen(unsigned char k[crypto_generichash_KEYBYTES]); 70 71#ifdef __cplusplus 72} 73#endif 74 75#endif 76