Skip to content

Commit ee6efaa

Browse files
committed
refactor: remove unused macros and function definitions
1 parent 32156b2 commit ee6efaa

File tree

5 files changed

+0
-132
lines changed

5 files changed

+0
-132
lines changed

src/crypto/x11/bmw.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ static const sph_u64 IV512[] = {
5858
SPH_C64(0xF0F1F2F3F4F5F6F7), SPH_C64(0xF8F9FAFBFCFDFEFF)
5959
};
6060

61-
#define XCAT(x, y) XCAT_(x, y)
62-
#define XCAT_(x, y) x ## y
63-
6461
#define LPAR (
6562

6663
#define I16_16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
@@ -121,36 +118,6 @@ static const sph_u64 IV512[] = {
121118
(SPH_T32(SPH_ROTL32(mf(j0m), j1m) + SPH_ROTL32(mf(j3m), j4m) \
122119
- SPH_ROTL32(mf(j10m), j11m) + Ks(j16)) ^ hf(j7m))
123120

124-
#define expand1s_inner(qf, mf, hf, i16, \
125-
i0, i1, i2, i3, i4, i5, i6, i7, i8, \
126-
i9, i10, i11, i12, i13, i14, i15, \
127-
i0m, i1m, i3m, i4m, i7m, i10m, i11m) \
128-
SPH_T32(ss1(qf(i0)) + ss2(qf(i1)) + ss3(qf(i2)) + ss0(qf(i3)) \
129-
+ ss1(qf(i4)) + ss2(qf(i5)) + ss3(qf(i6)) + ss0(qf(i7)) \
130-
+ ss1(qf(i8)) + ss2(qf(i9)) + ss3(qf(i10)) + ss0(qf(i11)) \
131-
+ ss1(qf(i12)) + ss2(qf(i13)) + ss3(qf(i14)) + ss0(qf(i15)) \
132-
+ add_elt_s(mf, hf, i0m, i1m, i3m, i4m, i7m, i10m, i11m, i16))
133-
134-
#define expand1s(qf, mf, hf, i16) \
135-
expand1s_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16)
136-
#define expand1s_(qf, mf, hf, i16, ix, iy) \
137-
expand1s_inner LPAR qf, mf, hf, i16, ix, iy)
138-
139-
#define expand2s_inner(qf, mf, hf, i16, \
140-
i0, i1, i2, i3, i4, i5, i6, i7, i8, \
141-
i9, i10, i11, i12, i13, i14, i15, \
142-
i0m, i1m, i3m, i4m, i7m, i10m, i11m) \
143-
SPH_T32(qf(i0) + rs1(qf(i1)) + qf(i2) + rs2(qf(i3)) \
144-
+ qf(i4) + rs3(qf(i5)) + qf(i6) + rs4(qf(i7)) \
145-
+ qf(i8) + rs5(qf(i9)) + qf(i10) + rs6(qf(i11)) \
146-
+ qf(i12) + rs7(qf(i13)) + ss4(qf(i14)) + ss5(qf(i15)) \
147-
+ add_elt_s(mf, hf, i0m, i1m, i3m, i4m, i7m, i10m, i11m, i16))
148-
149-
#define expand2s(qf, mf, hf, i16) \
150-
expand2s_(qf, mf, hf, i16, I16_ ## i16, M16_ ## i16)
151-
#define expand2s_(qf, mf, hf, i16, ix, iy) \
152-
expand2s_inner LPAR qf, mf, hf, i16, ix, iy)
153-
154121
#define sb0(x) (((x) >> 1) ^ SPH_T64((x) << 3) \
155122
^ SPH_ROTL64(x, 4) ^ SPH_ROTL64(x, 37))
156123
#define sb1(x) (((x) >> 1) ^ SPH_T64((x) << 2) \

