Skip to content

Commit

Permalink
Remove ASM impl from rijndael, fix macOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
x-mass committed May 22, 2024
1 parent 62e56de commit 10944fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/nil/crypto3/block/detail/rijndael/rijndael_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ namespace nil {
tmp[i] = state[i * policy_type::word_bytes + row];
}

for (std::size_t i = 0; i < policy_type::block_words - 1; ++i) {
for (std::size_t i = 0; i < policy_type::block_words - off; ++i) {
state[i * policy_type::word_bytes + row] =
state[(i + off) * policy_type::word_bytes + row];
}

for (std::size_t i = 0; i < off; ++i) {
state[(policy_type::block_words - 1 - i) * policy_type::word_bytes + row] =
tmp[off - 1 - i];
state[(policy_type::block_words - off + i) * policy_type::word_bytes + row] =
tmp[i];
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions include/nil/crypto3/block/rijndael.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@

#include <nil/crypto3/block/detail/rijndael/rijndael_ssse3_impl.hpp>

#elif defined(CRYPTO3_HAS_RIJNDAEL_ARMV8) || BOOST_ARCH_ARM
// #elif defined(CRYPTO3_HAS_RIJNDAEL_ARMV8) || BOOST_ARCH_ARM

#include <nil/crypto3/block/detail/rijndael/rijndael_armv8_impl.hpp>
// #include <nil/crypto3/block/detail/rijndael/rijndael_armv8_impl.hpp>

#elif defined(CRYPTO3_HAS_RIJNDAEL_POWER8)

Expand Down Expand Up @@ -128,8 +128,8 @@ namespace nil {
#elif defined(CRYPTO3_HAS_RIJNDAEL_SSSE3) && \
((BOOST_ARCH_X86_32 || BOOST_ARCH_X86_64) && BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSSE3_VERSION)
detail::rijndael_ssse3_impl<KeyBits, BlockBits>,
#elif defined(CRYPTO3_HAS_RIJNDAEL_ARMV8) || BOOST_ARCH_ARM >= BOOST_VERSION_NUMBER(8, 0, 0)
detail::rijndael_armv8_impl<KeyBits, BlockBits>,
// #elif defined(CRYPTO3_HAS_RIJNDAEL_ARMV8) || BOOST_ARCH_ARM >= BOOST_VERSION_NUMBER(8, 0, 0)
// detail::rijndael_armv8_impl<KeyBits, BlockBits>,
#elif defined(CRYPTO3_HAS_RIJNDAEL_POWER8) || (BOOST_ARCH_PPC >= BOOST_VERSION_NUMBER(8, 0, 0) || BOOST_ARCH_PPC_64)
detail::rijndael_power8_impl<KeyBits, BlockBits>,
#else
Expand Down
4 changes: 2 additions & 2 deletions test/rijndael.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ std::basic_ostream<charT, traits> &operator<<(std::basic_ostream<charT, traits>
byte_string::size_type bufsize = s.size() * 2 + 1;
char buf[bufsize];
for (byte_string::size_type i = 0; i < s.size(); ++i) {
std::sprintf(buf + i * 2, "%02x", s[i]);
std::snprintf(buf + i * 2, 3, "%02x", static_cast<unsigned char>(s[i]));
}
buf[bufsize - 1] = '\0';
out << buf;
Expand Down Expand Up @@ -443,4 +443,4 @@ BOOST_AUTO_TEST_CASE(aes_128_with_array_8) {
f.check_decrypt();
}
BOOST_AUTO_TEST_SUITE_END()*/
BOOST_AUTO_TEST_SUITE_END()*/

0 comments on commit 10944fa

Please sign in to comment.