summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2013-01-15 20:50:41 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2013-01-15 20:50:41 (GMT)
commit8e7312e12fb088ba99f4f875903926f2ef9ed235 (patch)
tree14463200a24f1f8d416f093c48ce9ffd4e05a92e
parent5b7f50f37210706c0f508788991de88244c7b29b (diff)
downloadbusybox-8e7312e12fb088ba99f4f875903926f2ef9ed235.tar.gz
busybox-8e7312e12fb088ba99f4f875903926f2ef9ed235.tar.bz2
sha3: tweak choice of a fast code path for 64-bit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/hash_md5_sha.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libbb/hash_md5_sha.c b/libbb/hash_md5_sha.c
index 18e4260..7ae0b63 100644
--- a/libbb/hash_md5_sha.c
+++ b/libbb/hash_md5_sha.c
@@ -1057,7 +1057,7 @@ static void KeccakF(uint64_t *state)
/* Chi */
for (y = 0; y <= 20; y += 5) {
- if (SHA3_SMALL) {
+ if (SHA3_SMALL && !ARCH_IS_64BIT) {
uint64_t BC[5];
BC[0] = state[y + 0];
BC[1] = state[y + 1];
@@ -1071,6 +1071,7 @@ static void KeccakF(uint64_t *state)
}
} else {
/* 32-bit x86: +50 bytes code, 10% faster */
+ /* 64-bit x86: ~same code size, 30% faster */
uint64_t BC0, BC1, BC2, BC3, BC4;
BC0 = state[y + 0];
BC1 = state[y + 1];