Skip to content

Commit

Permalink
Merge GH #3299 Remove Threefish-512 AVX2 implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
randombit committed Feb 17, 2023
2 parents 998d74e + 84e8894 commit 9574cb1
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 514 deletions.
1 change: 0 additions & 1 deletion src/build-data/botan.doxy.in
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ PREDEFINED = BOTAN_HAS_AES_ARMV8 \
BOTAN_HAS_SHACAL2_ARMV8 \
BOTAN_HAS_SHACAL2_X86 \
BOTAN_HAS_SM4_ARMV8 \
BOTAN_HAS_THREEFISH_512_AVX2 \
BOTAN_HAS_ARGON2_SSSE3 \
BOTAN_HAS_ARGON2_AVX2 \
BOTAN_HAS_ZFEC_SSE2 \
Expand Down
1 change: 0 additions & 1 deletion src/build-data/policy/bsi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ shacal2_x86
sm4
sm4_armv8
threefish_512
threefish_512_avx2
twofish

# modes
Expand Down
1 change: 0 additions & 1 deletion src/build-data/policy/modern.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ aes_armv8
aes_power8
serpent_simd
serpent_avx2
threefish_512_avx2
chacha_simd32
chacha_avx2

Expand Down
1 change: 0 additions & 1 deletion src/build-data/policy/nist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ shacal2
shacal2_x86
shacal2_simd
threefish_512
threefish_512_avx2
twofish

# modes
Expand Down
38 changes: 0 additions & 38 deletions src/lib/block/threefish_512/threefish_512.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,43 +181,12 @@ void Threefish_512::skein_feedfwd(const secure_vector<uint64_t>& M,
m_K[4] ^ m_K[5] ^ m_K[6] ^ m_K[7] ^ 0x1BD11BDAA9FC1A22;
}

size_t Threefish_512::parallelism() const
{
#if defined(BOTAN_HAS_THREEFISH_512_AVX2)
if(CPUID::has_avx2())
{
return 2;
}
#endif

return 1;
}

std::string Threefish_512::provider() const
{
#if defined(BOTAN_HAS_THREEFISH_512_AVX2)
if(CPUID::has_avx2())
{
return "avx2";
}
#endif

return "base";
}

void Threefish_512::encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
{
using namespace Threefish_F;

assert_key_material_set();

#if defined(BOTAN_HAS_THREEFISH_512_AVX2)
if(CPUID::has_avx2())
{
return avx2_encrypt_n(in, out, blocks);
}
#endif

const Key_Inserter key(m_K.data(), m_T.data());

BOTAN_PARALLEL_SIMD_FOR(size_t i = 0; i < blocks; ++i)
Expand Down Expand Up @@ -249,13 +218,6 @@ void Threefish_512::decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks)

assert_key_material_set();

#if defined(BOTAN_HAS_THREEFISH_512_AVX2)
if(CPUID::has_avx2())
{
return avx2_decrypt_n(in, out, blocks);
}
#endif

const Key_Inserter key(m_K.data(), m_T.data());

BOTAN_PARALLEL_SIMD_FOR(size_t i = 0; i < blocks; ++i)
Expand Down
8 changes: 0 additions & 8 deletions src/lib/block/threefish_512/threefish_512.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,11 @@ class Threefish_512 final :
void set_tweak(const uint8_t tweak[], size_t len) override;

void clear() override;
std::string provider() const override;
std::string name() const override { return "Threefish-512"; }
std::unique_ptr<BlockCipher> new_object() const override { return std::make_unique<Threefish_512>(); }
size_t parallelism() const override;
bool has_keying_material() const override;

private:

#if defined(BOTAN_HAS_THREEFISH_512_AVX2)
void avx2_encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const;
void avx2_decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const;
#endif

void key_schedule(const uint8_t key[], size_t key_len) override;

// Interface for Skein
Expand Down
19 changes: 0 additions & 19 deletions src/lib/block/threefish_512/threefish_512_avx2/info.txt

This file was deleted.

Loading

0 comments on commit 9574cb1

Please sign in to comment.