From 393aa1a229c2b4cdb84477d5d671e81190d35e0a Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 22 Apr 2013 22:15:19 -0700 Subject: [PATCH] crypto_box_curve25519xsalsa20poly1305_ref compat --- .../include/sodium/crypto_sign_ed25519.h | 1 - src/libsodium/sodium/compat.c | 71 +++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/src/libsodium/include/sodium/crypto_sign_ed25519.h b/src/libsodium/include/sodium/crypto_sign_ed25519.h index 50b3de8f..1d481a4d 100644 --- a/src/libsodium/include/sodium/crypto_sign_ed25519.h +++ b/src/libsodium/include/sodium/crypto_sign_ed25519.h @@ -11,7 +11,6 @@ extern "C" { #endif - SODIUM_EXPORT int crypto_sign_ed25519(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *); diff --git a/src/libsodium/sodium/compat.c b/src/libsodium/sodium/compat.c index 637d404b..6325824d 100644 --- a/src/libsodium/sodium/compat.c +++ b/src/libsodium/sodium/compat.c @@ -3,6 +3,10 @@ #include "crypto_auth_hmacsha512256.h" #include "export.h" +#ifdef __cplusplus +extern "C" { +#endif + #undef crypto_auth_hmacsha256_ref SODIUM_EXPORT int crypto_auth_hmacsha256_ref(unsigned char *out, const unsigned char *in, @@ -38,3 +42,70 @@ crypto_auth_hmacsha512256_ref_verify(const unsigned char *h, { return crypto_auth_hmacsha512256_verify(h, in, inlen, k); } + +#undef crypto_box_curve25519xsalsa20poly1305_ref_keypair +SODIUM_EXPORT int +crypto_box_curve25519xsalsa20poly1305_ref_keypair(unsigned char *pk, + unsigned char *sk) +{ + return crypto_box_curve25519xsalsa20poly1305_keypair(pk, sk); +} + +#undef crypto_box_curve25519xsalsa20poly1305_ref_beforenm +SODIUM_EXPORT int +crypto_box_curve25519xsalsa20poly1305_ref_beforenm(unsigned char *k, + const unsigned char *pk, + const unsigned char *sk) +{ + return crypto_box_curve25519xsalsa20poly1305_beforenm(k, pk, sk); +} + +#undef crypto_box_curve25519xsalsa20poly1305_ref_afternm +SODIUM_EXPORT int +crypto_box_curve25519xsalsa20poly1305_ref_afternm(unsigned char *c, + const unsigned char *m, + unsigned long long mlen, + const unsigned char *n, + const unsigned char *k) +{ + return crypto_box_curve25519xsalsa20poly1305_afternm(c, m, mlen, n, k); +} + +#undef crypto_box_curve25519xsalsa20poly1305_ref_open_afternm +SODIUM_EXPORT int +crypto_box_curve25519xsalsa20poly1305_ref_open_afternm(unsigned char *m, + const unsigned char *c, + unsigned long long clen, + const unsigned char *n, + const unsigned char *k) +{ + return crypto_box_curve25519xsalsa20poly1305_open_afternm(m, c, clen, n, k); +} + +#undef crypto_box_curve25519xsalsa20poly1305_ref +SODIUM_EXPORT int +crypto_box_curve25519xsalsa20poly1305_ref(unsigned char *c, + const unsigned char *m, + unsigned long long mlen, + const unsigned char *n, + const unsigned char *pk, + const unsigned char *sk) +{ + return crypto_box_curve25519xsalsa20poly1305(c, m, mlen, n, pk, sk); +} + +#undef crypto_box_curve25519xsalsa20poly1305_ref_open +SODIUM_EXPORT int +crypto_box_curve25519xsalsa20poly1305_ref_open(unsigned char *m, + const unsigned char *c, + unsigned long long clen, + const unsigned char *n, + const unsigned char *pk, + const unsigned char *sk) +{ + return crypto_box_curve25519xsalsa20poly1305_open(m, c, clen, n, pk, sk); +} + +#ifdef __cplusplus +} +#endif