Merge branch 'master' into hmqv
commit
170441cd8b
4
config.h
4
config.h
|
|
@ -405,6 +405,8 @@ NAMESPACE_END
|
|||
# pragma GCC diagnostic ignored "-Wunused-function"
|
||||
#endif
|
||||
|
||||
// You may need to force include a C++ header on Android when using STLPort to ensure
|
||||
// _STLPORT_VERSION is defined: CXXFLAGS="-DNDEBUG -g2 -O2 -std=c++11 -include iosfwd"
|
||||
// TODO: Figure out C++17 and lack of std::uncaught_exception
|
||||
#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || (defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x450) || defined(_STLP_NO_UNCAUGHT_EXCEPT_SUPPORT)))
|
||||
#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
|
||||
|
|
@ -756,7 +758,7 @@ NAMESPACE_END
|
|||
// Intel and C++11 language features, http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler
|
||||
// GCC and C++11 language features, http://gcc.gnu.org/projects/cxx0x.html
|
||||
// Clang and C++11 language features, http://clang.llvm.org/cxx_status.html
|
||||
#if (_MSC_VER >= 1600) || (__cplusplus >= 201103L)
|
||||
#if ((_MSC_VER >= 1600) || (__cplusplus >= 201103L)) && !defined(_STLPORT_VERSION)
|
||||
# define CRYPTOPP_CXX11 1
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -756,7 +756,7 @@ NAMESPACE_END
|
|||
// Intel and C++11 language features, http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler
|
||||
// GCC and C++11 language features, http://gcc.gnu.org/projects/cxx0x.html
|
||||
// Clang and C++11 language features, http://clang.llvm.org/cxx_status.html
|
||||
#if (_MSC_VER >= 1600) || (__cplusplus >= 201103L)
|
||||
#if ((_MSC_VER >= 1600) || (__cplusplus >= 201103L)) && !defined(_STLPORT_VERSION)
|
||||
# define CRYPTOPP_CXX11 1
|
||||
#endif
|
||||
|
||||
|
|
|
|||
15
misc.h
15
misc.h
|
|
@ -425,6 +425,21 @@ inline void memmove_s(void *dest, size_t sizeInBytes, const void *src, size_t co
|
|||
|
||||
#endif // __STDC_WANT_SECURE_LIB__
|
||||
|
||||
//! \brief Swaps two variables which are arrays
|
||||
//! \param a the first value
|
||||
//! \param b the second value
|
||||
//! \details C++03 does not provide support for <tt>std::swap(__m128i a, __m128i b)</tt>
|
||||
//! because <tt>__m128i</tt> is an <tt>unsigned long long[2]</tt>. Most compilers
|
||||
//! support it out of the box, but Sun Studio C++ compilers 12.2 and 12.3 do not.
|
||||
//! \sa <A HREF="http://stackoverflow.com/q/38417413">How to swap two __m128i variables
|
||||
//! in C++03 given its an opaque type and an array?</A> on Stack Overflow.
|
||||
template <class T>
|
||||
inline void vec_swap(T& a, T& b)
|
||||
{
|
||||
T t;
|
||||
t=a, a=b, b=t;
|
||||
}
|
||||
|
||||
//! \brief Memory block initializer and eraser that attempts to survive optimizations
|
||||
//! \param ptr pointer to the memory block being written
|
||||
//! \param value the integer value to write for each byte
|
||||
|
|
|
|||
|
|
@ -275,11 +275,9 @@ void Rijndael::Base::UncheckedSetKey(const byte *userKey, unsigned int keylen, c
|
|||
unsigned int i, j;
|
||||
|
||||
#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x5120)
|
||||
// __m128i is an unsigned long long[2], and support for swapping it was not formally added until C++11.
|
||||
// __m128i is an unsigned long long[2], and support for swapping it was not added until C++11.
|
||||
// SunCC 12.1 - 12.3 fail to consume the swap; while SunCC 12.4 consumes it without -std=c++11.
|
||||
__m128i t = *(__m128i *)(rk);
|
||||
*(__m128i *)(rk) = *(__m128i *)(rk+4*m_rounds);
|
||||
*(__m128i *)(rk+4*m_rounds) = t;
|
||||
vec_swap(*(__m128i *)(rk), *(__m128i *)(rk+4*m_rounds));
|
||||
#else
|
||||
std::swap(*(__m128i *)(void *)(rk), *(__m128i *)(void *)(rk+4*m_rounds));
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue