diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am index 2e693db3..af829675 100644 --- a/src/libsodium/Makefile.am +++ b/src/libsodium/Makefile.am @@ -53,7 +53,6 @@ libsodium_la_SOURCES = \ crypto_onetimeauth/poly1305/onetimeauth_poly1305.c \ crypto_onetimeauth/poly1305/onetimeauth_poly1305_api.c \ crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c \ - crypto_onetimeauth/poly1305/donna/api.h \ crypto_onetimeauth/poly1305/donna/poly1305_donna.h \ crypto_onetimeauth/poly1305/donna/poly1305_donna32.h \ crypto_onetimeauth/poly1305/donna/poly1305_donna64.h \ diff --git a/src/libsodium/crypto_onetimeauth/poly1305/donna/api.h b/src/libsodium/crypto_onetimeauth/poly1305/donna/api.h deleted file mode 100644 index 43abd4a4..00000000 --- a/src/libsodium/crypto_onetimeauth/poly1305/donna/api.h +++ /dev/null @@ -1,8 +0,0 @@ - -#include "crypto_onetimeauth_poly1305.h" - -#define crypto_onetimeauth_poly1305_implementation_name \ - crypto_onetimeauth_poly1305_donna_implementation_name - -#define crypto_onetimeauth crypto_onetimeauth_poly1305_donna -#define crypto_onetimeauth_verify crypto_onetimeauth_poly1305_donna_verify diff --git a/src/libsodium/crypto_onetimeauth/poly1305/donna/auth_poly1305_donna.c b/src/libsodium/crypto_onetimeauth/poly1305/donna/auth_poly1305_donna.c index 304e7abd..76c801db 100644 --- a/src/libsodium/crypto_onetimeauth/poly1305/donna/auth_poly1305_donna.c +++ b/src/libsodium/crypto_onetimeauth/poly1305/donna/auth_poly1305_donna.c @@ -1,10 +1,6 @@ -#include "api.h" #include "utils.h" - -#include "crypto_onetimeauth_poly1305_donna.h" #include "poly1305_donna.h" - #ifdef HAVE_TI_MODE # include "poly1305_donna64.h" #else @@ -50,8 +46,9 @@ poly1305_update(poly1305_context *ctx, const unsigned char *m, } int -crypto_onetimeauth(unsigned char *out, const unsigned char *m, - unsigned long long inlen, const unsigned char *key) +crypto_onetimeauth_poly1305_donna(unsigned char *out, const unsigned char *m, + unsigned long long inlen, + const unsigned char *key) { poly1305_context ctx; poly1305_init(&ctx, key); @@ -62,14 +59,14 @@ crypto_onetimeauth(unsigned char *out, const unsigned char *m, } const char * -crypto_onetimeauth_poly1305_implementation_name(void) +crypto_onetimeauth_poly1305_donna_implementation_name(void) { return POLY1305_IMPLEMENTATION_NAME; } struct crypto_onetimeauth_poly1305_implementation crypto_onetimeauth_poly1305_donna_implementation = { - _SODIUM_C99(.implementation_name =) crypto_onetimeauth_poly1305_implementation_name, - _SODIUM_C99(.onetimeauth =) crypto_onetimeauth, - _SODIUM_C99(.onetimeauth_verify =) crypto_onetimeauth_verify + _SODIUM_C99(.implementation_name =) crypto_onetimeauth_poly1305_donna_implementation_name, + _SODIUM_C99(.onetimeauth =) crypto_onetimeauth_poly1305_donna, + _SODIUM_C99(.onetimeauth_verify =) crypto_onetimeauth_poly1305_donna_verify }; diff --git a/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h b/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h index 1ae5691f..4f31a3e6 100644 --- a/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h +++ b/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h @@ -1,5 +1,5 @@ -#ifndef POLY1305_DONNA_H -#define POLY1305_DONNA_H +#ifndef __POLY1305_DONNA_H__ +#define __POLY1305_DONNA_H__ #include @@ -7,5 +7,18 @@ typedef crypto_onetimeauth_poly1305_state poly1305_context; -#endif /* POLY1305_DONNA_H */ +extern struct crypto_onetimeauth_poly1305_implementation + crypto_onetimeauth_poly1305_donna_implementation; +const char *crypto_onetimeauth_poly1305_donna_implementation_name(void); + +int crypto_onetimeauth_poly1305_donna(unsigned char *out, + const unsigned char *in, + unsigned long long inlen, + const unsigned char *k); + +int crypto_onetimeauth_poly1305_donna_verify(const unsigned char *h, + const unsigned char *in, + unsigned long long inlen, + const unsigned char *k); +#endif /* POLY1305_DONNA_H */ diff --git a/src/libsodium/crypto_onetimeauth/poly1305/donna/verify_poly1305_donna.c b/src/libsodium/crypto_onetimeauth/poly1305/donna/verify_poly1305_donna.c index fae8a6ca..e0598423 100644 --- a/src/libsodium/crypto_onetimeauth/poly1305/donna/verify_poly1305_donna.c +++ b/src/libsodium/crypto_onetimeauth/poly1305/donna/verify_poly1305_donna.c @@ -1,15 +1,15 @@ -#include "api.h" -#include "crypto_onetimeauth_poly1305_donna.h" +#include "crypto_onetimeauth_poly1305.h" #include "crypto_verify_16.h" +#include "poly1305_donna.h" int -crypto_onetimeauth_verify(const unsigned char *h, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *k) +crypto_onetimeauth_poly1305_donna_verify(const unsigned char *h, + const unsigned char *in, + unsigned long long inlen, + const unsigned char *k) { unsigned char correct[16]; - crypto_onetimeauth(correct,in,inlen,k); + crypto_onetimeauth_poly1305_donna(correct,in,inlen,k); return crypto_verify_16(h,correct); } diff --git a/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c b/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c index d529b961..7ae6d097 100644 --- a/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c +++ b/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c @@ -1,6 +1,6 @@ #include "crypto_onetimeauth_poly1305.h" -#include "crypto_onetimeauth_poly1305_donna.h" +#include "donna/poly1305_donna.h" static const crypto_onetimeauth_poly1305_implementation *implementation = &crypto_onetimeauth_poly1305_donna_implementation; diff --git a/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c b/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c index e1eb1883..10084e5b 100644 --- a/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c +++ b/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c @@ -3,8 +3,8 @@ #include #include "crypto_onetimeauth.h" #include "crypto_onetimeauth_poly1305.h" -#include "crypto_onetimeauth_poly1305_donna.h" #include "utils.h" +#include "donna/poly1305_donna.h" crypto_onetimeauth_poly1305_implementation * crypto_onetimeauth_pick_best_implementation(void) diff --git a/src/libsodium/include/Makefile.am b/src/libsodium/include/Makefile.am index 8d99efc2..0dcde575 100644 --- a/src/libsodium/include/Makefile.am +++ b/src/libsodium/include/Makefile.am @@ -19,7 +19,6 @@ SODIUM_EXPORT = \ sodium/crypto_hash_sha512.h \ sodium/crypto_onetimeauth.h \ sodium/crypto_onetimeauth_poly1305.h \ - sodium/crypto_onetimeauth_poly1305_donna.h \ sodium/crypto_pwhash_scryptsalsa208sha256.h \ sodium/crypto_scalarmult.h \ sodium/crypto_scalarmult_curve25519.h \ diff --git a/src/libsodium/include/sodium/crypto_onetimeauth_poly1305_donna.h b/src/libsodium/include/sodium/crypto_onetimeauth_poly1305_donna.h deleted file mode 100644 index e0a29a43..00000000 --- a/src/libsodium/include/sodium/crypto_onetimeauth_poly1305_donna.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef crypto_onetimeauth_poly1305_donna_H -#define crypto_onetimeauth_poly1305_donna_H - -#include "crypto_onetimeauth_poly1305.h" -#include "export.h" - -#ifdef __cplusplus -# if __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - -SODIUM_EXPORT -extern struct crypto_onetimeauth_poly1305_implementation - crypto_onetimeauth_poly1305_donna_implementation; - -SODIUM_EXPORT -const char *crypto_onetimeauth_poly1305_donna_implementation_name(void); - -SODIUM_EXPORT -int crypto_onetimeauth_poly1305_donna(unsigned char *out, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *k); - -SODIUM_EXPORT -int crypto_onetimeauth_poly1305_donna_verify(const unsigned char *h, - const unsigned char *in, - unsigned long long inlen, - const unsigned char *k); - -#ifdef __cplusplus -} -#endif - -#endif