src/crypto/x11/echo.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ extern "C"{
5151
#endif
5252

5353
#define T32 SPH_T32
54-
#define C32 SPH_C32
5554
#define C64 SPH_C64
5655

5756
#include "aes_helper.c"

src/crypto/x11/groestl.c

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ extern "C"{
6969
| ((SPH_C32(x) << 8) & SPH_C32(0x00FF0000)) \
7070
| ((SPH_C32(x) << 24) & SPH_C32(0xFF000000)))
7171
#define dec32e_aligned sph_dec32le_aligned
72-
#define enc32e sph_enc32le
7372
#define B32_0(x) ((x) & 0xFF)
7473
#define B32_1(x) (((x) >> 8) & 0xFF)
7574
#define B32_2(x) (((x) >> 16) & 0xFF)
@@ -109,7 +108,6 @@ extern "C"{
109108

110109
#define C32e(x) SPH_C32(x)
111110
#define dec32e_aligned sph_dec32be_aligned
112-
#define enc32e sph_enc32be
113111
#define B32_0(x) ((x) >> 24)
114112
#define B32_1(x) (((x) >> 16) & 0xFF)
115113
#define B32_2(x) (((x) >> 8) & 0xFF)
@@ -1194,34 +1192,6 @@ static const sph_u64 T7[] = {
11941192

11951193
#endif
11961194

1197-
#if SPH_SMALL_FOOTPRINT_GROESTL
1198-
1199-
#define RSTT(d, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \
1200-
t[d] = T0[B64_0(a[b0])] \
1201-
^ R64(T0[B64_1(a[b1])], 8) \
1202-
^ R64(T0[B64_2(a[b2])], 16) \
1203-
^ R64(T0[B64_3(a[b3])], 24) \
1204-
^ T4[B64_4(a[b4])] \
1205-
^ R64(T4[B64_5(a[b5])], 8) \
1206-
^ R64(T4[B64_6(a[b6])], 16) \
1207-
^ R64(T4[B64_7(a[b7])], 24); \
1208-
} while (0)
1209-
1210-
#else
1211-
1212-
#define RSTT(d, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \
1213-
t[d] = T0[B64_0(a[b0])] \
1214-
^ T1[B64_1(a[b1])] \
1215-
^ T2[B64_2(a[b2])] \
1216-
^ T3[B64_3(a[b3])] \
1217-
^ T4[B64_4(a[b4])] \
1218-
^ T5[B64_5(a[b5])] \
1219-
^ T6[B64_6(a[b6])] \
1220-
^ T7[B64_7(a[b7])]; \
1221-
} while (0)
1222-
1223-
#endif
1224-
12251195
#define DECL_STATE_BIG \
12261196
sph_u64 H[16];
12271197

@@ -2020,28 +1990,6 @@ static const sph_u32 T3dn[] = {
20201990
C32e(0x3d46cb46), C32e(0xb71ffc1f), C32e(0x0c61d661), C32e(0x624e3a4e)
20211991
};
20221992

2023-
#define XCAT(x, y) XCAT_(x, y)
2024-
#define XCAT_(x, y) x ## y
2025-
2026-
#define RSTT(d0, d1, a, b0, b1, b2, b3, b4, b5, b6, b7) do { \
2027-
t[d0] = T0up[B32_0(a[b0])] \
2028-
^ T1up[B32_1(a[b1])] \
2029-
^ T2up[B32_2(a[b2])] \
2030-
^ T3up[B32_3(a[b3])] \
2031-
^ T0dn[B32_0(a[b4])] \
2032-
^ T1dn[B32_1(a[b5])] \
2033-
^ T2dn[B32_2(a[b6])] \
2034-
^ T3dn[B32_3(a[b7])]; \
2035-
t[d1] = T0dn[B32_0(a[b0])] \
2036-
^ T1dn[B32_1(a[b1])] \
2037-
^ T2dn[B32_2(a[b2])] \
2038-
^ T3dn[B32_3(a[b3])] \
2039-
^ T0up[B32_0(a[b4])] \
2040-
^ T1up[B32_1(a[b5])] \
2041-
^ T2up[B32_2(a[b6])] \
2042-
^ T3up[B32_3(a[b7])]; \
2043-
} while (0)
2044-
20451993
#define DECL_STATE_BIG \
20461994
sph_u32 H[32];
20471995

src/crypto/x11/jh.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ extern "C"{
5959

6060
#if SPH_LITTLE_ENDIAN
6161

62-
#define C32e(x) ((SPH_C32(x) >> 24) \
63-
| ((SPH_C32(x) >> 8) & SPH_C32(0x0000FF00)) \
64-
| ((SPH_C32(x) << 8) & SPH_C32(0x00FF0000)) \
65-
| ((SPH_C32(x) << 24) & SPH_C32(0xFF000000)))
66-
#define dec32e_aligned sph_dec32le_aligned
67-
#define enc32e sph_enc32le
68-
6962
#define C64e(x) ((SPH_C64(x) >> 56) \
7063
| ((SPH_C64(x) >> 40) & SPH_C64(0x000000000000FF00)) \
7164
| ((SPH_C64(x) >> 24) & SPH_C64(0x0000000000FF0000)) \
@@ -79,9 +72,6 @@ extern "C"{
7972

8073
#else
8174

82-
#define C32e(x) SPH_C32(x)
83-
#define dec32e_aligned sph_dec32be_aligned
84-
#define enc32e sph_enc32be
8575
#define C64e(x) SPH_C64(x)
8676
#define dec64e_aligned sph_dec64be_aligned
8777
#define enc64e sph_enc64be

src/crypto/x11/simd.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -213,42 +213,6 @@ static const s32 alpha_tab[] = {
213213
FFT_LOOP(rb, 32, 4, id); \
214214
} while (0)
215215

216-
#if SPH_SMALL_FOOTPRINT_SIMD
217-
218-
static void
219-
fft32(unsigned char *x, size_t xs, s32 *q)
220-
{
221-
size_t xd;
222-
223-
xd = xs << 1;
224-
FFT16(0, xd, 0);
225-
FFT16(xs, xd, 16);
226-
FFT_LOOP(0, 16, 8, label_);
227-
}
228-
229-
#define FFT128(xb, xs, rb, id) do { \
230-
fft32(x + (xb) + ((xs) * 0), (xs) << 2, &q[(rb) + 0]); \
231-
fft32(x + (xb) + ((xs) * 2), (xs) << 2, &q[(rb) + 32]); \
232-
FFT_LOOP(rb, 32, 4, XCAT(id, aa)); \
233-
fft32(x + (xb) + ((xs) * 1), (xs) << 2, &q[(rb) + 64]); \
234-
fft32(x + (xb) + ((xs) * 3), (xs) << 2, &q[(rb) + 96]); \
235-
FFT_LOOP((rb) + 64, 32, 4, XCAT(id, ab)); \
236-
FFT_LOOP(rb, 64, 2, XCAT(id, a)); \
237-
} while (0)
238-
239-
#else
240-
241-
/*
242-
* Output range: |q| <= 4733784
243-
*/
244-
#define FFT128(xb, xs, rb, id) do { \
245-
FFT64(xb, (xs) << 1, rb, XCAT(id, a)); \
246-
FFT64((xb) + (xs), (xs) << 1, (rb) + 64, XCAT(id, b)); \
247-
FFT_LOOP(rb, 64, 2, id); \
248-
} while (0)
249-
250-
#endif
251-
252216
/*
253217
* For SIMD-384 / SIMD-512, the fully unrolled FFT yields a compression
254218
* function which does not fit in the 32 kB L1 cache of a typical x86

0 commit comments

Comments
 (0)