aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/block/threefish_avx2/threefish_avx2.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-09-17 14:20:03 -0400
committerJack Lloyd <[email protected]>2016-09-17 14:20:03 -0400
commitd734198074d0290631e27d1fb27dce45f0676d58 (patch)
treefaed46aaae836e44e972a4e6d5bdea06b0729034 /src/lib/block/threefish_avx2/threefish_avx2.cpp
parent272fcf00572432f64085b10132e364740d7eb093 (diff)
parent2b7f2d52d032ad56526d38e7f65bd966ac59325a (diff)
Merge GH #623 Merge algorithm impl types
If CPU specific optimizations are available they are always used, without requiring the application to use the application registry to ensure they get the optimal type. See also GH #477
Diffstat (limited to 'src/lib/block/threefish_avx2/threefish_avx2.cpp')
-rw-r--r--src/lib/block/threefish_avx2/threefish_avx2.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/block/threefish_avx2/threefish_avx2.cpp b/src/lib/block/threefish_avx2/threefish_avx2.cpp
index 9b808a221..e0321812a 100644
--- a/src/lib/block/threefish_avx2/threefish_avx2.cpp
+++ b/src/lib/block/threefish_avx2/threefish_avx2.cpp
@@ -5,8 +5,7 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/threefish_avx2.h>
-#include <botan/cpuid.h>
+#include <botan/threefish.h>
#include <immintrin.h>
namespace Botan {
@@ -38,7 +37,8 @@ inline void rotate_keys(__m256i& R0, __m256i& R1, __m256i R2)
{
/*
Behold. The key schedule progresses like so. The values
- loop back to the originals after the rounds are complete.
+ loop back to the originals after the rounds are complete
+ so we don't need to reload for starting the next block.
R0 R1 R2
K1,K2,K3 (7,5,3,1),(8,6,4,2),(0,7,5,3)
@@ -71,7 +71,7 @@ inline void rotate_keys(__m256i& R0, __m256i& R1, __m256i R2)
}
-void Threefish_512_AVX2::encrypt_n(const byte in[], byte out[], size_t blocks) const
+void Threefish_512::avx2_encrypt_n(const byte in[], byte out[], size_t blocks) const
{
const u64bit* K = &get_K()[0];
const u64bit* T_64 = &get_T()[0];
@@ -245,7 +245,7 @@ void Threefish_512_AVX2::encrypt_n(const byte in[], byte out[], size_t blocks) c
#undef THREEFISH_INJECT_KEY_2
}
-void Threefish_512_AVX2::decrypt_n(const byte in[], byte out[], size_t blocks) const
+void Threefish_512::avx2_decrypt_n(const byte in[], byte out[], size_t blocks) const
{
const u64bit* K = &get_K()[0];
const u64bit* T_64 = &get_T()[0];