Start replacing macros with real functions. First candidate: crypto_auth

This commit is contained in:
Frank Denis
2013-04-21 17:32:07 -07:00
parent 220ad48353
commit 8a5165bf06
3 changed files with 27 additions and 2 deletions
+1
View File
@@ -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 \
+14
View File
@@ -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);
}
+12 -2
View File
@@ -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