2018-10-23 12:44:46 +00:00
|
|
|
#ifndef crypto_generichash_H
|
|
|
|
#define crypto_generichash_H
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
#include "crypto_generichash_blake2b.h"
|
|
|
|
#include "export.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2019-08-31 18:54:19 +00:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#pragma GCC diagnostic ignored "-Wlong-long"
|
|
|
|
#endif
|
|
|
|
extern "C"
|
|
|
|
{
|
2018-10-23 12:44:46 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define crypto_generichash_BYTES_MIN crypto_generichash_blake2b_BYTES_MIN
|
2019-08-31 18:54:19 +00:00
|
|
|
SODIUM_EXPORT
|
|
|
|
size_t
|
|
|
|
crypto_generichash_bytes_min(void);
|
2018-10-23 12:44:46 +00:00
|
|
|
|
|
|
|
#define crypto_generichash_BYTES_MAX crypto_generichash_blake2b_BYTES_MAX
|
2019-08-31 18:54:19 +00:00
|
|
|
SODIUM_EXPORT
|
|
|
|
size_t
|
|
|
|
crypto_generichash_bytes_max(void);
|
2018-10-23 12:44:46 +00:00
|
|
|
|
|
|
|
#define crypto_generichash_BYTES crypto_generichash_blake2b_BYTES
|
2019-08-31 18:54:19 +00:00
|
|
|
SODIUM_EXPORT
|
|
|
|
size_t
|
|
|
|
crypto_generichash_bytes(void);
|
2018-10-23 12:44:46 +00:00
|
|
|
|
|
|
|
#define crypto_generichash_KEYBYTES_MIN crypto_generichash_blake2b_KEYBYTES_MIN
|
2019-08-31 18:54:19 +00:00
|
|
|
SODIUM_EXPORT
|
|
|
|
size_t
|
|
|
|
crypto_generichash_keybytes_min(void);
|
2018-10-23 12:44:46 +00:00
|
|
|
|
|
|
|
#define crypto_generichash_KEYBYTES_MAX crypto_generichash_blake2b_KEYBYTES_MAX
|
2019-08-31 18:54:19 +00:00
|
|
|
SODIUM_EXPORT
|
|
|
|
size_t
|
|
|
|
crypto_generichash_keybytes_max(void);
|
2018-10-23 12:44:46 +00:00
|
|
|
|
|
|
|
#define crypto_generichash_KEYBYTES crypto_generichash_blake2b_KEYBYTES
|
2019-08-31 18:54:19 +00:00
|
|
|
SODIUM_EXPORT
|
|
|
|
size_t
|
|
|
|
crypto_generichash_keybytes(void);
|
2018-10-23 12:44:46 +00:00
|
|
|
|
|
|
|
#define crypto_generichash_PRIMITIVE "blake2b"
|
2019-08-31 18:54:19 +00:00
|
|
|
SODIUM_EXPORT
|
|
|
|
const char *
|
|
|
|
crypto_generichash_primitive(void);
|
|
|
|
|
|
|
|
typedef crypto_generichash_blake2b_state crypto_generichash_state;
|
|
|
|
|
|
|
|
SODIUM_EXPORT
|
|
|
|
size_t
|
|
|
|
crypto_generichash_statebytes(void);
|
|
|
|
|
|
|
|
SODIUM_EXPORT
|
|
|
|
int
|
|
|
|
crypto_generichash(unsigned char *out, size_t outlen, const unsigned char *in,
|
|
|
|
unsigned long long inlen, const unsigned char *key,
|
|
|
|
size_t keylen);
|
|
|
|
|
|
|
|
SODIUM_EXPORT
|
|
|
|
int
|
|
|
|
crypto_generichash_init(crypto_generichash_state *state,
|
|
|
|
const unsigned char *key, const size_t keylen,
|
|
|
|
const size_t outlen);
|
|
|
|
|
|
|
|
SODIUM_EXPORT
|
|
|
|
int
|
|
|
|
crypto_generichash_update(crypto_generichash_state *state,
|
|
|
|
const unsigned char *in, unsigned long long inlen);
|
|
|
|
|
|
|
|
SODIUM_EXPORT
|
|
|
|
int
|
|
|
|
crypto_generichash_final(crypto_generichash_state *state, unsigned char *out,
|
|
|
|
const size_t outlen);
|
|
|
|
|
|
|
|
SODIUM_EXPORT
|
|
|
|
void
|
|
|
|
crypto_generichash_keygen(unsigned char k[crypto_generichash_KEYBYTES]);
|
2018-10-23 12:44:46 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|