Merge branch 'release/0.10' into develop

This commit is contained in:
Sebastian Messmer 2019-03-02 21:38:07 -08:00
commit 5596aa2a4f
135 changed files with 24073 additions and 2925 deletions

View File

@ -3,6 +3,10 @@ Version 0.10.1 (unreleased)
Fixed bugs:
* If file system migration encounters files or folders with the wrong format in the base directory, it now just ignores them instead of crashing.
* When trying to migrate a file system from CryFS 0.9.3 or older, show an error message suggesting to first open it with 0.9.10 because we can't load that anymore.
* The '--unmount-idle' parameter works again
Other:
* Updated to crypto++ 8.1
Version 0.10.0

View File

@ -52,15 +52,34 @@ namespace cpputils {
void ThreadSystem::_stopAllThreadsForRestart() {
_mutex.lock(); // Is unlocked in the after-fork handler. This way, the whole fork() is protected.
for (RunningThread &thread : _runningThreads) {
if (boost::this_thread::get_id() == thread.thread.get_id()) {
// This means fork was called from within one of our _runningThreads.
// We cannot wait or ourselves to die.
// Forking from within a thread is usually chaos since the forked process only gets a copy
// of the calling thread as its new main thread. So we (hopefully) never should do this.
// This is, however, a valid pattern when fork() is directly followed by an exec().
// So let's just ignore this situation and continue as if nothing happened, assuming an exec()
// follows soon.
continue;
}
thread.thread.interrupt();
}
for (RunningThread &thread : _runningThreads) {
if (boost::this_thread::get_id() == thread.thread.get_id()) {
// This means fork was called from within one of our _runningThreads. See comment above.
continue;
}
thread.thread.join();
}
}
void ThreadSystem::_restartAllThreads() {
for (RunningThread &thread : _runningThreads) {
if (thread.thread.joinable()) {
// Because all non-self threads have been terminated in _stopAllThreadsForRestart,
// this means fork was called from within one of our _runningThreads. See comment above.
continue;
}
thread.thread = _startThread(thread.loopIteration, thread.threadName);
}
_mutex.unlock(); // Was locked in the before-fork handler

View File

@ -252,7 +252,11 @@ namespace cryfs_cli {
ASSERT(_device != none, "File system not ready to be initialized. Was it already initialized before?");
//TODO Test auto unmounting after idle timeout
_idleUnmounter = _createIdleCallback(options.unmountAfterIdleMinutes(), [fs] {fs->stop();});
const boost::optional<double> idle_minutes = options.unmountAfterIdleMinutes();
_idleUnmounter = _createIdleCallback(idle_minutes, [fs, idle_minutes] {
LOG(INFO, "Unmounting because file system was idle for {} minutes", *idle_minutes);
fs->stop();
});
if (_idleUnmounter != none) {
(*_device)->onFsAction(std::bind(&CallAfterTimeout::resetTimer, _idleUnmounter->get()));
}

View File

@ -292,8 +292,11 @@ void Fuse::_removeAndWarnIfExists(vector<string> *fuseOptions, const std::string
}
void Fuse::_run(const bf::path &mountdir, const vector<string> &fuseOptions) {
#if defined(__GLIBC__)|| defined(__APPLE__) || defined(_MSC_VER)
// Avoid encoding errors for non-utf8 characters, see https://github.com/cryfs/cryfs/issues/247
// this is ifdef'd out for non-glibc linux, because musl doesn't handle this correctly.
bf::path::imbue(std::locale(std::locale(), new std::codecvt_utf8_utf16<wchar_t>()));
#endif
_mountdir = mountdir;

View File

@ -1,6 +1,8 @@
#include <cpp-utils/process/subprocess.h>
#include <gtest/gtest.h>
#include <cpp-utils/lock/ConditionBarrier.h>
using cpputils::Subprocess;
using cpputils::SubprocessError;
@ -98,3 +100,25 @@ TEST(SubprocessTest, Call_error5withoutput_output) {
TEST(SubprocessTest, Call_error5withoutput_exitcode) {
EXPECT_EQ(5, Subprocess::call(exit_with_message_and_status("hello", 5)).exitcode);
}
// TODO Move this test to a test suite for ThreadSystem/LoopThread
#include <cpp-utils/thread/LoopThread.h>
TEST(SubprocessTest, CallFromThreadSystemThread) {
cpputils::ConditionBarrier barrier;
cpputils::LoopThread thread(
[&barrier] () {
auto result = Subprocess::check_call(exit_with_message_and_status("hello", 0));
EXPECT_EQ(0, result.exitcode);
EXPECT_EQ("hello", result.output);
barrier.release();
return false; // don't run loop again
},
"child_thread"
);
thread.start();
barrier.wait();
thread.stop(); // just to make sure it's stopped before the test exits. Returning false above should already stop it, but we don't know when exactly. thread.stop() will block until it's actually stopped.
}

View File

@ -53,6 +53,7 @@ TEST(ThreadDebuggingTest_ThreadName, givenChildThread_whenGettingFromOutside_the
});
nameIsSet.wait();
set_thread_name("outer_thread_name"); // just to make sure the next line doesn't read the outer thread name
string name = get_thread_name(&child);
EXPECT_EQ("my_thread_name", name);

9
vendor/README vendored
View File

@ -1,11 +1,6 @@
This directory contains external projects, taken from the following locations:
googletest: https://github.com/google/googletest/tree/release-1.8.1
spdlog: https://github.com/gabime/spdlog/tree/v0.16.3/include/spdlog
cryptopp: https://github.com/weidai11/cryptopp/tree/CRYPTOPP_8_0_0
- changed: added CMakeLists.txt and cryptopp-config.cmake from https://github.com/noloader/cryptopp-cmake/tree/CRYPTOPP_8_0_0
cryptopp: https://github.com/weidai11/cryptopp/tree/CRYPTOPP_8_1_0
- changed: added CMakeLists.txt and cryptopp-config.cmake from https://github.com/noloader/cryptopp-cmake/tree/07a064d57d97477cb055f994a498f45425df0c1d
- changed: commented out line including winapifamily.h in CMakeLists.txt
- cherry-picked commits to get OpenMP for scrypt on Windows:
- https://github.com/weidai11/cryptopp/commit/aa043b38a7930725c31a0cd7016986d1c581c573
- https://github.com/weidai11/cryptopp/commit/672f5c7f3dad8ae12b2d0ce0940ccb7c8e257bf8
- https://github.com/weidai11/cryptopp/commit/7e96a283a3192d29aac5b60e5b4ff19248f00d9a
- https://github.com/weidai11/cryptopp/commit/ca32b63038d5f7b13e2e00809cd9184a1efe8c24

View File

@ -1,54 +0,0 @@
# Appveyor's documentation is at https://www.appveyor.com/docs/build-phase/,
# and a sample configuration file is at https://www.appveyor.com/docs/appveyor-yml/.
# I have to admit its a bit complex and I don't fully understand it.
version: 1.0.{build}
clone_depth: 3
skip_tags: true
configuration:
- Debug
- Release
platform:
- Win32
- x64
image:
- Visual Studio 2017
- Visual Studio 2015
- Visual Studio 2013
environment:
matrix:
- BUILD_MODE: MSBuild
# Disable build through solution file
build: off
# Build through commands in script below
test_script:
- ps: >-
msbuild /t:Build /p:platform="$env:platform" /p:configuration="$env:configuration" cryptlib.vcxproj
msbuild /t:Build /p:platform="$env:platform" /p:configuration="$env:configuration" cryptest.vcxproj
msbuild /t:CopyCryptestToRoot cryptest.vcxproj
.\cryptest.exe v
.\cryptest.exe tv all
notifications:
- provider: Email
to:
- cryptopp-build@googlegroups.com
on_build_success: true
on_build_failure: true

View File

@ -1 +0,0 @@
*.sh eol=lf

View File

@ -1,15 +0,0 @@
### Crypto++ Issue Report
Thanks for taking the time to report an issue. Reporting issues helps us improve stability and reliability for all users, so it is a valuable contribution.
Please do not ask questions in the bug tracker. Please ask questions on the Crypto++ Users List at http://groups.google.com/forum/#!forum/cryptopp-users.
There is a wiki page with information on filing useful bug reports. If you have some time please visit http://www.cryptopp.com/wiki/Bug_Report on the wiki. The executive summary is:
* State the operating system and version (Ubutnu 17 x86_64, Windows 7 Professional x64, etc)
* State the version of the Crypto++ library (Crypto++ 5.6.5, Master, etc)
* State how you built the library (Makefile, Cmake, distro, etc)
* Show a typical command line (the output of the compiler for cryptlib.cpp)
* Show the link command (the output of the linker for libcryptopp.so or cryptest.exe)
* Show the exact error message you are receiving (copy and paste it); or
* Clearly state the undesired behavior (and state the expected behavior)

View File

@ -1,3 +1,10 @@
####################################
# C++ generic ignore
# Allows you to use test.cxx and
# avoid getting in the way of things
####################################
*.cxx
####################
## Crypto++ specific
####################

View File

@ -1,149 +0,0 @@
language: cpp
os:
- linux
- osx
dist: trusty
sudo: required
# OS X only supports one image. Use the latest.
osx_image: xcode9.1
git:
depth: 3
compiler:
- clang
- gcc
env:
global:
- BUILD_JOBS=2
- ANDROID_HOME=$HOME/android/sdk
- ANDROID_NDK=$HOME/android/sdk/ndk-bundle
- ANDROID_SDK_ROOT=$ANDROID_HOME
- ANDROID_NDK_ROOT=$ANDROID_NDK
matrix:
- BUILD_MODE="all"
- BUILD_MODE="native"
- BUILD_MODE="no-asm"
- BUILD_MODE="debug"
- BUILD_MODE="asan"
- BUILD_MODE="ubsan"
matrix:
exclude:
# Skip GCC on OS X entirely
- os: osx
compiler: gcc
# Skip UBsan due to GCC 4.8
- os: linux
compiler: gcc
env: BUILD_MODE="ubsan"
# Skip UBsan due to Clang 3.4
- os: osx
compiler: clang
env: BUILD_MODE="ubsan"
include:
- os: linux
env:
- BUILD_MODE=android
- PLATFORM=armeabi
- os: linux
env:
- BUILD_MODE=android
- PLATFORM=armeabi-v7a
- os: linux
env:
- BUILD_MODE=android
- PLATFORM=armv7a-neon
- os: linux
env:
- BUILD_MODE=android
- PLATFORM=aarch64
- os: linux
env:
- BUILD_MODE=android
- PLATFORM=mipsel
- os: linux
env:
- BUILD_MODE=android
- PLATFORM=mipsel64
- os: linux
env:
- BUILD_MODE=android
- PLATFORM=x86
- os: linux
env:
- BUILD_MODE=android
- PLATFORM=x86_64
- os: osx
env:
- BUILD_MODE=ios
- PLATFORM=iPhoneOS
- os: osx
env:
- BUILD_MODE=ios
- PLATFORM=WatchOS
- os: osx
env:
- BUILD_MODE=ios
- PLATFORM=AppleTVOS
- os: osx
env:
- BUILD_MODE=ios
- PLATFORM=iPhoneSimulator
allow_failures:
- os: osx
env:
- BUILD_MODE=ios
- PLATFORM=WatchOS
before_install:
- |
if [[ "$BUILD_MODE" == "android" ]]; then
TestScripts/install-android.sh
fi
script:
- |
if [[ "$BUILD_MODE" == "ios" ]]; then
cp ./TestScripts/setenv-ios.sh .
TestScripts/cryptest-ios.sh
elif [[ "$BUILD_MODE" == "android" ]]; then
cp ./TestScripts/setenv-android.sh .
TestScripts/cryptest-android.sh
elif [[ "$BUILD_MODE" == "debug" ]]; then
CXXFLAGS="-DDEBUG -g2 -O1" make -j "$BUILD_JOBS"
./cryptest.exe v
./cryptest.exe tv all
else
make "$BUILD_MODE" -j "$BUILD_JOBS"
./cryptest.exe v
./cryptest.exe tv all
fi
# whitelist branches to avoid testing feature branches twice
branches:
only:
- master
addons:
sonarcloud: false
coverity_scan:
project:
name: "cryptopp"
build_command: "make -j 2"
notifications:
email:
recipients:
- cryptopp-build@googlegroups.com
on_success: always # default: change
on_failure: always # default: always

File diff suppressed because it is too large Load Diff

View File

@ -41,7 +41,7 @@ PROJECT_NAME = Crypto++
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 8.0
PROJECT_NUMBER = 8.1
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@ -18,6 +18,7 @@ aria.cpp
aria_simd.cpp
aria.h
argnames.h
arm_simd.h
asn.cpp
asn.h
authenc.cpp
@ -55,6 +56,8 @@ chacha.cpp
chacha_avx.cpp
chacha_simd.cpp
chacha.h
chachapoly.cpp
chachapoly.h
cham.cpp
cham_simd.cpp
cham.h
@ -146,6 +149,7 @@ gf256.cpp
gf256.h
gf2_32.cpp
gf2_32.h
gf2n_simd.cpp
gf2n.cpp
gf2n.h
gfpcrypt.cpp
@ -182,9 +186,9 @@ kalynatab.cpp
kalyna.cpp
kalyna.h
keccak.cpp
keccak_core.cpp
keccak_simd.cpp
keccak.h
keccakc.cpp
keccakc.h
lubyrack.h
lea.cpp
lea_simd.cpp
@ -305,6 +309,8 @@ sha3.h
shacal2.cpp
shacal2_simd.cpp
shacal2.h
shake.cpp
shake.h
shark.cpp
shark.h
sharkbox.cpp
@ -473,6 +479,7 @@ TestData/x25519v0.dat
TestData/x25519v1.dat
TestData/xtrdh171.dat
TestData/xtrdh342.dat
TestVectors/aead.txt
TestVectors/aes.txt
TestVectors/all.txt
TestVectors/aria.txt
@ -483,6 +490,7 @@ TestVectors/camellia.txt
TestVectors/ccm.txt
TestVectors/chacha.txt
TestVectors/chacha_tls.txt
TestVectors/chacha20poly1305.txt
TestVectors/cham.txt
TestVectors/cmac.txt
TestVectors/dlies.txt
@ -502,8 +510,9 @@ TestVectors/keccak.txt
TestVectors/lea.txt
TestVectors/mars.txt
TestVectors/nr.txt
TestVectors/ocb.txt
TestVectors/panama.txt
TestVectors/poly1305aes.txt
TestVectors/poly1305_tls.txt
TestVectors/rabbit.txt
TestVectors/Readme.txt
TestVectors/rsa_oaep.txt
@ -528,6 +537,7 @@ TestVectors/sha3_256_fips_202.txt
TestVectors/sha3_384_fips_202.txt
TestVectors/sha3_512_fips_202.txt
TestVectors/sha3_fips_202.txt
TestVectors/shake.txt
TestVectors/shacal2.txt
TestVectors/simeck.txt
TestVectors/simon.txt
@ -542,6 +552,7 @@ TestVectors/ttmac.txt
TestVectors/vmac.txt
TestVectors/wake.txt
TestVectors/whrlpool.txt
TestVectors/xchacha.txt
TestPrograms/test_32bit.cxx
TestPrograms/test_64bit.cxx
TestPrograms/test_arm_acle.cxx

View File

@ -24,21 +24,16 @@ RANLIB ?= ranlib
CP ?= cp
MV ?= mv
RM ?= rm -f
GREP ?= grep
CHMOD ?= chmod
MKDIR ?= mkdir -p
LN ?= ln -sf
LDCONF ?= /sbin/ldconfig -n
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
# Solaris provides a non-Posix grep at /usr/bin
ifneq ($(wildcard /usr/xpg4/bin/grep),)
GREP ?= /usr/xpg4/bin/grep
else
GREP ?= grep
GREP := /usr/xpg4/bin/grep
endif
# Attempt to determine target machine, fallback to "this" machine.
@ -67,6 +62,7 @@ ifeq ($(SYSTEMX),)
endif
IS_LINUX := $(shell echo "$(SYSTEMX)" | $(GREP) -i -c "Linux")
IS_HURD := $(shell echo "$(SYSTEMX)" | $(GREP) -i -c -E "GNU|Hurd")
IS_MINGW := $(shell echo "$(SYSTEMX)" | $(GREP) -i -c "MinGW")
IS_CYGWIN := $(shell echo "$(SYSTEMX)" | $(GREP) -i -c "Cygwin")
IS_DARWIN := $(shell echo "$(SYSTEMX)" | $(GREP) -i -c "Darwin")
@ -91,7 +87,7 @@ endif
# Enable shared object versioning for Linux and Solaris
HAS_SOLIB_VERSION ?= 0
ifneq ($(IS_LINUX)$(IS_SUN),00)
ifneq ($(IS_LINUX)$(IS_HURD)$(IS_SUN),000)
HAS_SOLIB_VERSION := 1
endif
@ -100,9 +96,9 @@ ifeq ($(wildcard adhoc.cpp),)
$(shell cp adhoc.cpp.proto adhoc.cpp)
endif
# Tell MacPorts and Homebrew GCC to use Clang integrated assembler
# Tell MacPorts and Homebrew GCC to use Clang integrated assembler (only on Intel-based Macs)
# http://github.com/weidai11/cryptopp/issues/190
ifeq ($(GCC_COMPILER)$(OSXPORT_COMPILER),11)
ifeq ($(GCC_COMPILER)$(OSXPORT_COMPILER)$(IS_PPC32)$(IS_PPC64),1100)
ifeq ($(findstring -Wa,-q,$(CXXFLAGS)),)
CXXFLAGS += -Wa,-q
endif
@ -126,6 +122,9 @@ ifeq ($(DETECT_FEATURES),1)
ifneq ($(strip $(TCXXFLAGS)),)
$(info Using testing flags: $(TCXXFLAGS))
endif
#TPROG = TestPrograms/test_cxx.cxx
#$(info Testing compile... )
#$(info $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 1>/dev/null))
endif
# Fixup AIX
@ -271,6 +270,7 @@ ifeq ($(DETECT_FEATURES),1)
ifeq ($(strip $(HAVE_OPT)),0)
ARIA_FLAG = $(SSSE3_FLAG)
CHAM_FLAG = $(SSSE3_FLAG)
KECCAK_FLAG = $(SSSE3_FLAG)
LEA_FLAG = $(SSSE3_FLAG)
SIMECK_FLAG = $(SSSE3_FLAG)
SIMON64_FLAG = $(SSSE3_FLAG)
@ -310,6 +310,7 @@ ifeq ($(DETECT_FEATURES),1)
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
GCM_FLAG = $(SSSE3_FLAG) $(CLMUL_FLAG)
GF2N_FLAG = $(CLMUL_FLAG)
SUN_LDFLAGS += $(CLMUL_FLAG)
else
CLMUL_FLAG =
@ -392,6 +393,13 @@ ifeq ($(DETECT_FEATURES),1)
endif
endif
# Drop to SSE2 if available
ifeq ($(GCM_FLAG),)
ifneq ($(SSE2_FLAG),)
GCM_FLAG = $(SSE2_FLAG)
endif
endif
# DETECT_FEATURES
endif
@ -521,6 +529,7 @@ ifeq ($(IS_ARMV8),1)
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ACLE_FLAG) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
GCM_FLAG = -march=armv8-a+crypto
GF2N_FLAG = -march=armv8-a+crypto
else
CXXFLAGS += -DCRYPTOPP_ARM_PMULL_AVAILABLE=0
endif
@ -616,6 +625,7 @@ ifeq ($(DETECT_FEATURES),1)
BLAKE2B_FLAG = $(POWER8_FLAG)
CRC_FLAG = $(POWER8_FLAG)
GCM_FLAG = $(POWER8_FLAG)
GF2N_FLAG = $(POWER8_FLAG)
AES_FLAG = $(POWER8_FLAG)
SHA_FLAG = $(POWER8_FLAG)
SHACAL2_FLAG = $(POWER8_FLAG)
@ -808,22 +818,22 @@ ifeq ($(IS_SUN)$(SUN_COMPILER),11)
endif # SunOS
# TODO: can we remove this since removing sockets?
ifneq ($(IS_MINGW),0)
LDLIBS += -lws2_32
endif
#ifneq ($(IS_MINGW),0)
# LDLIBS += -lws2_32
#endif
# TODO: can we remove this since removing sockets?
ifneq ($(IS_SUN),0)
LDLIBS += -lnsl -lsocket
endif
#ifneq ($(IS_SUN),0)
# LDLIBS += -lnsl -lsocket
#endif
ifeq ($(IS_LINUX),1)
ifneq ($(IS_LINUX)$(IS_HURD),00)
ifeq ($(findstring -fopenmp,$(CXXFLAGS)),-fopenmp)
ifeq ($(findstring -lgomp,$(LDLIBS)),)
LDLIBS += -lgomp
endif # LDLIBS
endif # OpenMP
endif # IS_LINUX
endif # IS_LINUX or IS_HURD
# Add -errtags=yes to get the name for a warning suppression
ifneq ($(SUN_COMPILER),0) # override flags for CC Sun C++ compiler
@ -1007,7 +1017,7 @@ ifeq ($(HAS_SOLIB_VERSION),1)
# Different patchlevels and minors are compatible since 6.1
SOLIB_COMPAT_SUFFIX=.$(LIB_MAJOR)
# Linux uses -Wl,-soname
ifeq ($(IS_LINUX),1)
ifneq ($(IS_LINUX)$(IS_HURD),00)
# Linux uses full version suffix for shared library
SOLIB_VERSION_SUFFIX=.$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)
SOLIB_FLAGS=-Wl,-soname,libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
@ -1122,9 +1132,13 @@ lcov coverage: cryptest.exe
lcov --base-directory . --directory . --zerocounters -q
./cryptest.exe v
./cryptest.exe tv all
./cryptest.exe b 0.25
lcov --base-directory . --directory . -c -o cryptest.info
lcov --remove cryptest.info "adhoc.cpp" "wait.*" "network.*" "socketft.*" "fips140.*" "*test.*" "bench*.cpp" "validat*.*" "/usr/*" -o cryptest.info
genhtml -o ./TestCoverage/ -t "cryptest.exe test coverage" --num-spaces 4 cryptest.info
lcov --remove cryptest.info "adhoc.*" -o cryptest.info
lcov --remove cryptest.info "fips140.*" -o cryptest.info
lcov --remove cryptest.info "*test.*" -o cryptest.info
lcov --remove cryptest.info "/usr/*" -o cryptest.info
genhtml -o ./TestCoverage/ -t "Crypto++ test coverage" --num-spaces 4 cryptest.info
# Travis CI and CodeCov rule
.PHONY: gcov codecov
@ -1218,11 +1232,14 @@ distclean: clean autotools-clean cmake-clean
.PHONY: install
install: cryptest.exe install-lib
@-$(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL_PROGRAM) cryptest.exe $(DESTDIR)$(BINDIR)
$(CP) cryptest.exe $(DESTDIR)$(BINDIR)
$(CHMOD) 0755 $(DESTDIR)$(BINDIR)/cryptest.exe
@-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestData
@-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
$(INSTALL_DATA) TestData/*.dat $(DESTDIR)$(DATADIR)/cryptopp/TestData
$(INSTALL_DATA) TestVectors/*.txt $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
$(CP) TestData/*.dat $(DESTDIR)$(DATADIR)/cryptopp/TestData
$(CHMOD) 0644 $(DESTDIR)$(DATADIR)/cryptopp/TestData/*.dat
$(CP) TestVectors/*.txt $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
$(CHMOD) 0644 $(DESTDIR)$(DATADIR)/cryptopp/TestVectors/*.txt
# A recipe to install only the library, and not cryptest.exe. Also
# see https://github.com/weidai11/cryptopp/issues/653. Some users
@ -1231,19 +1248,23 @@ install: cryptest.exe install-lib
.PHONY: install-lib
install-lib:
@-$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/cryptopp
$(INSTALL_DATA) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp
$(CP) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp
$(CHMOD) 0644 $(DESTDIR)$(INCLUDEDIR)/cryptopp/*.h
ifneq ($(wildcard libcryptopp.a),)
@-$(MKDIR) $(DESTDIR)$(LIBDIR)
$(INSTALL_DATA) libcryptopp.a $(DESTDIR)$(LIBDIR)
$(CP) libcryptopp.a $(DESTDIR)$(LIBDIR)
$(CHMOD) 0644 $(DESTDIR)$(LIBDIR)/libcryptopp.a
endif
ifneq ($(wildcard libcryptopp.dylib),)
@-$(MKDIR) $(DESTDIR)$(LIBDIR)
$(INSTALL_PROGRAM) libcryptopp.dylib $(DESTDIR)$(LIBDIR)
$(CP) libcryptopp.dylib $(DESTDIR)$(LIBDIR)
$(CHMOD) 0755 $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
-install_name_tool -id $(DESTDIR)$(LIBDIR)/libcryptopp.dylib $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
endif
ifneq ($(wildcard libcryptopp.so$(SOLIB_VERSION_SUFFIX)),)
@-$(MKDIR) $(DESTDIR)$(LIBDIR)
$(INSTALL_PROGRAM) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)
$(CP) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)
$(CHMOD) 0755 $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)
ifeq ($(HAS_SOLIB_VERSION),1)
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so
$(LDCONF) $(DESTDIR)$(LIBDIR)
@ -1251,7 +1272,8 @@ endif
endif
ifneq ($(wildcard libcryptopp.pc),)
@-$(MKDIR) $(DESTDIR)$(LIBDIR)/pkgconfig
$(INSTALL_DATA) libcryptopp.pc $(DESTDIR)$(LIBDIR)/pkgconfig/libcryptopp.pc
$(CP) libcryptopp.pc $(DESTDIR)$(LIBDIR)/pkgconfig
$(CHMOD) 0644 $(DESTDIR)$(LIBDIR)/pkgconfig/libcryptopp.pc
endif
.PHONY: remove uninstall
@ -1327,7 +1349,7 @@ libcryptopp.pc:
@echo '' >> libcryptopp.pc
@echo 'Name: Crypto++' >> libcryptopp.pc
@echo 'Description: Crypto++ cryptographic library' >> libcryptopp.pc
@echo 'Version: 8.0' >> libcryptopp.pc
@echo 'Version: 8.1' >> libcryptopp.pc
@echo 'URL: https://cryptopp.com/' >> libcryptopp.pc
@echo '' >> libcryptopp.pc
@echo 'Cflags: -I$${includedir}' >> libcryptopp.pc
@ -1380,7 +1402,7 @@ ifneq ($(IS_DARWIN),0)
$(CP) cryptopp$(LIB_VER).zip $(PWD)/cryptopp$(LIB_VER)
hdiutil makehybrid -iso -joliet -o cryptopp$(LIB_VER).iso $(PWD)/cryptopp$(LIB_VER)
@-$(RM) -r $(PWD)/cryptopp$(LIB_VER)
else ifneq ($(IS_LINUX),0)
else ifneq ($(IS_LINUX)$(IS_HURD),00)
$(MKDIR) $(PWD)/cryptopp$(LIB_VER)
$(CP) cryptopp$(LIB_VER).zip $(PWD)/cryptopp$(LIB_VER)
genisoimage -q -o cryptopp$(LIB_VER).iso $(PWD)/cryptopp$(LIB_VER)
@ -1434,6 +1456,10 @@ chacha_avx.o : chacha_avx.cpp
cham_simd.o : cham_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(CHAM_FLAG) -c) $<
# SSE4.2 or ARMv8a available
crc_simd.o : crc_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(CRC_FLAG) -c) $<
# Power9 available
darn.o : darn.cpp
$(CXX) $(strip $(CXXFLAGS) $(DARN_FLAG) -c) $<
@ -1442,18 +1468,18 @@ darn.o : darn.cpp
donna_sse.o : donna_sse.cpp
$(CXX) $(strip $(CXXFLAGS) $(SSE2_FLAG) -c) $<
# SSE2 on i686
sse_simd.o : sse_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SSE2_FLAG) -c) $<
# SSE4.2 or ARMv8a available
crc_simd.o : crc_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(CRC_FLAG) -c) $<
# PCLMUL or ARMv7a/ARMv8a available
# Carryless multiply
gcm_simd.o : gcm_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(GCM_FLAG) -c) $<
# Carryless multiply
gf2n_simd.o : gf2n_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(GF2N_FLAG) -c) $<
# SSSE3 available
keccak_simd.o : keccak_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(KECCAK_FLAG) -c) $<
# SSSE3 available
lea_simd.o : lea_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(LEA_FLAG) -c) $<
@ -1525,8 +1551,16 @@ sm4_simd.o : sm4_simd.cpp
ifeq ($(XLC_COMPILER),1)
sm3.o : sm3.cpp
$(CXX) $(strip $(subst -O3,-O2,$(CXXFLAGS)) -c) $<
donna_32.o : donna_32.cpp
$(CXX) $(strip $(subst -O3,-O2,$(CXXFLAGS)) -c) $<
donna_64.o : donna_64.cpp
$(CXX) $(strip $(subst -O3,-O2,$(CXXFLAGS)) -c) $<
endif
# SSE2 on i686
sse_simd.o : sse_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SSE2_FLAG) -c) $<
# Don't build Rijndael with UBsan. Too much noise due to unaligned data accesses.
ifneq ($(findstring -fsanitize=undefined,$(CXXFLAGS)),)
rijndael.o : rijndael.cpp

View File

@ -26,10 +26,6 @@ EGREP ?= egrep
LN ?= ln -sf
LDCONF ?= /sbin/ldconfig -n
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
IS_IOS ?= 0
IS_ANDROID ?= 0
IS_ARM_EMBEDDED ?= 0
@ -188,6 +184,9 @@ ifeq ($(DETECT_FEATURES),1)
ifneq ($(strip $(TCXXFLAGS)),)
$(info Using testing flags: $(TCXXFLAGS))
endif
#TPROG = TestPrograms/test_cxx.cxx
#$(info Testing compile... )
#$(info $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 1>/dev/null))
endif
# For the previous messages
@ -335,6 +334,13 @@ ifeq ($(DETECT_FEATURES),1)
endif
endif
# Drop to SSE2 if available
ifeq ($(GCM_FLAG),)
ifneq ($(SSE2_FLAG),)
GCM_FLAG = $(SSE2_FLAG)
endif
endif
# DETECT_FEATURES
endif
@ -693,34 +699,47 @@ distclean: clean autotools-clean cmake-clean
.PHONY: install
install: cryptest.exe install-lib
@-$(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL_PROGRAM) cryptest.exe $(DESTDIR)$(BINDIR)
$(CP) cryptest.exe $(DESTDIR)$(BINDIR)
$(CHMOD) 0755 $(DESTDIR)$(BINDIR)/cryptest.exe
@-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestData
@-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
$(INSTALL_DATA) TestData/*.dat $(DESTDIR)$(DATADIR)/cryptopp/TestData
$(INSTALL_DATA) TestVectors/*.txt $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
$(CP) TestData/*.dat $(DESTDIR)$(DATADIR)/cryptopp/TestData
$(CHMOD) 0644 $(DESTDIR)$(DATADIR)/cryptopp/TestData/*.dat
$(CP) TestVectors/*.txt $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
$(CHMOD) 0644 $(DESTDIR)$(DATADIR)/cryptopp/TestVectors/*.txt
# A recipe to install only the library, and not cryptest.exe. Also
# see https://github.com/weidai11/cryptopp/issues/653.
.PHONY: install-lib
install-lib:
@-$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/cryptopp
$(INSTALL_DATA) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp
$(CP) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp
$(CHMOD) 0644 $(DESTDIR)$(INCLUDEDIR)/cryptopp/*.h
ifneq ($(wildcard libcryptopp.a),)
@-$(MKDIR) $(DESTDIR)$(LIBDIR)
$(INSTALL_DATA) libcryptopp.a $(DESTDIR)$(LIBDIR)
$(CP) libcryptopp.a $(DESTDIR)$(LIBDIR)
$(CHMOD) 0644 $(DESTDIR)$(LIBDIR)/libcryptopp.a
endif
ifneq ($(wildcard libcryptopp.dylib),)
@-$(MKDIR) $(DESTDIR)$(LIBDIR)
$(INSTALL_PROGRAM) libcryptopp.dylib $(DESTDIR)$(LIBDIR)
$(CP) libcryptopp.dylib $(DESTDIR)$(LIBDIR)
$(CHMOD) 0755 $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
-install_name_tool -id $(DESTDIR)$(LIBDIR)/libcryptopp.dylib $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
endif
ifneq ($(wildcard libcryptopp.so$(SOLIB_VERSION_SUFFIX)),)
@-$(MKDIR) $(DESTDIR)$(LIBDIR)
$(INSTALL_PROGRAM) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)
$(CP) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)
$(CHMOD) 0755 $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)
ifeq ($(HAS_SOLIB_VERSION),1)
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so
$(LDCONF) $(DESTDIR)$(LIBDIR)
endif
endif
ifneq ($(wildcard libcryptopp.pc),)
@-$(MKDIR) $(DESTDIR)$(LIBDIR)/pkgconfig
$(CP) libcryptopp.pc $(DESTDIR)$(LIBDIR)/pkgconfig
$(CHMOD) 0644 $(DESTDIR)$(LIBDIR)/pkgconfig/libcryptopp.pc
endif
.PHONY: remove uninstall
remove uninstall:

View File

@ -435,7 +435,6 @@ last several releases.
MacPorts GCC 7.0, Clang 4.0, Intel C++ 17.00, IBM XL C/C++ 13.1
8.0.0 - December 28, 2018
- major release, recompile of programs required
- expanded community input and support
* 54 unique contributors as of this release
@ -451,4 +450,20 @@ last several releases.
- avoid Singleton<T> when possible, avoid std::call_once completely
- fix SPARC alignment problems due to GetAlignmentOf<T>() on word64
- add ARM AES asm implementation from Cryptogams
- remove CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS support
- remove CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS support
8.1.0 - February 22, 2019
- minor release, no recompile of programs required
- expanded community input and support
56 unique contributors as of this release
- fix OS X PowerPC builds with Clang
- add Microsoft ARM64 support
- fix iPhone Simulator build due to missign symbols
- add CRYPTOPP_BUGGY_SIMD_LOAD_AND_STORE
- add carryless multiplies for NIST b233 and k233 curves
- fix OpenMP build due to use of OpenMP 4 with down-level compilers
- add SignStream and VerifyStream for ed25519 and large files
- fix missing AlgorithmProvider in PanamaHash
- add SHAKE-128 and SHAKE-256
- fix AVX2 build due to _mm256_broadcastsi128_si256
- add IETF ChaCha, XChaCha, ChaChaPoly1305 and XChaChaPoly1305

View File

@ -1,4 +1,4 @@
Compilation Copyright (c) 1995-2016 by Wei Dai. All rights reserved.
Compilation Copyright (c) 1995-2019 by Wei Dai. All rights reserved.
This copyright applies only to this software distribution package
as a compilation, and does not imply a copyright on any particular
file in the package.
@ -22,6 +22,18 @@ Richard De Moliner - safer.cpp
Matthew Skala - twofish.cpp
Kevin Springle - camellia.cpp, shacal2.cpp, ttmac.cpp, whrlpool.cpp, ripemd.cpp
Ronny Van Keer - sha3.cpp
Aumasson, Neves, Wilcox-O'Hearn and Winnerlein - blake2.cpp, blake2b_simd.cpp, blake2s_simd.cpp
Aaram Yun - aria.cpp, aria_simd.cpp
Han Lulu, Markku-Juhani O. Saarinen - sm4.cpp sm4_simd.cpp
Daniel J. Bernstein, Jack Lloyd - chacha.cpp, chacha_simd.cpp, chacha_avx.cpp
Andrew Moon - ed25519, x25519, donna_32.cpp, donna_64.cpp, donna_sse.cpp
The Crypto++ Library uses portions of Andy Polyakov's CRYPTOGAMS for Poly1305
scalar multiplication and aes_armv4.S. CRYPTOGAMS is dual licensed with a
permissive BSD-style license. The CRYPTOGAMS license is reproduced below.
The Crypto++ Library uses portions of Jack Lloyd's Botan for ChaCha SSE2 and
AVX. Botan placed the code in public domain for Crypto++ to use.
The Crypto++ Library (as a compilation) is currently licensed under the Boost
Software License 1.0 (http://www.boost.org/users/license.html).
@ -49,3 +61,22 @@ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
CRYPTOGAMS License
Copyright (c) 2006-2017, CRYPTOGAMS by <appro@openssl.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain copyright notices,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of the CRYPTOGAMS nor the names of its copyright
holder and contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

View File

@ -6,30 +6,32 @@ Currently the library contains the following algorithms:
algorithm type name
authenticated encryption schemes GCM, CCM, EAX
authenticated encryption schemes GCM, CCM, EAX, ChaCha20Poly1305 and
XChaCha20Poly1305
high speed stream ciphers ChaCha (8/12/20), Panama, Sosemanuk, Salsa20,
XSalsa20
high speed stream ciphers ChaCha (8/12/20), ChaCha (IETF), Panama, Salsa20,
Sosemanuk, XSalsa20, XChaCha20
AES and AES candidates AES (Rijndael), RC6, MARS, Twofish, Serpent,
CAST-256
ARIA, IDEA, Blowfish, Triple-DES (DES-EDE2 and
DES-EDE3), Camellia, SEED, Kalyna (128/256/512),
other block ciphers RC5, SIMON-64, SIMON-128, SPECK-64, SPECK-128,
Skipjack, SHACAL-2, SM4, Threefish (256/512/1024),
TEA, XTEA
ARIA, Blowfish, Camellia, CHAM, HIGHT, IDEA,
Kalyna (128/256/512), LEA, SEED, RC5, SHACAL-2,
other block ciphers SIMON (64/128), Skipjack, SPECK (64/128),
Simeck, SM4, Threefish (256/512/1024),
Triple-DES (DES-EDE2 and DES-EDE3), TEA, XTEA
block cipher modes of operation ECB, CBC, CBC ciphertext stealing (CTS),
CFB, OFB, counter mode (CTR)
message authentication codes BLAKE2s, BLAKE2b, CMAC, CBC-MAC, DMAC, GMAC, HMAC,
Poly1305, SipHash, Two-Track-MAC, VMAC,
Poly1305, Poly1305 (IETF), SipHash, Two-Track-MAC,
VMAC
BLAKE2s, BLAKE2b, Keccack (F1600), SHA-1,
hash functions SHA-2 (224/256/384/512), SHA-3 (224/256/384/512),
SipHash, SM3, Tiger, RIPEMD-128, RIPEMD-160,
RIPEMD-256, RIPEMD-320, WHIRLPOOL
SHAKE (128/256), SipHash, SM3, Tiger,
RIPEMD (128/160/256/320), WHIRLPOOL
RSA, DSA, Determinsitic DSA, ElGamal,
public-key cryptography Nyberg-Rueppel (NR), Rabin-Williams (RW), LUC,
@ -69,8 +71,6 @@ Other features include:
+ 32-bit CRC, CRC-C and Adler32 checksum
* class wrappers for these platform and operating system features (optional):
+ high resolution timers on Windows, Unix, and Mac OS
+ Berkeley and Windows style sockets
+ Windows named pipes
+ /dev/random, /dev/urandom, /dev/srandom
+ Microsoft's CryptGenRandom or BCryptGenRandom on Windows
* A high level interface for most of the above, using a filter/pipeline
@ -206,16 +206,23 @@ library in your programs to help avoid unwanted redirections.
*** Side Channel Attacks ***
Crypto++ attempts to resist side channel attacks using various remediations. We
believe the library is hardened but the remdiations may be incomplete. The first
line of defense uses hardware instructions when possible. The library also uses
cache-aware algoirthms and access patterns to minimize leakage. If you suspect
or find an information leak then please report it.
believe the library is mostly hardened but the remdiations may be incomplete. The
first line of defense uses hardware instructions when possible for block ciphers,
hashes and other primitives. Hardware acceleration remediates many timing attacks.
The library also uses cache-aware algoirthms and access patterns to minimize leakage.
Some of the public key algorithms have branches and some of the branches depend on
data that can be private or secret. The branching occurs in some field operations
like exponentiation over integers and elliptic curves. The branching has been
minimized but not completely eliminated.
Crypto++ does not enagage Specter remediations at this time. The GCC options for
Specter are -mfunction-return=thunk and -mindirect-branch=thunk, and the library
uses them during testing. If you want the Specter workarounds then add the GCC
options to your CXXFLAGS when building the library.
If you suspect or find an information leak then please report it.
*** Documentation and Support ***
Crypto++ is documented through inline comments in header files, which are

View File

@ -141,13 +141,13 @@ if ! "$MAKE" -j2 -f Makefile; then
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
if ! ./cryptestcwd v; then
echo "cryptestcwd v failed."
if ! ./cryptest v; then
echo "cryptest v failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
if ! ./cryptestcwd tv all; then
echo "cryptestcwd tv all failed."
if ! ./cryptest tv all; then
echo "cryptest tv all failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi

View File

@ -1,10 +1,11 @@
#!/usr/bin/env bash
# cryptest.sh - written and placed in public domain by Jeffrey Walton and Uri Blumenthal.
# Copyright assigned to Crypto++ project.
# cryptest.sh - written and placed in public domain by Jeffrey Walton and Uri
# Blumenthal.
# This is a test script that can be used on some Linux/Unix/Apple machines to automate testing
# of the shared object to ensure linking and symbols don't go missing from release to release.
# This is a test script that can be used on some Linux/Unix/Apple machines to
# automate testing of the shared object to ensure linking and symbols don't go
# missing from release to release.
# Fixup ancient Bash
# https://unix.stackexchange.com/q/468579/56041
@ -12,10 +13,20 @@ if [[ -z "$BASH_SOURCE" ]]; then
BASH_SOURCE="$0"
fi
############################################
# Cleanup
PWD_DIR=$(pwd)
function cleanup {
rm -f adhoc.cpp *.a *.o *.so *.dylib GNUmakefile-symbols
cd "$PWD_DIR"
}
trap cleanup EXIT
############################################
# Tags to test
OLD_VERSION_TAG=CRYPTOPP_7_0_0
OLD_VERSION_TAG=CRYPTOPP_8_0_0
NEW_VERSION_TAG=master
############################################

View File

@ -108,6 +108,7 @@ fi
THIS_SYSTEM=$(uname -s 2>&1)
IS_AIX=$(echo -n "$THIS_SYSTEM" | "$GREP" -i -c aix)
IS_DARWIN=$(echo -n "$THIS_SYSTEM" | "$GREP" -i -c darwin)
IS_HURD=$(echo -n "$THIS_SYSTEM" | "$GREP" -i -c gnu)
IS_LINUX=$(echo -n "$THIS_SYSTEM" | "$GREP" -i -c linux)
IS_CYGWIN=$(echo -n "$THIS_SYSTEM" | "$GREP" -i -c cygwin)
IS_MINGW=$(echo -n "$THIS_SYSTEM" | "$GREP" -i -c mingw)
@ -155,6 +156,8 @@ if [[ ("$IS_X86" -ne "0" || "$IS_X64" -ne "0") ]]; then
X86_CPU_FLAGS=$(grep Features /var/run/dmesg.boot)
elif [[ ("$IS_DRAGONFLY" -ne "0") ]]; then
X86_CPU_FLAGS=$(dmesg | grep Features)
elif [[ ("$IS_HURD" -ne "0") ]]; then
: # Do nothing... cpuid is not helpful at the moment
else
X86_CPU_FLAGS="$($AWK '{IGNORECASE=1}{if ($1 == "flags"){print;exit}}' < /proc/cpuinfo | cut -f 2 -d ':')"
fi

View File

@ -63,26 +63,31 @@ do
# ARMv5
if [ "$CL" == "armv5" ]; then
BACK_ARCH=armv5
APPLE_SDK=iPhoneOS
fi
# ARMv6
if [ "$CL" == "armv6" ]; then
BACK_ARCH=armv6
APPLE_SDK=iPhoneOS
fi
# ARMv7
if [ "$CL" == "armv7" ]; then
BACK_ARCH=armv7
APPLE_SDK=iPhoneOS
fi
# ARMv7s
if [ "$CL" == "armv7s" ]; then
BACK_ARCH=armv7s
APPLE_SDK=iPhoneOS
fi
# ARM64
if [[ ("$CL" == "arm64" || "$CL" == "armv8" || "$CL" == "aarch64") ]]; then
BACK_ARCH=arm64
APPLE_SDK=iPhoneOS
fi
# iPhone
@ -201,7 +206,7 @@ fi
# Simulator fixup. LD fails to link dylib.
if [ "$APPLE_SDK" == "iPhoneSimulator" ] && [ "$IOS_ARCH" == "i386" ]; then
IOS_FLAGS="$IOS_FLAGS -miphoneos-version-min=5 -DCRYPTOPP_DISABLE_ASM"
IOS_FLAGS="$IOS_FLAGS -miphoneos-version-min=5"
fi
# ARMv7s fixup. Xcode 4/iOS 6
@ -219,12 +224,6 @@ if [ "$APPLE_SDK" == "AppleTVOS" ]; then
IOS_FLAGS=""
fi
# ARM64 Simulator fixup. Under Xcode 6/iOS 8, it uses x86_64 and not i386
# -ios_simulator_version_min does not work though it is in LLVM sources.
if [ "$IOS_ARCH" == "x86_64" ]; then
IOS_FLAGS="$IOS_FLAGS -DCRYPTOPP_DISABLE_ASM"
fi
# Disable ASM for simulator. We are failing on Travis due to missing _start.
# We may need to link against crt1.o for simulator builds. Also see
# https://stackoverflow.com/q/24841283/608639

View File

@ -0,0 +1,6 @@
AlgorithmType: FileList
Name: aead.txt collection
Test: TestVectors/ccm.txt
Test: TestVectors/eax.txt
Test: TestVectors/gcm.txt
Test: TestVectors/chacha20poly1305.txt

View File

@ -1,55 +1,61 @@
AlgorithmType: FileList
Name: all.txt collection
Test: TestVectors/tea.txt
Test: TestVectors/wake.txt
Test: TestVectors/aes.txt
Test: TestVectors/aria.txt
Test: TestVectors/blake2b.txt
Test: TestVectors/blake2s.txt
Test: TestVectors/camellia.txt
Test: TestVectors/shacal2.txt
Test: TestVectors/ttmac.txt
Test: TestVectors/whrlpool.txt
Test: TestVectors/ccm.txt
Test: TestVectors/chacha_tls.txt
Test: TestVectors/chacha20poly1305.txt
Test: TestVectors/chacha.txt
Test: TestVectors/xchacha.txt
Test: TestVectors/cham.txt
Test: TestVectors/cmac.txt
Test: TestVectors/dlies.txt
Test: TestVectors/dsa.txt
Test: TestVectors/dsa_1363.txt
Test: TestVectors/dsa_rfc6979.txt
Test: TestVectors/dsa.txt
Test: TestVectors/eax.txt
Test: TestVectors/esign.txt
Test: TestVectors/gcm.txt
Test: TestVectors/hc128.txt
Test: TestVectors/hc256.txt
Test: TestVectors/hight.txt
Test: TestVectors/hkdf.txt
Test: TestVectors/hmac.txt
Test: TestVectors/kalyna.txt
Test: TestVectors/keccak.txt
Test: TestVectors/lea.txt
Test: TestVectors/mars.txt
Test: TestVectors/nr.txt
Test: TestVectors/panama.txt
Test: TestVectors/poly1305aes.txt
Test: TestVectors/poly1305_tls.txt
Test: TestVectors/rabbit.txt
Test: TestVectors/rsa_oaep.txt
Test: TestVectors/rsa_pkcs1_1_5.txt
Test: TestVectors/rsa_pss.txt
Test: TestVectors/rw.txt
Test: TestVectors/salsa.txt
Test: TestVectors/seal.txt
Test: TestVectors/sha.txt
Test: TestVectors/keccak.txt
Test: TestVectors/seed.txt
Test: TestVectors/sha1_fips_180.txt
Test: TestVectors/sha2_fips_180.txt
Test: TestVectors/sha3_fips_202.txt
Test: TestVectors/panama.txt
Test: TestVectors/sm3.txt
Test: TestVectors/aes.txt
Test: TestVectors/aria.txt
Test: TestVectors/kalyna.txt
Test: TestVectors/threefish.txt
Test: TestVectors/sm4.txt
Test: TestVectors/hight.txt
Test: TestVectors/cham.txt
Test: TestVectors/lea.txt
Test: TestVectors/shake.txt
Test: TestVectors/shacal2.txt
Test: TestVectors/sha.txt
Test: TestVectors/simeck.txt
Test: TestVectors/simon.txt
Test: TestVectors/speck.txt
Test: TestVectors/salsa.txt
Test: TestVectors/chacha.txt
#Test: TestVectors/tls_chacha.txt
Test: TestVectors/sosemanuk.txt
Test: TestVectors/rabbit.txt
Test: TestVectors/hc128.txt
Test: TestVectors/hc256.txt
Test: TestVectors/vmac.txt
Test: TestVectors/ccm.txt
Test: TestVectors/gcm.txt
Test: TestVectors/cmac.txt
Test: TestVectors/eax.txt
Test: TestVectors/mars.txt
Test: TestVectors/blake2s.txt
Test: TestVectors/blake2b.txt
Test: TestVectors/siphash.txt
Test: TestVectors/hkdf.txt
Test: TestVectors/sm3.txt
Test: TestVectors/sm4.txt
Test: TestVectors/sosemanuk.txt
Test: TestVectors/speck.txt
Test: TestVectors/tea.txt
Test: TestVectors/threefish.txt
Test: TestVectors/ttmac.txt
Test: TestVectors/vmac.txt
Test: TestVectors/wake.txt
Test: TestVectors/whrlpool.txt

File diff suppressed because it is too large Load Diff

View File

@ -1,37 +1,337 @@
AlgorithmType: SymmetricCipher
Name: ChaCha20
Name: ChaChaTLS
Source: http://tools.ietf.org/html/draft-agl-tls-chacha20poly1305
Comment: Section 7, Test 1
Key: 0000000000000000000000000000000000000000000000000000000000000000
IV: 0000000000000000
Plaintext:
Ciphertext: 76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7724e03fb8d84a376a43b8f41518a11cc387b669
#
Comment: Section A.1, ChaCha20 Block Function, Test 1
Key: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
IV: 00 00 00 00 00 00 00 00 00 00 00 00
Plaintext: r64 00
Ciphertext: 76 b8 e0 ad a0 f1 3d 90 40 5d 6a e5 53 86 bd 28 \
bd d2 19 b8 a0 8d ed 1a a8 36 ef cc 8b 77 0d c7 \
da 41 59 7c 51 57 48 8d 77 24 e0 3f b8 d8 4a 37 \
6a 43 b8 f4 15 18 a1 1c c3 87 b6 69 b2 ee 65 86
Test: Encrypt
Comment: Section 7, Test 2
Key: 0000000000000000000000000000000000000000000000000000000000000001
IV: 0000000000000000
Plaintext:
Ciphertext: 4540f05a9f1fb296d7736e7b208e3c96eb4fe1834688d2604f450952ed432d41bbe2a0b6ea7566d2a5d1e7e20d42af2c53d792b1c43fea817e9ad275
#
Comment: Section A.1, ChaCha20 Block Function, Test 2
Key: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
IV: 00 00 00 00 00 00 00 00 00 00 00 00
Plaintext: r64 00
Ciphertext: 9f 07 e7 be 55 51 38 7a 98 ba 97 7c 73 2d 08 0d \
cb 0f 29 a0 48 e3 65 69 12 c6 53 3e 32 ee 7a ed \
29 b7 21 76 9c e6 4e 43 d5 71 33 b0 74 d8 39 d5 \
31 ed 1f 28 51 0a fb 45 ac e1 0a 1f 4b 79 4d 6f
InitialBlock: 1
Test: Encrypt
Comment: Section 7, Test 3
Key: 0000000000000000000000000000000000000000000000000000000000000000
IV: 0000000000000001
Plaintext:
Ciphertext: de9cba7bf3d69ef5e786dc63973f653a0b49e015adbff7134fcb7df137821031e85a050278a7084527214f73efc7fa5b5277062eb7a0433e445f41e3
#
Comment: Section A.1, ChaCha20 Block Function, Test 3
Key: 0000000000000000 0000000000000000 0000000000000000 0000000000000001
IV: 00 00 00 00 00 00 00 00 00 00 00 00
Plaintext: r64 00
Ciphertext: 3a eb 52 24 ec f8 49 92 9b 9d 82 8d b1 ce d4 dd \
83 20 25 e8 01 8b 81 60 b8 22 84 f3 c9 49 aa 5a \
8e ca 00 bb b4 a7 3b da d1 92 b5 c4 2f 73 f2 fd \
4e 27 36 44 c8 b3 61 25 a6 4a dd eb 00 6c 13 a0
InitialBlock: 1
Test: Encrypt
Comment: Section 7, Test 4
Key: 0000000000000000000000000000000000000000000000000000000000000000