From edb03b4ad8bc4151807a767608fafc7aabb558d1 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 2 Mar 2017 16:32:57 +0100 Subject: [PATCH] Reorder includes This restores compatibility with CompCert --- .../crypto_hash/sha256/cp/hash_sha256_cp.c | 12 +++++----- .../crypto_hash/sha512/cp/hash_sha512_cp.c | 12 +++++----- .../crypto_pwhash/argon2/argon2-core.c | 9 ++++---- .../scryptsalsa208sha256/pbkdf2-sha256.c | 6 ++--- .../scryptsalsa208sha256/pbkdf2-sha256.h | 4 ++-- .../sodium/crypto_onetimeauth_poly1305.h | 10 ++++----- src/libsodium/include/sodium/randombytes.h | 4 ++-- src/libsodium/randombytes/randombytes.c | 5 ++--- .../salsa20/randombytes_salsa20_random.c | 22 +++++++++---------- .../sysrandom/randombytes_sysrandom.c | 20 ++++++++--------- 10 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c b/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c index e01642bd..302d32a1 100644 --- a/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c +++ b/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c @@ -26,17 +26,17 @@ * */ -#include "crypto_hash_sha256.h" -#include "private/common.h" -#include "utils.h" - -#include - #include #include #include #include +#include + +#include "crypto_hash_sha256.h" +#include "private/common.h" +#include "utils.h" + static void be32enc_vect(unsigned char *dst, const uint32_t *src, size_t len) { diff --git a/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c b/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c index 39e658bc..3778dfe3 100644 --- a/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c +++ b/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c @@ -26,17 +26,17 @@ * */ -#include "crypto_hash_sha512.h" -#include "private/common.h" -#include "utils.h" - -#include - #include #include #include #include +#include + +#include "crypto_hash_sha512.h" +#include "private/common.h" +#include "utils.h" + static void be64enc_vect(unsigned char *dst, const uint64_t *src, size_t len) { diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-core.c b/src/libsodium/crypto_pwhash/argon2/argon2-core.c index 465715ba..79447481 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-core.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-core.c @@ -11,16 +11,17 @@ * . */ -#include -#ifdef HAVE_SYS_MMAN_H -# include -#endif #include #include #include #include #include +#include +#ifdef HAVE_SYS_MMAN_H +# include +#endif + #include "crypto_generichash_blake2b.h" #include "private/common.h" #include "runtime.h" diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c index 3ff76570..25fa3811 100644 --- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c +++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c @@ -25,12 +25,12 @@ */ #include -#include -#include - #include +#include #include +#include + #include "crypto_auth_hmacsha256.h" #include "pbkdf2-sha256.h" #include "private/common.h" diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h index 5e5529fa..f9598c87 100644 --- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h +++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h @@ -28,10 +28,10 @@ #ifndef pbkdf2_sha256_H #define pbkdf2_sha256_H -#include - #include +#include + #include "crypto_auth_hmacsha256.h" /** diff --git a/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h b/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h index c3cb31a0..325c2d99 100644 --- a/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +++ b/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h @@ -1,9 +1,6 @@ #ifndef crypto_onetimeauth_poly1305_H #define crypto_onetimeauth_poly1305_H -#include -#include "export.h" - #ifdef __cplusplus # ifdef __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -11,10 +8,13 @@ extern "C" { #endif -#include - #include #include +#include + +#include + +#include "export.h" typedef CRYPTO_ALIGN(16) struct crypto_onetimeauth_poly1305_state { unsigned char opaque[256]; diff --git a/src/libsodium/include/sodium/randombytes.h b/src/libsodium/include/sodium/randombytes.h index 05f5f365..d112fb29 100644 --- a/src/libsodium/include/sodium/randombytes.h +++ b/src/libsodium/include/sodium/randombytes.h @@ -2,11 +2,11 @@ #ifndef randombytes_H #define randombytes_H -#include - #include #include +#include + #include "export.h" #ifdef __cplusplus diff --git a/src/libsodium/randombytes/randombytes.c b/src/libsodium/randombytes/randombytes.c index dc0f81c3..b3bd10f1 100644 --- a/src/libsodium/randombytes/randombytes.c +++ b/src/libsodium/randombytes/randombytes.c @@ -1,12 +1,11 @@ -#include -#include - #include #include #include #include +#include + #ifdef __EMSCRIPTEN__ # include #endif diff --git a/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c b/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c index 78f3b5e1..fa2268e1 100644 --- a/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +++ b/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c @@ -1,5 +1,16 @@ +#include +#include +#include +#include +#include #include +#include +#include +#if !defined(_MSC_VER) && !defined(__BORLANDC__) +# include +#endif + #include #ifndef _WIN32 # include @@ -14,17 +25,6 @@ # include #endif -#include -#include -#include -#include -#include -#include -#include -#if !defined(_MSC_VER) && !defined(__BORLANDC__) -# include -#endif - #include "crypto_core_salsa20.h" #include "crypto_generichash.h" #include "crypto_stream_salsa20.h" diff --git a/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c b/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c index 80b93746..41b95b95 100644 --- a/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +++ b/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c @@ -1,4 +1,14 @@ +#include +#include +#include +#include +#include +#include +#ifndef _WIN32 +# include +#endif + #include #include #ifndef _WIN32 @@ -14,16 +24,6 @@ # include #endif -#include -#include -#include -#include -#include -#include -#ifndef _WIN32 -# include -#endif - #include "randombytes.h" #include "randombytes_sysrandom.h" #include "utils.h"