Bladeren bron

Removed unused AES key expansion code

tevador 7 jaren geleden
bovenliggende
commit
1c9ad90a96
3 gewijzigde bestanden met toevoegingen van 0 en 25 verwijderingen
  1. 0 1
      README.md
  2. 0 22
      src/softAes.cpp
  3. 0 2
      src/softAes.h

+ 0 - 1
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:

+ 0 - 22
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<http://www.gnu.org/licenses/>.
 */
 
-// 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;
 

+ 0 - 2
src/softAes.h

@@ -21,8 +21,6 @@ along with RandomX.  If not, see<http://www.gnu.org/licenses/>.
 #include <stdint.h>
 #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);