From fd0c47025f4c07654af2eda053e53324bb07a584 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 21 Nov 2015 12:24:59 +0100 Subject: [PATCH] More api.h removal --- src/libsodium/Makefile.am | 1 - .../aes128ctr/portable/afternm_aes128ctr.c | 4 ++-- .../crypto_stream/aes128ctr/portable/api.h | 13 ------------- .../aes128ctr/portable/beforenm_aes128ctr.c | 4 ++-- .../aes128ctr/portable/stream_aes128ctr.c | 19 ++++++++++--------- .../portable/xor_afternm_aes128ctr.c | 5 ++--- 6 files changed, 16 insertions(+), 30 deletions(-) delete mode 100644 src/libsodium/crypto_stream/aes128ctr/portable/api.h diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am index cf0da06f..ef89678d 100644 --- a/src/libsodium/Makefile.am +++ b/src/libsodium/Makefile.am @@ -234,7 +234,6 @@ libsodium_la_SOURCES += \ crypto_sign/ed25519/ref10/obsolete.c \ crypto_stream/aes128ctr/portable/afternm_aes128ctr.c \ crypto_stream/aes128ctr/stream_aes128ctr_api.c \ - crypto_stream/aes128ctr/portable/api.h \ crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c \ crypto_stream/aes128ctr/portable/common.h \ crypto_stream/aes128ctr/portable/common_aes128ctr.c \ diff --git a/src/libsodium/crypto_stream/aes128ctr/portable/afternm_aes128ctr.c b/src/libsodium/crypto_stream/aes128ctr/portable/afternm_aes128ctr.c index a5a9a7a9..9c76f22f 100644 --- a/src/libsodium/crypto_stream/aes128ctr/portable/afternm_aes128ctr.c +++ b/src/libsodium/crypto_stream/aes128ctr/portable/afternm_aes128ctr.c @@ -2,12 +2,12 @@ * Date: 2009-03-19 * Public domain */ -#include "api.h" +#include "crypto_stream_aes128ctr.h" #include "int128.h" #include "common.h" #include "consts.h" -int crypto_stream_afternm(unsigned char *out, unsigned long long len, const unsigned char *nonce, const unsigned char *c) +int crypto_stream_aes128ctr_afternm(unsigned char *out, unsigned long long len, const unsigned char *nonce, const unsigned char *c) { int128 xmm0; diff --git a/src/libsodium/crypto_stream/aes128ctr/portable/api.h b/src/libsodium/crypto_stream/aes128ctr/portable/api.h deleted file mode 100644 index 3c53fb95..00000000 --- a/src/libsodium/crypto_stream/aes128ctr/portable/api.h +++ /dev/null @@ -1,13 +0,0 @@ - -#include "crypto_stream_aes128ctr.h" - -#define crypto_stream crypto_stream_aes128ctr -#define crypto_stream_xor crypto_stream_aes128ctr_xor -#define crypto_stream_beforenm crypto_stream_aes128ctr_beforenm -#define crypto_stream_afternm crypto_stream_aes128ctr_afternm -#define crypto_stream_xor_afternm crypto_stream_aes128ctr_xor_afternm -#define crypto_stream_KEYBYTES crypto_stream_aes128ctr_KEYBYTES -#define crypto_stream_NONCEBYTES crypto_stream_aes128ctr_NONCEBYTES -#define crypto_stream_BEFORENMBYTES crypto_stream_aes128ctr_BEFORENMBYTES -#define crypto_stream_IMPLEMENTATION crypto_stream_aes128ctr_IMPLEMENTATION -#define crypto_stream_VERSION crypto_stream_aes128ctr_VERSION diff --git a/src/libsodium/crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c b/src/libsodium/crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c index f8623dd2..0105cf17 100644 --- a/src/libsodium/crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c +++ b/src/libsodium/crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c @@ -2,12 +2,12 @@ * Date: 2009-03-19 * Public domain */ -#include "api.h" +#include "crypto_stream_aes128ctr.h" #include "consts.h" #include "int128.h" #include "common.h" -int crypto_stream_beforenm(unsigned char *c, const unsigned char *k) +int crypto_stream_aes128ctr_beforenm(unsigned char *c, const unsigned char *k) { /* diff --git a/src/libsodium/crypto_stream/aes128ctr/portable/stream_aes128ctr.c b/src/libsodium/crypto_stream/aes128ctr/portable/stream_aes128ctr.c index 8f4ec72a..43a6a020 100644 --- a/src/libsodium/crypto_stream/aes128ctr/portable/stream_aes128ctr.c +++ b/src/libsodium/crypto_stream/aes128ctr/portable/stream_aes128ctr.c @@ -1,19 +1,20 @@ -#include "api.h" -int crypto_stream( +#include "crypto_stream_aes128ctr.h" + +int crypto_stream_aes128ctr( unsigned char *out, unsigned long long outlen, const unsigned char *n, const unsigned char *k ) { - unsigned char d[crypto_stream_BEFORENMBYTES]; - crypto_stream_beforenm(d, k); - crypto_stream_afternm(out, outlen, n, d); + unsigned char d[crypto_stream_aes128ctr_BEFORENMBYTES]; + crypto_stream_aes128ctr_beforenm(d, k); + crypto_stream_aes128ctr_afternm(out, outlen, n, d); return 0; } -int crypto_stream_xor( +int crypto_stream_aes128ctr_xor( unsigned char *out, const unsigned char *in, unsigned long long inlen, @@ -21,8 +22,8 @@ int crypto_stream_xor( const unsigned char *k ) { - unsigned char d[crypto_stream_BEFORENMBYTES]; - crypto_stream_beforenm(d, k); - crypto_stream_xor_afternm(out, in, inlen, n, d); + unsigned char d[crypto_stream_aes128ctr_BEFORENMBYTES]; + crypto_stream_aes128ctr_beforenm(d, k); + crypto_stream_aes128ctr_xor_afternm(out, in, inlen, n, d); return 0; } diff --git a/src/libsodium/crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c b/src/libsodium/crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c index 139dbe51..4a895206 100644 --- a/src/libsodium/crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c +++ b/src/libsodium/crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c @@ -2,13 +2,12 @@ * Date: 2009-03-19 * Public domain */ -#include -#include "api.h" +#include "crypto_stream_aes128ctr.h" #include "int128.h" #include "common.h" #include "consts.h" -int crypto_stream_xor_afternm(unsigned char *out, const unsigned char *in, unsigned long long len, const unsigned char *nonce, const unsigned char *c) +int crypto_stream_aes128ctr_xor_afternm(unsigned char *out, const unsigned char *in, unsigned long long len, const unsigned char *nonce, const unsigned char *c) { int128 xmm0;