diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am index 7027cc7a..22f9af74 100644 --- a/src/libsodium/Makefile.am +++ b/src/libsodium/Makefile.am @@ -46,7 +46,6 @@ libsodium_la_SOURCES = \ crypto_pwhash/argon2/argon2-encoding.c \ crypto_pwhash/argon2/argon2-encoding.h \ crypto_pwhash/argon2/argon2-fill-block-ref.c \ - crypto_pwhash/argon2/argon2-impl.h \ crypto_pwhash/argon2/argon2.c \ crypto_pwhash/argon2/argon2.h \ crypto_pwhash/argon2/blake2b-long.c \ diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-core.c b/src/libsodium/crypto_pwhash/argon2/argon2-core.c index 35719f13..83df1542 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-core.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-core.c @@ -26,7 +26,6 @@ #include "private/common.h" #include "argon2-core.h" -#include "argon2-impl.h" #include "blake2b-long.h" #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS) diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c index b7df197e..f2e020ef 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c @@ -17,8 +17,8 @@ #include "argon2.h" #include "argon2-core.h" -#include "argon2-impl.h" #include "blamka-round-ref.h" +#include "private/common.h" static void fill_block(const block *prev_block, const block *ref_block, block *next_block) { diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c index ba2617fa..def37a6b 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c @@ -29,8 +29,8 @@ #include "argon2.h" #include "argon2-core.h" -#include "argon2-impl.h" #include "blamka-round-ssse3.h" +#include "private/common.h" static void fill_block(__m128i *state, const uint8_t *ref_block, uint8_t *next_block) { __m128i block_XY[ARGON2_OWORDS_IN_BLOCK]; diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-impl.h b/src/libsodium/crypto_pwhash/argon2/argon2-impl.h deleted file mode 100644 index be17d1c9..00000000 --- a/src/libsodium/crypto_pwhash/argon2/argon2-impl.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - BLAKE2 reference source code package - reference C implementations - - Written in 2012 by Samuel Neves - - To the extent possible under law, the author(s) have dedicated all copyright - and related and neighboring rights to this software to the public domain - worldwide. This software is distributed without any warranty. - - You should have received a copy of the CC0 Public Domain Dedication along with - this software. If not, see . -*/ - -#ifndef argon2_impl_H -#define argon2_impl_H - -#include -#include - -static inline uint32_t rotl32( const uint32_t w, const unsigned c ) -{ - return ( w << c ) | ( w >> ( 32 - c ) ); -} - -static inline uint64_t rotl64( const uint64_t w, const unsigned c ) -{ - return ( w << c ) | ( w >> ( 64 - c ) ); -} - -static inline uint32_t rotr32( const uint32_t w, const unsigned c ) -{ - return ( w >> c ) | ( w << ( 32 - c ) ); -} - -static inline uint64_t rotr64( const uint64_t w, const unsigned c ) -{ - return ( w >> c ) | ( w << ( 64 - c ) ); -} - -#endif diff --git a/src/libsodium/crypto_pwhash/argon2/blake2b-long.c b/src/libsodium/crypto_pwhash/argon2/blake2b-long.c index 5e4012c2..797a1a1e 100644 --- a/src/libsodium/crypto_pwhash/argon2/blake2b-long.c +++ b/src/libsodium/crypto_pwhash/argon2/blake2b-long.c @@ -7,7 +7,6 @@ #include "utils.h" #include "private/common.h" -#include "argon2-impl.h" #include "blake2b-long.h" int blake2b_long(void *pout, size_t outlen, const void *in, size_t inlen) { diff --git a/src/libsodium/crypto_pwhash/argon2/blamka-round-ref.h b/src/libsodium/crypto_pwhash/argon2/blamka-round-ref.h index 2ed2760c..68bfe224 100644 --- a/src/libsodium/crypto_pwhash/argon2/blamka-round-ref.h +++ b/src/libsodium/crypto_pwhash/argon2/blamka-round-ref.h @@ -1,7 +1,7 @@ #ifndef blamka_round_ref_H #define blamka_round_ref_H -#include "argon2-impl.h" +#include "private/common.h" /*designed by the Lyra PHC team */ static inline uint64_t fBlaMka(uint64_t x, uint64_t y) { @@ -13,13 +13,13 @@ static inline uint64_t fBlaMka(uint64_t x, uint64_t y) { #define G(a, b, c, d) \ do { \ a = fBlaMka(a, b); \ - d = rotr64(d ^ a, 32); \ + d = ROTR64(d ^ a, 32); \ c = fBlaMka(c, d); \ - b = rotr64(b ^ c, 24); \ + b = ROTR64(b ^ c, 24); \ a = fBlaMka(a, b); \ - d = rotr64(d ^ a, 16); \ + d = ROTR64(d ^ a, 16); \ c = fBlaMka(c, d); \ - b = rotr64(b ^ c, 63); \ + b = ROTR64(b ^ c, 63); \ } while ((void)0, 0) #define BLAKE2_ROUND_NOMSG(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, \ diff --git a/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h b/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h index 07d158ec..86e5eac2 100644 --- a/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h +++ b/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h @@ -1,7 +1,7 @@ #ifndef blamka_round_ssse3_H #define blamka_round_ssse3_H -#include "argon2-impl.h" +#include "private/common.h" #define r16 \ (_mm_setr_epi8(2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9))