Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit ed16200

Browse files
committed
Minor definitions updated #3
1 parent 1a175a3 commit ed16200

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

include/nil/crypto3/detail/basic_functions.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ namespace nil {
109109
}
110110

111111
static inline word_type rotr(word_type x, std::size_t n) {
112-
#if defined(BOOST_ARCH_X86)
112+
#if BOOST_ARCH_X86
113113
asm("rorl %1,%0" : "+r"(x) : "c"(static_cast<uint8_t>(n)));
114114
return x;
115115
#else
@@ -123,7 +123,7 @@ namespace nil {
123123
}
124124

125125
static inline word_type rotl(word_type x, std::size_t n) {
126-
#if defined(BOOST_ARCH_X86)
126+
#if BOOST_ARCH_X86
127127
asm("roll %1,%0" : "+r"(x) : "c"(static_cast<uint8_t>(n)));
128128
return x;
129129
#else

include/nil/crypto3/detail/reverser.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,13 @@ namespace nil {
6262
*/
6363
inline void reverse_byte(byte_type &b) {
6464

65+
#ifdef BOOST_ARCH_CURRENT_WORD_BITS
6566
#if (BOOST_ARCH_CURRENT_WORD_BITS == 32)
6667
b = unbounded_shr<16>(((b * 0x0802LU & 0x22110LU) | (b * 0x8020LU & 0x88440LU)) * 0x10101LU);
6768
#elif (BOOST_ARCH_CURRENT_WORD_BITS == 64)
6869
b = (b * 0x0202020202ULL & 0x010884422010ULL) % 1023;
69-
#else
70+
#endif
71+
#else
7072
#error "BOOST_ARCH_CURRENT_WORD_BITS not set"
7173
#endif
7274
}

0 commit comments

Comments
 (0)