From 16f12c1af3c20d6dd4b2c39a148dfbd0bd3ac4aa Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 21 Nov 2015 12:35:02 +0100 Subject: [PATCH] More api.h removal --- src/libsodium/Makefile.am | 3 --- src/libsodium/crypto_auth/hmacsha256/cp/api.h | 9 --------- .../crypto_auth/hmacsha256/cp/hmac_hmacsha256.c | 7 +++---- .../crypto_auth/hmacsha256/cp/verify_hmacsha256.c | 6 +++--- src/libsodium/crypto_auth/hmacsha512/cp/api.h | 9 --------- .../crypto_auth/hmacsha512/cp/hmac_hmacsha512.c | 7 +++---- .../crypto_auth/hmacsha512/cp/verify_hmacsha512.c | 8 ++++---- src/libsodium/crypto_auth/hmacsha512256/cp/api.h | 9 --------- .../crypto_auth/hmacsha512256/cp/hmac_hmacsha512256.c | 8 ++++---- .../hmacsha512256/cp/verify_hmacsha512256.c | 10 ++++++---- 10 files changed, 23 insertions(+), 53 deletions(-) delete mode 100644 src/libsodium/crypto_auth/hmacsha256/cp/api.h delete mode 100644 src/libsodium/crypto_auth/hmacsha512/cp/api.h delete mode 100644 src/libsodium/crypto_auth/hmacsha512256/cp/api.h diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am index ef89678d..f6b6aea8 100644 --- a/src/libsodium/Makefile.am +++ b/src/libsodium/Makefile.am @@ -5,15 +5,12 @@ libsodium_la_SOURCES = \ crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c \ crypto_auth/crypto_auth.c \ crypto_auth/hmacsha256/auth_hmacsha256_api.c \ - crypto_auth/hmacsha256/cp/api.h \ crypto_auth/hmacsha256/cp/hmac_hmacsha256.c \ crypto_auth/hmacsha256/cp/verify_hmacsha256.c \ crypto_auth/hmacsha512/auth_hmacsha512_api.c \ - crypto_auth/hmacsha512/cp/api.h \ crypto_auth/hmacsha512/cp/hmac_hmacsha512.c \ crypto_auth/hmacsha512/cp/verify_hmacsha512.c \ crypto_auth/hmacsha512256/auth_hmacsha512256_api.c \ - crypto_auth/hmacsha512256/cp/api.h \ crypto_auth/hmacsha512256/cp/hmac_hmacsha512256.c \ crypto_auth/hmacsha512256/cp/verify_hmacsha512256.c \ crypto_box/crypto_box.c \ diff --git a/src/libsodium/crypto_auth/hmacsha256/cp/api.h b/src/libsodium/crypto_auth/hmacsha256/cp/api.h deleted file mode 100644 index cd4d38e7..00000000 --- a/src/libsodium/crypto_auth/hmacsha256/cp/api.h +++ /dev/null @@ -1,9 +0,0 @@ - -#include "crypto_auth_hmacsha256.h" - -#define crypto_auth crypto_auth_hmacsha256 -#define crypto_auth_verify crypto_auth_hmacsha256_verify -#define crypto_auth_BYTES crypto_auth_hmacsha256_BYTES -#define crypto_auth_KEYBYTES crypto_auth_hmacsha256_KEYBYTES -#define crypto_auth_IMPLEMENTATION crypto_auth_hmacsha256_IMPLEMENTATION -#define crypto_auth_VERSION crypto_auth_hmacsha256_VERSION diff --git a/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c b/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c index b2e7a789..dc7a7ce4 100644 --- a/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c +++ b/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c @@ -26,7 +26,6 @@ * */ -#include "api.h" #include "crypto_auth_hmacsha256.h" #include "crypto_hash_sha256.h" #include "utils.h" @@ -98,12 +97,12 @@ crypto_auth_hmacsha256_final(crypto_auth_hmacsha256_state *state, } int -crypto_auth(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k) +crypto_auth_hmacsha256(unsigned char *out, const unsigned char *in, + unsigned long long inlen, const unsigned char *k) { crypto_auth_hmacsha256_state state; - crypto_auth_hmacsha256_init(&state, k, crypto_auth_KEYBYTES); + crypto_auth_hmacsha256_init(&state, k, crypto_auth_hmacsha256_KEYBYTES); crypto_auth_hmacsha256_update(&state, in, inlen); crypto_auth_hmacsha256_final(&state, out); diff --git a/src/libsodium/crypto_auth/hmacsha256/cp/verify_hmacsha256.c b/src/libsodium/crypto_auth/hmacsha256/cp/verify_hmacsha256.c index b30e5fc3..046a8b94 100644 --- a/src/libsodium/crypto_auth/hmacsha256/cp/verify_hmacsha256.c +++ b/src/libsodium/crypto_auth/hmacsha256/cp/verify_hmacsha256.c @@ -1,11 +1,11 @@ -#include "api.h" +#include "crypto_auth_hmacsha256.h" #include "crypto_verify_32.h" #include "utils.h" -int crypto_auth_verify(const unsigned char *h,const unsigned char *in,unsigned long long inlen,const unsigned char *k) +int crypto_auth_hmacsha256_verify(const unsigned char *h,const unsigned char *in,unsigned long long inlen,const unsigned char *k) { unsigned char correct[32]; - crypto_auth(correct,in,inlen,k); + crypto_auth_hmacsha256(correct,in,inlen,k); return crypto_verify_32(h,correct) | (-(h == correct)) | sodium_memcmp(correct,h,32); } diff --git a/src/libsodium/crypto_auth/hmacsha512/cp/api.h b/src/libsodium/crypto_auth/hmacsha512/cp/api.h deleted file mode 100644 index 0ce40434..00000000 --- a/src/libsodium/crypto_auth/hmacsha512/cp/api.h +++ /dev/null @@ -1,9 +0,0 @@ - -#include "crypto_auth_hmacsha512.h" - -#define crypto_auth crypto_auth_hmacsha512 -#define crypto_auth_verify crypto_auth_hmacsha512_verify -#define crypto_auth_BYTES crypto_auth_hmacsha512_BYTES -#define crypto_auth_KEYBYTES crypto_auth_hmacsha512_KEYBYTES -#define crypto_auth_IMPLEMENTATION crypto_auth_hmacsha512_IMPLEMENTATION -#define crypto_auth_VERSION crypto_auth_hmacsha512_VERSION diff --git a/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c b/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c index edb940df..dc8b63a2 100644 --- a/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c +++ b/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c @@ -26,7 +26,6 @@ * */ -#include "api.h" #include "crypto_auth_hmacsha512.h" #include "crypto_hash_sha512.h" #include "utils.h" @@ -98,12 +97,12 @@ crypto_auth_hmacsha512_final(crypto_auth_hmacsha512_state *state, } int -crypto_auth(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k) +crypto_auth_hmacsha512(unsigned char *out, const unsigned char *in, + unsigned long long inlen, const unsigned char *k) { crypto_auth_hmacsha512_state state; - crypto_auth_hmacsha512_init(&state, k, crypto_auth_KEYBYTES); + crypto_auth_hmacsha512_init(&state, k, crypto_auth_hmacsha512_KEYBYTES); crypto_auth_hmacsha512_update(&state, in, inlen); crypto_auth_hmacsha512_final(&state, out); diff --git a/src/libsodium/crypto_auth/hmacsha512/cp/verify_hmacsha512.c b/src/libsodium/crypto_auth/hmacsha512/cp/verify_hmacsha512.c index 342cd913..98973495 100644 --- a/src/libsodium/crypto_auth/hmacsha512/cp/verify_hmacsha512.c +++ b/src/libsodium/crypto_auth/hmacsha512/cp/verify_hmacsha512.c @@ -1,12 +1,12 @@ -#include "api.h" +#include "crypto_auth_hmacsha512.h" #include "crypto_verify_64.h" #include "utils.h" -int crypto_auth_verify(const unsigned char *h, const unsigned char *in, - unsigned long long inlen, const unsigned char *k) +int crypto_auth_hmacsha512_verify(const unsigned char *h, const unsigned char *in, + unsigned long long inlen, const unsigned char *k) { unsigned char correct[64]; - crypto_auth(correct,in,inlen,k); + crypto_auth_hmacsha512(correct,in,inlen,k); return crypto_verify_64(h,correct) | (-(h == correct)) | sodium_memcmp(correct,h,64); } diff --git a/src/libsodium/crypto_auth/hmacsha512256/cp/api.h b/src/libsodium/crypto_auth/hmacsha512256/cp/api.h deleted file mode 100644 index 645b2781..00000000 --- a/src/libsodium/crypto_auth/hmacsha512256/cp/api.h +++ /dev/null @@ -1,9 +0,0 @@ - -#include "crypto_auth_hmacsha512256.h" - -#define crypto_auth crypto_auth_hmacsha512256 -#define crypto_auth_verify crypto_auth_hmacsha512256_verify -#define crypto_auth_BYTES crypto_auth_hmacsha512256_BYTES -#define crypto_auth_KEYBYTES crypto_auth_hmacsha512256_KEYBYTES -#define crypto_auth_IMPLEMENTATION crypto_auth_hmacsha512256_IMPLEMENTATION -#define crypto_auth_VERSION crypto_auth_hmacsha512256_VERSION diff --git a/src/libsodium/crypto_auth/hmacsha512256/cp/hmac_hmacsha512256.c b/src/libsodium/crypto_auth/hmacsha512256/cp/hmac_hmacsha512256.c index 4b476c33..5b55e1ca 100644 --- a/src/libsodium/crypto_auth/hmacsha512256/cp/hmac_hmacsha512256.c +++ b/src/libsodium/crypto_auth/hmacsha512256/cp/hmac_hmacsha512256.c @@ -1,5 +1,4 @@ -#include "api.h" #include "crypto_auth_hmacsha512256.h" #include "crypto_auth_hmacsha512.h" #include "crypto_hash_sha512.h" @@ -41,12 +40,13 @@ crypto_auth_hmacsha512256_final(crypto_auth_hmacsha512256_state *state, } int -crypto_auth(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k) +crypto_auth_hmacsha512256(unsigned char *out, const unsigned char *in, + unsigned long long inlen, const unsigned char *k) { crypto_auth_hmacsha512256_state state; - crypto_auth_hmacsha512256_init(&state, k, crypto_auth_KEYBYTES); + crypto_auth_hmacsha512256_init(&state, k, + crypto_auth_hmacsha512256_KEYBYTES); crypto_auth_hmacsha512256_update(&state, in, inlen); crypto_auth_hmacsha512256_final(&state, out); diff --git a/src/libsodium/crypto_auth/hmacsha512256/cp/verify_hmacsha512256.c b/src/libsodium/crypto_auth/hmacsha512256/cp/verify_hmacsha512256.c index e707591b..07af71bd 100644 --- a/src/libsodium/crypto_auth/hmacsha512256/cp/verify_hmacsha512256.c +++ b/src/libsodium/crypto_auth/hmacsha512256/cp/verify_hmacsha512256.c @@ -1,12 +1,14 @@ -#include "api.h" +#include "crypto_auth_hmacsha512256.h" #include "crypto_verify_32.h" #include "utils.h" -int crypto_auth_verify(const unsigned char *h, const unsigned char *in, - unsigned long long inlen, const unsigned char *k) +int crypto_auth_hmacsha512256_verify(const unsigned char *h, + const unsigned char *in, + unsigned long long inlen, + const unsigned char *k) { unsigned char correct[32]; - crypto_auth(correct,in,inlen,k); + crypto_auth_hmacsha512256(correct,in,inlen,k); return crypto_verify_32(h,correct) | (-(h == correct)) | sodium_memcmp(correct,h,32); }