mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-26 11:47:13 +09:00
Start replacing macros with real functions. First candidate: crypto_auth
This commit is contained in:
@@ -31,6 +31,7 @@ libsodium_la_SOURCES = \
|
||||
crypto_verify/16/ref/verify_16.c \
|
||||
crypto_verify/32/ref/api.h \
|
||||
crypto_verify/32/ref/verify_32.c \
|
||||
crypto_auth/crypto_auth.c \
|
||||
crypto_auth/hmacsha256/ref/api.h \
|
||||
crypto_auth/hmacsha256/ref/hmac_hmacsha256.c \
|
||||
crypto_auth/hmacsha256/ref/verify_hmacsha256.c \
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
#include "crypto_auth.h"
|
||||
|
||||
int crypto_auth(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen, const unsigned char *k)
|
||||
{
|
||||
return crypto_auth_hmacsha512256(out, in, inlen, k);
|
||||
}
|
||||
|
||||
int crypto_auth_verify(const unsigned char *h, const unsigned char *in,
|
||||
unsigned long long inlen,const unsigned char *k)
|
||||
{
|
||||
return crypto_auth_hmacsha512256_verify(h, in, inlen, k);
|
||||
}
|
||||
@@ -3,10 +3,20 @@
|
||||
|
||||
#include "crypto_auth_hmacsha512256.h"
|
||||
|
||||
#define crypto_auth crypto_auth_hmacsha512256
|
||||
#define crypto_auth_verify crypto_auth_hmacsha512256_verify
|
||||
#define crypto_auth_BYTES crypto_auth_hmacsha512256_BYTES
|
||||
#define crypto_auth_KEYBYTES crypto_auth_hmacsha512256_KEYBYTES
|
||||
#define crypto_auth_PRIMITIVE "hmacsha512256"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int crypto_auth(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen, const unsigned char *k);
|
||||
|
||||
int crypto_auth_verify(const unsigned char *h, const unsigned char *in,
|
||||
unsigned long long inlen,const unsigned char *k);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user