Better separation between crypto_auth[_verify] and the NIST-like API.
This commit is contained in:
parent
f379ab8766
commit
f740cb5968
@ -12,13 +12,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct crypto_auth_hmacsha256_state {
|
|
||||||
crypto_hash_sha256_state ictx;
|
|
||||||
crypto_hash_sha256_state octx;
|
|
||||||
} crypto_auth_hmacsha256_state;
|
|
||||||
SODIUM_EXPORT
|
|
||||||
size_t crypto_auth_hmacsha256_statebytes(void);
|
|
||||||
|
|
||||||
#define crypto_auth_hmacsha256_BYTES 32U
|
#define crypto_auth_hmacsha256_BYTES 32U
|
||||||
SODIUM_EXPORT
|
SODIUM_EXPORT
|
||||||
size_t crypto_auth_hmacsha256_bytes(void);
|
size_t crypto_auth_hmacsha256_bytes(void);
|
||||||
@ -39,6 +32,15 @@ int crypto_auth_hmacsha256_verify(const unsigned char *h,
|
|||||||
unsigned long long inlen,
|
unsigned long long inlen,
|
||||||
const unsigned char *k);
|
const unsigned char *k);
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
typedef struct crypto_auth_hmacsha256_state {
|
||||||
|
crypto_hash_sha256_state ictx;
|
||||||
|
crypto_hash_sha256_state octx;
|
||||||
|
} crypto_auth_hmacsha256_state;
|
||||||
|
SODIUM_EXPORT
|
||||||
|
size_t crypto_auth_hmacsha256_statebytes(void);
|
||||||
|
|
||||||
SODIUM_EXPORT
|
SODIUM_EXPORT
|
||||||
int crypto_auth_hmacsha256_init(crypto_auth_hmacsha256_state *state,
|
int crypto_auth_hmacsha256_init(crypto_auth_hmacsha256_state *state,
|
||||||
const unsigned char *key,
|
const unsigned char *key,
|
||||||
|
@ -12,13 +12,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct crypto_auth_hmacsha512_state {
|
|
||||||
crypto_hash_sha512_state ictx;
|
|
||||||
crypto_hash_sha512_state octx;
|
|
||||||
} crypto_auth_hmacsha512_state;
|
|
||||||
SODIUM_EXPORT
|
|
||||||
size_t crypto_auth_hmacsha512_statebytes(void);
|
|
||||||
|
|
||||||
#define crypto_auth_hmacsha512_BYTES 64U
|
#define crypto_auth_hmacsha512_BYTES 64U
|
||||||
SODIUM_EXPORT
|
SODIUM_EXPORT
|
||||||
size_t crypto_auth_hmacsha512_bytes(void);
|
size_t crypto_auth_hmacsha512_bytes(void);
|
||||||
@ -39,6 +32,15 @@ int crypto_auth_hmacsha512_verify(const unsigned char *h,
|
|||||||
unsigned long long inlen,
|
unsigned long long inlen,
|
||||||
const unsigned char *k);
|
const unsigned char *k);
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
typedef struct crypto_auth_hmacsha512_state {
|
||||||
|
crypto_hash_sha512_state ictx;
|
||||||
|
crypto_hash_sha512_state octx;
|
||||||
|
} crypto_auth_hmacsha512_state;
|
||||||
|
SODIUM_EXPORT
|
||||||
|
size_t crypto_auth_hmacsha512_statebytes(void);
|
||||||
|
|
||||||
SODIUM_EXPORT
|
SODIUM_EXPORT
|
||||||
int crypto_auth_hmacsha512_init(crypto_auth_hmacsha512_state *state,
|
int crypto_auth_hmacsha512_init(crypto_auth_hmacsha512_state *state,
|
||||||
const unsigned char *key,
|
const unsigned char *key,
|
||||||
|
@ -12,10 +12,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef crypto_auth_hmacsha512_state crypto_auth_hmacsha512256_state;
|
|
||||||
SODIUM_EXPORT
|
|
||||||
size_t crypto_auth_hmacsha512256_statebytes(void);
|
|
||||||
|
|
||||||
#define crypto_auth_hmacsha512256_BYTES 32U
|
#define crypto_auth_hmacsha512256_BYTES 32U
|
||||||
SODIUM_EXPORT
|
SODIUM_EXPORT
|
||||||
size_t crypto_auth_hmacsha512256_bytes(void);
|
size_t crypto_auth_hmacsha512256_bytes(void);
|
||||||
@ -34,6 +30,12 @@ int crypto_auth_hmacsha512256_verify(const unsigned char *h,
|
|||||||
unsigned long long inlen,
|
unsigned long long inlen,
|
||||||
const unsigned char *k);
|
const unsigned char *k);
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
typedef crypto_auth_hmacsha512_state crypto_auth_hmacsha512256_state;
|
||||||
|
SODIUM_EXPORT
|
||||||
|
size_t crypto_auth_hmacsha512256_statebytes(void);
|
||||||
|
|
||||||
SODIUM_EXPORT
|
SODIUM_EXPORT
|
||||||
int crypto_auth_hmacsha512256_init(crypto_auth_hmacsha512256_state *state,
|
int crypto_auth_hmacsha512256_init(crypto_auth_hmacsha512256_state *state,
|
||||||
const unsigned char *key,
|
const unsigned char *key,
|
||||||
|
Loading…
Reference in New Issue
Block a user