Merge branch 'master' into atomics
commit
d2fada4417
26
GNUmakefile
26
GNUmakefile
|
|
@ -22,7 +22,8 @@ IS_X86 := $(shell uname -m | $(EGREP) -v "x86_64" | $(EGREP) -i -c "i.86|x86|i86
|
||||||
IS_X32 ?= 0
|
IS_X32 ?= 0
|
||||||
IS_X86_64 := $(shell uname -m | $(EGREP) -i -c "(_64|d64)")
|
IS_X86_64 := $(shell uname -m | $(EGREP) -i -c "(_64|d64)")
|
||||||
IS_PPC := $(shell uname -m | $(EGREP) -i -c "ppc|power")
|
IS_PPC := $(shell uname -m | $(EGREP) -i -c "ppc|power")
|
||||||
IS_AARCH64 := $(shell uname -m | $(EGREP) -i -c "aarch64")
|
IS_ARM32 := $(shell uname -m | $(EGREP) -i -c "arm")
|
||||||
|
IS_ARM64 := $(shell uname -m | $(EGREP) -i -c "aarch64")
|
||||||
|
|
||||||
IS_SUN := $(shell uname | $(EGREP) -i -c "SunOS")
|
IS_SUN := $(shell uname | $(EGREP) -i -c "SunOS")
|
||||||
IS_LINUX := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c "Linux")
|
IS_LINUX := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c "Linux")
|
||||||
|
|
@ -325,9 +326,13 @@ endif # HAS_SOLIB_VERSION
|
||||||
# is the second candidate for explicit initialization order.
|
# is the second candidate for explicit initialization order.
|
||||||
SRCS := cryptlib.cpp cpu.cpp $(filter-out cryptlib.cpp cpu.cpp pch.cpp simple.cpp winpipes.cpp cryptlib_bds.cpp,$(wildcard *.cpp))
|
SRCS := cryptlib.cpp cpu.cpp $(filter-out cryptlib.cpp cpu.cpp pch.cpp simple.cpp winpipes.cpp cryptlib_bds.cpp,$(wildcard *.cpp))
|
||||||
|
|
||||||
# No need for CPU or RDRAND on non-X86 systems. X32 is represented with X64.
|
# Need CPU for X86/X64/X32 and ARM
|
||||||
|
ifeq ($(IS_X86)$(IS_X86_64)$(IS_ARM32)$(IS_ARM64),0000)
|
||||||
|
SRCS := $(filter-out cpu.cpp, $(SRCS))
|
||||||
|
endif
|
||||||
|
# Need RDRAND for X86/X64/X32
|
||||||
ifeq ($(IS_X86)$(IS_X86_64),00)
|
ifeq ($(IS_X86)$(IS_X86_64),00)
|
||||||
SRCS := $(filter-out cpu.cpp rdrand.cpp, $(SRCS))
|
SRCS := $(filter-out rdrand.cpp, $(SRCS))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(IS_MINGW),0)
|
ifneq ($(IS_MINGW),0)
|
||||||
|
|
@ -522,16 +527,16 @@ ifeq ($(HAS_SOLIB_VERSION),1)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libcryptopp.a: $(LIBOBJS) | public_service
|
libcryptopp.a: $(LIBOBJS) | config_warning
|
||||||
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
|
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||||
.PHONY: libcryptopp.so
|
.PHONY: libcryptopp.so
|
||||||
libcryptopp.so: libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
libcryptopp.so: libcryptopp.so$(SOLIB_VERSION_SUFFIX) | so_warning
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libcryptopp.so$(SOLIB_VERSION_SUFFIX): $(LIBOBJS) | public_service
|
libcryptopp.so$(SOLIB_VERSION_SUFFIX): $(LIBOBJS)
|
||||||
$(CXX) -shared $(SOLIB_FLAGS) -o $@ $(CXXFLAGS) $(LDFLAGS) $(LIBOBJS) $(LDLIBS)
|
$(CXX) -shared $(SOLIB_FLAGS) -o $@ $(CXXFLAGS) $(LDFLAGS) $(LIBOBJS) $(LDLIBS)
|
||||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||||
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.so
|
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.so
|
||||||
|
|
@ -541,7 +546,7 @@ endif
|
||||||
libcryptopp.dylib: $(LIBOBJS)
|
libcryptopp.dylib: $(LIBOBJS)
|
||||||
$(CXX) -dynamiclib -o $@ $(CXXFLAGS) -install_name "$@" -current_version "$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)" -compatibility_version "$(LIB_MAJOR).$(LIB_MINOR)" -headerpad_max_install_names $(LDFLAGS) $(LIBOBJS)
|
$(CXX) -dynamiclib -o $@ $(CXXFLAGS) -install_name "$@" -current_version "$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)" -compatibility_version "$(LIB_MAJOR).$(LIB_MINOR)" -headerpad_max_install_names $(LDFLAGS) $(LIBOBJS)
|
||||||
|
|
||||||
cryptest.exe: libcryptopp.a $(TESTOBJS) | public_service
|
cryptest.exe: libcryptopp.a $(TESTOBJS) | config_warning
|
||||||
$(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(LDLIBS)
|
$(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(LDLIBS)
|
||||||
|
|
||||||
# Makes it faster to test changes
|
# Makes it faster to test changes
|
||||||
|
|
@ -673,8 +678,8 @@ endif
|
||||||
UNALIGNED_ACCESS := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_NO_UNALIGNED_DATA_ACCESS" config.h)
|
UNALIGNED_ACCESS := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_NO_UNALIGNED_DATA_ACCESS" config.h)
|
||||||
NO_INIT_PRIORITY := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_INIT_PRIORITY" config.h)
|
NO_INIT_PRIORITY := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_INIT_PRIORITY" config.h)
|
||||||
COMPATIBILITY_562 := $(shell $(EGREP) -c "^[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562" config.h)
|
COMPATIBILITY_562 := $(shell $(EGREP) -c "^[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562" config.h)
|
||||||
.PHONY: public_service
|
.PHONY: config_warning
|
||||||
public_service:
|
config_warning:
|
||||||
ifneq ($(UNALIGNED_ACCESS),0)
|
ifneq ($(UNALIGNED_ACCESS),0)
|
||||||
$(info WARNING: CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined in config.h.)
|
$(info WARNING: CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined in config.h.)
|
||||||
endif
|
endif
|
||||||
|
|
@ -690,6 +695,9 @@ ifneq ($(UNALIGNED_ACCESS)$(NO_INIT_PRIORITY)$(COMPATIBILITY_562),000)
|
||||||
$(info WARNING: See http://cryptopp.com/wiki/config.h for more details.)
|
$(info WARNING: See http://cryptopp.com/wiki/config.h for more details.)
|
||||||
$(info )
|
$(info )
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
.PHONY: so_warning
|
||||||
|
so_warning:
|
||||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||||
$(info WARNING: Only the symlinks to the shared-object library have been updated.)
|
$(info WARNING: Only the symlinks to the shared-object library have been updated.)
|
||||||
$(info WARNING: If the library is installed in a system directory you will need)
|
$(info WARNING: If the library is installed in a system directory you will need)
|
||||||
|
|
|
||||||
12
misc.h
12
misc.h
|
|
@ -2107,15 +2107,15 @@ private:
|
||||||
//! \tparam T class or type
|
//! \tparam T class or type
|
||||||
//! \tparam B enumeration indicating endianess
|
//! \tparam B enumeration indicating endianess
|
||||||
//! \tparam A flag indicating alignment
|
//! \tparam A flag indicating alignment
|
||||||
//! \details GetBlock() provides alternate write access to a block of memory. The enumeration B is
|
//! \details PutBlock() provides alternate write access to a block of memory. The enumeration B is
|
||||||
//! BigEndian or LittleEndian. The flag A indicates if the memory block is aligned for class or type T.
|
//! BigEndian or LittleEndian. The flag A indicates if the memory block is aligned for class or type T.
|
||||||
//! Repeatedly applying operator() results in advancing in the block of memory.
|
//! Repeatedly applying operator() results in advancing in the block of memory.
|
||||||
//! \details An example of reading two word32 values from a block of memory is shown below. <tt>w1</tt>
|
//! \details An example of writing two word32 values from a block of memory is shown below. After the code
|
||||||
//! will be <tt>0x03020100</tt> and <tt>w1</tt> will be <tt>0x07060504</tt>.
|
//! executes, the byte buffer will be <tt>{0,1,2,3,4,5,6,7}</tt>.
|
||||||
//! <pre>
|
//! <pre>
|
||||||
//! word32 w1, w2;
|
//! word32 w1=0x03020100, w2=0x07060504;
|
||||||
//! byte buffer[8] = {0,1,2,3,4,5,6,7};
|
//! byte buffer[8];
|
||||||
//! GetBlock<word32, LittleEndian> block(buffer);
|
//! PutBlock<word32, LittleEndian> block(NULL, buffer);
|
||||||
//! block(w1)(w2);
|
//! block(w1)(w2);
|
||||||
//! </pre>
|
//! </pre>
|
||||||
template <class T, class B, bool A=false>
|
template <class T, class B, bool A=false>
|
||||||
|
|
|
||||||
|
|
@ -217,9 +217,9 @@ void Rijndael::Base::UncheckedSetKey(const byte *userKey, unsigned int keylen, c
|
||||||
|
|
||||||
word32 *rk = m_key;
|
word32 *rk = m_key;
|
||||||
|
|
||||||
#if (CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE && (!defined(_MSC_VER) || _MSC_VER >= 1600 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32))
|
#if (CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE && CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE && (!defined(_MSC_VER) || _MSC_VER >= 1600 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32))
|
||||||
// MSVC 2008 SP1 generates bad code for _mm_extract_epi32() when compiling for X64
|
// MSVC 2008 SP1 generates bad code for _mm_extract_epi32() when compiling for X64
|
||||||
if (HasAESNI())
|
if (HasAESNI() && HasSSE4())
|
||||||
{
|
{
|
||||||
static const word32 rcLE[] = {
|
static const word32 rcLE[] = {
|
||||||
0x01, 0x02, 0x04, 0x08,
|
0x01, 0x02, 0x04, 0x08,
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ case "$THE_ARCH" in
|
||||||
TOOLNAME_BASE="arm-linux-androideabi"
|
TOOLNAME_BASE="arm-linux-androideabi"
|
||||||
AOSP_ABI="armeabi-v7a"
|
AOSP_ABI="armeabi-v7a"
|
||||||
AOSP_ARCH="arch-arm"
|
AOSP_ARCH="arch-arm"
|
||||||
AOSP_FLAGS="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -Wl,--fix-cortex-a8 -funwind-tables -fexceptions -frtti"
|
AOSP_FLAGS="-march=armv7-a -mfpu=neon -mfloat-abi=softfp -Wl,--fix-cortex-a8 -funwind-tables -fexceptions -frtti"
|
||||||
;;
|
;;
|
||||||
armv8|armv8a|aarch64|arm64|arm64-v8a)
|
armv8|armv8a|aarch64|arm64|arm64-v8a)
|
||||||
TOOLCHAIN_BASE="aarch64-linux-android"
|
TOOLCHAIN_BASE="aarch64-linux-android"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue