diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/sha/sha3.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libcrypto/sha/sha3.c b/src/lib/libcrypto/sha/sha3.c index 4611ef0001..043fcbe774 100644 --- a/src/lib/libcrypto/sha/sha3.c +++ b/src/lib/libcrypto/sha/sha3.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sha3.c,v 1.17 2025/04/18 07:19:48 jsing Exp $ */ | 1 | /* $OpenBSD: sha3.c,v 1.18 2025/04/18 07:23:53 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * The MIT License (MIT) | 3 | * The MIT License (MIT) |
4 | * | 4 | * |
@@ -53,7 +53,7 @@ static const int sha3_keccakf_piln[24] = { | |||
53 | static void | 53 | static void |
54 | sha3_keccakf(uint64_t st[25]) | 54 | sha3_keccakf(uint64_t st[25]) |
55 | { | 55 | { |
56 | uint64_t t, bc[5]; | 56 | uint64_t t0, t1, bc[5]; |
57 | int i, j, r; | 57 | int i, j, r; |
58 | 58 | ||
59 | for (i = 0; i < 25; i++) | 59 | for (i = 0; i < 25; i++) |
@@ -66,18 +66,18 @@ sha3_keccakf(uint64_t st[25]) | |||
66 | bc[i] = st[i] ^ st[i + 5] ^ st[i + 10] ^ st[i + 15] ^ st[i + 20]; | 66 | bc[i] = st[i] ^ st[i + 5] ^ st[i + 10] ^ st[i + 15] ^ st[i + 20]; |
67 | 67 | ||
68 | for (i = 0; i < 5; i++) { | 68 | for (i = 0; i < 5; i++) { |
69 | t = bc[(i + 4) % 5] ^ crypto_rol_u64(bc[(i + 1) % 5], 1); | 69 | t0 = bc[(i + 4) % 5] ^ crypto_rol_u64(bc[(i + 1) % 5], 1); |
70 | for (j = 0; j < 25; j += 5) | 70 | for (j = 0; j < 25; j += 5) |
71 | st[j + i] ^= t; | 71 | st[j + i] ^= t0; |
72 | } | 72 | } |
73 | 73 | ||
74 | /* Rho Pi */ | 74 | /* Rho Pi */ |
75 | t = st[1]; | 75 | t0 = st[1]; |
76 | for (i = 0; i < 24; i++) { | 76 | for (i = 0; i < 24; i++) { |
77 | j = sha3_keccakf_piln[i]; | 77 | j = sha3_keccakf_piln[i]; |
78 | bc[0] = st[j]; | 78 | t1 = st[j]; |
79 | st[j] = crypto_rol_u64(t, sha3_keccakf_rotc[i]); | 79 | st[j] = crypto_rol_u64(t0, sha3_keccakf_rotc[i]); |
80 | t = bc[0]; | 80 | t0 = t1; |
81 | } | 81 | } |
82 | 82 | ||
83 | /* Chi */ | 83 | /* Chi */ |