Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions include/nil/crypto3/detail/pack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <boost/static_assert.hpp>
#include <boost/predef/other/endian.h>
#include <boost/predef/architecture.h>

#include <algorithm>
#include <climits>
Expand Down Expand Up @@ -573,11 +574,11 @@ namespace nil {
InputType, OutputType>
packer_type;
#elif defined(BOOST_ENDIAN_BIG_WORD_AVAILABLE)
typedef packer<stream_endian::big_unit_big_bit<CRYPTO3_MP_WORD_BITS>, OutputEndianness, InputValueBits,
typedef packer<stream_endian::big_unit_big_bit<BOOST_ARCH_CURRENT_WORD_BITS>, OutputEndianness, InputValueBits,
OutputValueBits, InputType, OutputType>
packer_type;
#elif defined(BOOST_ENDIAN_LITTLE_WORD_AVAILABLE)
typedef packer<stream_endian::little_unit_big_bit<CRYPTO3_MP_WORD_BITS>, OutputEndianness,
typedef packer<stream_endian::little_unit_big_bit<BOOST_ARCH_CURRENT_WORD_BITS>, OutputEndianness,
InputValueBits, OutputValueBits, InputType, OutputType>
packer_type;
#else
Expand Down Expand Up @@ -621,11 +622,11 @@ namespace nil {
InputType, OutputType>
packer_type;
#elif defined(BOOST_ENDIAN_BIG_WORD_AVAILABLE)
typedef packer<InputEndianness, stream_endian::big_unit_big_bit<CRYPTO3_MP_WORD_BITS>, InputValueBits,
typedef packer<InputEndianness, stream_endian::big_unit_big_bit<BOOST_ARCH_CURRENT_WORD_BITS>, InputValueBits,
OutputValueBits, InputType, OutputType>
packer_type;
#elif defined(BOOST_ENDIAN_LITTLE_WORD_AVAILABLE)
typedef packer<InputEndianness, stream_endian::little_unit_big_bit<CRYPTO3_MP_WORD_BITS>,
typedef packer<InputEndianness, stream_endian::little_unit_big_bit<BOOST_ARCH_CURRENT_WORD_BITS>,
InputValueBits, OutputValueBits, InputType, OutputType>
packer_type;
#else
Expand Down
9 changes: 4 additions & 5 deletions include/nil/crypto3/detail/reverser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include <boost/integer.hpp>
#include <boost/static_assert.hpp>
#include <boost/endian/conversion.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/predef/architecture.h>

#include <nil/crypto3/detail/unbounded_shift.hpp>
#include <nil/crypto3/detail/stream_endian.hpp>
Expand Down Expand Up @@ -46,12 +45,12 @@ namespace nil {
*/
inline void reverse_byte(byte_type &b) {

#if (CRYPTO3_MP_WORD_BITS == 32)
#if (BOOST_ARCH_CURRENT_WORD_BITS == 32)
b = unbounded_shr<16>(((b * 0x0802LU & 0x22110LU) | (b * 0x8020LU & 0x88440LU)) * 0x10101LU);
#elif (CRYPTO3_MP_WORD_BITS == 64)
#elif (BOOST_ARCH_CURRENT_WORD_BITS == 64)
b = (b * 0x0202020202ULL & 0x010884422010ULL) % 1023;
#else
#warning "CRYPTO3_MP_WORD_BITS not set"
#warning "BOOST_ARCH_CURRENT_WORD_BITS not set"
#endif
}

Expand Down