Skip to content

Commit

Permalink
Temporarily disable ASM code for keccak, it gives illegal instruction…
Browse files Browse the repository at this point in the history
… error on mac, and sometimes break tests on clang-16. Will enable back when/if this ASM codes are fixed for all architectures.
  • Loading branch information
martun authored and x-mass committed Apr 29, 2024
1 parent 764b0f1 commit 70253f6
Showing 1 changed file with 32 additions and 30 deletions.
62 changes: 32 additions & 30 deletions include/nil/crypto3/hash/detail/keccak/keccak_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
#include <nil/crypto3/hash/detail/keccak/keccak_policy.hpp>
#include <nil/crypto3/hash/detail/keccak/keccak_impl.hpp>

#if BOOST_ARCH_X86_64
#if defined(CRYPTO3_HAS_AVX512)
#include <nil/crypto3/hash/detail/keccak/keccak_avx512_impl.hpp>
#else
#if defined(CRYPTO3_HAS_AVX2)
#include <nil/crypto3/hash/detail/keccak/keccak_avx2_impl.hpp>
#else
#include <nil/crypto3/hash/detail/keccak/keccak_x86_64_impl.hpp>
#endif
#endif
#elif BOOST_ARCH_ARM
#include <nil/crypto3/hash/detail/keccak/keccak_armv8_impl.hpp>
#endif
//#if BOOST_ARCH_X86_64
//#if defined(CRYPTO3_HAS_AVX512)
//#include <nil/crypto3/hash/detail/keccak/keccak_avx512_impl.hpp>
//#else
//#if defined(CRYPTO3_HAS_AVX2)
//#include <nil/crypto3/hash/detail/keccak/keccak_avx2_impl.hpp>
//#else
//#include <nil/crypto3/hash/detail/keccak/keccak_x86_64_impl.hpp>
//#endif
//#endif
//#elif BOOST_ARCH_ARM
//#include <nil/crypto3/hash/detail/keccak/keccak_armv8_impl.hpp>
//#endif

namespace nil {
namespace crypto3 {
Expand All @@ -59,23 +59,25 @@ namespace nil {

typedef typename policy_type::state_type state_type;

typedef typename std::conditional<word_bits == 64,
#if BOOST_ARCH_X86_64
#if defined(CRYPTO3_HAS_AVX512)
keccak_1600_avx512_impl<policy_type>,
#else
#if defined(CRYPTO3_HAS_AVX2)
keccak_1600_avx2_impl<policy_type>,
#else
keccak_1600_x86_64_impl<policy_type>,
#endif
#endif
#elif BOOST_ARCH_ARM && BOOST_ARCH_ARM >= BOOST_VERSION_NUMBER(8, 0, 0)
keccak_1600_armv8_impl<policy_type>,
#else
keccak_1600_impl<policy_type>,
#endif
keccak_1600_impl<policy_type>>::type impl_type;
// typedef typename std::conditional<word_bits == 64,
//#if BOOST_ARCH_X86_64
//#if defined(CRYPTO3_HAS_AVX512)
// keccak_1600_avx512_impl<policy_type>,
//#else
//#if defined(CRYPTO3_HAS_AVX2)
// keccak_1600_avx2_impl<policy_type>,
//#else
// keccak_1600_x86_64_impl<policy_type>,
//#endif
//#endif
//#elif BOOST_ARCH_ARM && BOOST_ARCH_ARM >= BOOST_VERSION_NUMBER(8, 0, 0)
// keccak_1600_armv8_impl<policy_type>,
//#else
// keccak_1600_impl<policy_type>,
//#endif
// keccak_1600_impl<policy_type>>::type impl_type;

typedef keccak_1600_impl<policy_type> impl_type;

typedef keccak_1600_impl<policy_type> const_impl_type;

Expand Down

0 comments on commit 70253f6

Please sign in to comment.