Start a compat layer

This commit is contained in:
Frank Denis 2013-04-22 22:03:16 -07:00
parent 1b0328610f
commit cb7c294cb8
3 changed files with 42 additions and 1 deletions

View File

@ -152,6 +152,7 @@ libsodium_la_SOURCES = \
randombytes/randombytes.c \
randombytes/salsa20/randombytes_salsa20_random.c \
randombytes/sysrandom/randombytes_sysrandom.c \
sodium/compat.c \
sodium/core.c \
sodium/utils.c \
sodium/version.c

View File

@ -28,7 +28,7 @@ int crypto_auth(unsigned char *out, const unsigned char *in,
SODIUM_EXPORT
int crypto_auth_verify(const unsigned char *h, const unsigned char *in,
unsigned long long inlen,const unsigned char *k);
unsigned long long inlen, const unsigned char *k);
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,40 @@
#include "crypto_auth_hmacsha256.h"
#include "crypto_auth_hmacsha512256.h"
#include "export.h"
#undef crypto_auth_hmacsha256_ref
SODIUM_EXPORT int
crypto_auth_hmacsha256_ref(unsigned char *out, const unsigned char *in,
unsigned long long inlen, const unsigned char *k)
{
return crypto_auth_hmacsha256(out, in, inlen, k);
}
#undef crypto_auth_hmacsha256_ref_verify
SODIUM_EXPORT int
crypto_auth_hmacsha256_ref_verify(const unsigned char *h,
const unsigned char *in,
unsigned long long inlen,
const unsigned char *k)
{
return crypto_auth_hmacsha256_verify(h, in, inlen, k);
}
#undef crypto_auth_hmacsha512256_ref
SODIUM_EXPORT int
crypto_auth_hmacsha512256_ref(unsigned char *out, const unsigned char *in,
unsigned long long inlen, const unsigned char *k)
{
return crypto_auth_hmacsha512256(out, in, inlen, k);
}
#undef crypto_auth_hmacsha512256_ref_verify
SODIUM_EXPORT int
crypto_auth_hmacsha512256_ref_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);
}