From 83c62961db00e0ddaf2c371e79c8dbe2e7e9d470 Mon Sep 17 00:00:00 2001 From: Zhi Guan Date: Fri, 6 Jul 2018 23:13:33 +0800 Subject: [PATCH] Revert "optimize zuc" This reverts commit 74d4a07adeb79460caa5a14cb5d3d8e12c1d90ff. --- crypto/zuc/zuc_core.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/crypto/zuc/zuc_core.c b/crypto/zuc/zuc_core.c index 244667f6..a4cc8367 100644 --- a/crypto/zuc/zuc_core.c +++ b/crypto/zuc/zuc_core.c @@ -124,24 +124,6 @@ static const uint8_t S1[256] = { {int j; for (j=0; j<15;j++) LFSR[j]=LFSR[j+1];} \ LFSR[15] = V -/* FIXME: check if uint64_t is supported */ -#if 1 -#define LFSRWithWorkMode() \ - { \ - int j; \ - uint64_t a = LFSR[0]; \ - a += ((uint64_t)LFSR[0]) << 8; \ - a += ((uint64_t)LFSR[4]) << 20; \ - a += ((uint64_t)LFSR[10]) << 21; \ - a += ((uint64_t)LFSR[13]) << 17; \ - a += ((uint64_t)LFSR[15]) << 15; \ - a = (a & 0x7fffffff) + (a >> 31); \ - a = (a & 0x7fffffff) + (a >> 31); \ - for (j = 0; j < 15; j++) \ - LFSR[j] = LFSR[j+1]; \ - LFSR[15] = a; \ - } -#else #define LFSRWithWorkMode() \ V = LFSR[0]; \ ADD31(V, ROT31(LFSR[0], 8)); \ @@ -151,7 +133,6 @@ static const uint8_t S1[256] = { ADD31(V, ROT31(LFSR[15], 15)); \ {int j; for (j=0; j<15;j++) LFSR[j]=LFSR[j+1];} \ LFSR[15] = V -#endif #define BitReconstruction2(X1,X2) \ X1 = ((LFSR[11] & 0xFFFF) << 16) | (LFSR[9] >> 15); \ @@ -195,7 +176,6 @@ static const uint8_t S1[256] = { (X0 ^ R1) + R2; \ F_(X1, X2) - void ZUC_set_key(ZUC_KEY *key, const unsigned char *user_key, const unsigned char *iv) { ZUC_UINT31 *LFSR = key->LFSR;