From 1c9ad90a963609d4a035a08f75e908d0755fdc5a Mon Sep 17 00:00:00 2001 From: tevador Date: Fri, 29 Mar 2019 08:57:47 +0100 Subject: [PATCH] Removed unused AES key expansion code --- README.md | 1 - src/softAes.cpp | 22 ---------------------- src/softAes.h | 2 -- 3 files changed, 25 deletions(-) diff --git a/README.md b/README.md index ea282b9..cfcce3c 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,6 @@ The following people have contributed to the design of RandomX: RandomX uses some source code from the following 3rd party repositories: * Argon2d, Blake2b hashing functions: https://github.com/P-H-C/phc-winner-argon2 -* Software AES implementation https://github.com/fireice-uk/xmr-stak ## Donations XMR: diff --git a/src/softAes.cpp b/src/softAes.cpp index 81af94f..b51d92c 100644 --- a/src/softAes.cpp +++ b/src/softAes.cpp @@ -17,9 +17,6 @@ You should have received a copy of the GNU General Public License along with RandomX. If not, see. */ -// Parts of this file are originally copyright (c) xmr-stak -// Parts of this file are originally copyright (c) 2014-2017, The Monero Project - #include "softAes.h" alignas(16) const uint8_t sbox[256] = { @@ -321,25 +318,6 @@ alignas(16) const uint32_t lutDec3[256] = { 0x397101a8, 0x08deb30c, 0xd89ce4b4, 0x6490c156, 0x7b6184cb, 0xd570b632, 0x48745c6c, 0xd04257b8, }; -static inline uint32_t subw(uint32_t w) { - return (sbox[w >> 24] << 24) | - (sbox[(w >> 16) & 0xff] << 16) | - (sbox[(w >> 8) & 0xff] << 8) | - sbox[w & 0xff]; -} - -#if defined(__clang__) || defined(__arm__) || defined(__aarch64__) || defined(__powerpc__) -static inline uint32_t _rotr(uint32_t value, uint32_t amount) { - return (value >> amount) | (value << (-amount & 31)); -} -#endif - -__m128i soft_aeskeygenassist(__m128i key, uint8_t rcon) { - uint32_t X1 = subw(_mm_cvtsi128_si32(_mm_shuffle_epi32(key, 0x55))); - uint32_t X3 = subw(_mm_cvtsi128_si32(_mm_shuffle_epi32(key, 0xFF))); - return _mm_set_epi32(_rotr(X3, 8) ^ rcon, X3, _rotr(X1, 8) ^ rcon, X1); -} - __m128i soft_aesenc(__m128i in, __m128i key) { uint32_t s0, s1, s2, s3; diff --git a/src/softAes.h b/src/softAes.h index e4b675e..9054ef1 100644 --- a/src/softAes.h +++ b/src/softAes.h @@ -21,8 +21,6 @@ along with RandomX. If not, see. #include #include "intrinPortable.h" -__m128i soft_aeskeygenassist(__m128i key, uint8_t rcon); - __m128i soft_aesenc(__m128i in, __m128i key); __m128i soft_aesdec(__m128i in, __m128i key);