aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/hash
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-01-30 14:15:22 -0500
committerJack Lloyd <[email protected]>2018-01-30 14:15:22 -0500
commit5260041e76162b0c8d89f0053cf6382b828d363d (patch)
tree3061087cf9df5d7e7ceb969a361d71d2fbe0d3f6 /src/lib/hash
parent4d3f7ebb72339a85ed3eb39d5428512405320042 (diff)
Use copy_out_vec_le instead of explicit loop in SHA-3 and Keccak
Diffstat (limited to 'src/lib/hash')
-rw-r--r--src/lib/hash/keccak/keccak.cpp3
-rw-r--r--src/lib/hash/sha3/sha3.cpp3
2 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/hash/keccak/keccak.cpp b/src/lib/hash/keccak/keccak.cpp
index a4d4cef7d..f79a7f3ce 100644
--- a/src/lib/hash/keccak/keccak.cpp
+++ b/src/lib/hash/keccak/keccak.cpp
@@ -59,8 +59,7 @@ void Keccak_1600::final_result(uint8_t output[])
* We never have to run the permutation again because we only support
* limited output lengths
*/
- for(size_t i = 0; i != m_output_bits/8; ++i)
- output[i] = get_byte(7 - (i % 8), m_S[i/8]);
+ copy_out_vec_le(output, m_output_bits/8, m_S);
clear();
}
diff --git a/src/lib/hash/sha3/sha3.cpp b/src/lib/hash/sha3/sha3.cpp
index 0fd980b33..d1d3f7d2e 100644
--- a/src/lib/hash/sha3/sha3.cpp
+++ b/src/lib/hash/sha3/sha3.cpp
@@ -227,8 +227,7 @@ void SHA_3::final_result(uint8_t output[])
* We never have to run the permutation again because we only support
* limited output lengths
*/
- for(size_t i = 0; i != m_output_bits/8; ++i)
- output[i] = get_byte(7 - (i % 8), m_S[i/8]);
+ copy_out_vec_le(output, m_output_bits/8, m_S);
clear();
}