diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am index b5a70de5..31774b65 100644 --- a/src/libsodium/Makefile.am +++ b/src/libsodium/Makefile.am @@ -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 diff --git a/src/libsodium/include/sodium/crypto_auth.h b/src/libsodium/include/sodium/crypto_auth.h index dec3518c..fbd3d7e5 100644 --- a/src/libsodium/include/sodium/crypto_auth.h +++ b/src/libsodium/include/sodium/crypto_auth.h @@ -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 diff --git a/src/libsodium/sodium/compat.c b/src/libsodium/sodium/compat.c new file mode 100644 index 00000000..637d404b --- /dev/null +++ b/src/libsodium/sodium/compat.c @@ -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); +}