Start a compat layer
This commit is contained in:
parent
1b0328610f
commit
cb7c294cb8
@ -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
|
||||
|
@ -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
|
||||
|
40
src/libsodium/sodium/compat.c
Normal file
40
src/libsodium/sodium/compat.c
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user