Home Page Download Manual GitHub Mediawiki Mailing lists Contributions Related links

Crypto++ 6.0

Crypto++ 6.0 was released on January 22, 2018. The 6.0 release was a major relase and the ABI changed. The release included two CVE fixes.

The first CVE, CVE-2016-9939, was a transient DoS due to allocating an oversized buffer on attacker controlled data. The transitivity was due to a zeroizer which cleared memory, even if the memory was unused.

The second CVE, CVE-2017-9434, was a misidentified finding that arose during fuzzing. The project detected a memory error that was due to a violation of aliasing rules in the test software, and not the library proper.

Download

The download is available from the Crypto++ website. The checksums for the download are below. Release signatures can be verified using GnuPG according to Release Signing.

Mirrors for the download are below. Note that GitHub checksums on the ZIP or TAR are different because the service creates the archive from sources.

Release Notes

The release notes for Crypto++ 6.0 follows.

std::byte

Crypto++ moved byte into the CryptoPP namespace. The change could cause problems with some user programs. There is a wiki page available for fixing user programs at std::byte.

The change was due to C++17 std::byte causing ambiguous symbol references. Formerly Crypto++ byte was in the gobal namespace to avoid ambiguous symbol references due to Microsoft SDK's placement of a byte in the gobal namespace.

After the change Microsoft byte and std::byte will still cause ambiguous symbol references, and the wiki page should help user programs make a choice.

BASE + SIMD

Crypto++ switched to BASE+SIMD to better support distros. BASE provides an agnostic C++ implementation, while SIMD provides a specialized implementation like ARMv8 or Intel for AES or SHA. The SIMD files, like rijndael-simd.cpp or sha-simd.cpp, require architecture specific flags, like -msse4.1 -maes and -march=armv8-a+crypto.

Both the Crypto++ makefile and the unoffical Autoools project adds the architecture specific flags. The makefile still honors your CXXFLAGS:

# AESNI, ARMv8a or POWER8 available
rijndael-simd.o : rijndael-simd.cpp
        $(CXX) $(strip $(CXXFLAGS) $(AES_FLAG) -c) $<

If you encounter errors like shown below, then be sure your build tool is adding the necessary flags.

$ g++ -g2 -O3 rijndael-simd.cpp -c
In file included from rijndael-simd.cpp:37:0:
...
/usr/lib/gcc/x86_64-redhat-linux/7/include/wmmintrin.h:61:1:
  error: inlining failed in call to always_inline '__m128i _mm_aesenc_si128(__m128i, __m128i)':
  target specific option mismatch
 _mm_aesenc_si128 (__m128i __X, __m128i __Y)
 ^~~~~~~~~~~~~~~~
rijndael-simd.cpp:377:33: note: called from here
         block = _mm_aesenc_si128(block, skeys[i+1]);

Also see the BASE+SIMD wiki page.

Autotools project

BASE+SIMD caused a lot of extra work for Debian and László Böszörményi. We teamed with László and added an unofficial Autoools project to remove some of the burden. The Autotools project can be used to build Crypto++ by distributions.

If you experience a failed compile due to missing architecture flags, then run the makefile or Autool's configure. Autotools will provide summary information with the necessary flags:

$ autoreconf -f -i
...
$ ./configure
...

Auto-configuration complete. A summary of options are below. If
something looks wrong then please modify config.h and please report
it at http://github.com/noloader/cryptopp-autotools.

   Build triplet: x86_64-pc-linux-gnu
 Compiler target: x86_64-redhat-linux
Compiler version: g++ (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)

Static library: yes
Shared library: yes

CRYPTOPP_SSE_FLAG: -msse2
CRYPTOPP_ARIA_FLAG: -mssse3
CRYPTOPP_BLAKE2_FLAG: -msse4.1
CRYPTOPP_CRC_FLAG: -msse4.2
CRYPTOPP_GCM_FLAG: -mssse3 -mpclmul
CRYPTOPP_AES_FLAG: -msse4.1 -maes
CRYPTOPP_SHA_FLAG: -msse4.2 -msha
CRYPTOPP_SPECK_FLAG: -msse4.1
CRYPTOPP_SIMON_FLAG: -msse4.1

Automake flags (can be overridden by user flags):
AM_CXXFLAGS:  -pthread -fdata-sections -ffunction-sections -pipe
AM_LDFLAGS:  -pthread -Wl,--gc-sections -Wl,--exclude-libs,ALL

User flags (overrides Automake flags on conflict):
CXXFLAGS: -g -O2
LDFLAGS:

Running configure on an Aarch64 machine produces similar results for ARMv8:

CRYPTOPP_NEON_FLAG: -march=armv8-a
CRYPTOPP_ARIA_FLAG: -march=armv8-a
CRYPTOPP_BLAKE2_FLAG: -march=armv8-a
CRYPTOPP_CRC_FLAG: -march=armv8-a+crc
CRYPTOPP_GCM_FLAG: -march=armv8-a+crypto
CRYPTOPP_AES_FLAG: -march=armv8-a+crypto
CRYPTOPP_SHA_FLAG: -march=armv8-a+crypto
CRYPTOPP_SPECK_FLAG: -march=armv8-a
CRYPTOPP_SIMON_FLAG: -march=armv8-a

Bug Fixes and Minor Issues

The bug fix and minor issue list for Crypto++ 6.0 follows. Many non-trivial issues are tracked for auditing and C&A purposes, but the list may not be complete. A number in parenthesis is the GitHub Issue number, if it was tracked. Sometimes a Git commit is referenced, but many trivial GitHub commits are omitted. Missing Issue numbers or lack of consecutiveness usually indicates feature requests and "won't fix/can't fix" type reports.

CMake bugs were not included in the list below. There were approximately 40 of them. CMake did not achieve stability, and it was removed under Issue 506. The build tool was repsonsible for a disproportionate number of bugs between Crypto++ 5.6.4 and Crypto++ 6.0. We did not have the resources to work the reports.

Notes for Distros

There are three items of interest for distros. First, we fixed the ABI breaks by bumping to Crypto++ 6.0. We apologize for the problems it caused in Crypto++ 5.6.5.

Second, we have an unoffical Autotools project at Crypto++ | Autoools. It is based on the Autotools project files supplied by Debian and László Böszörményi. Autotools has several contributors, including László, so it should be mostly up to date.

Third, we have an unoffical Cmake project at Crypto++ | Cmake. It is based on the Cmake project files that were removed from the distribution. There are fewer contributors to the Cmake project and the files may not be up to date.

File Changes

Below is a list of all files that were added or deleted at Crypto++ 6.0.

$ git diff-tree -r --summary CRYPTOPP_5_6_5 CRYPTOPP_6_0_0 | grep -v "change" | awk '{$2=$3=""; print $0}' | grep -E '(\.h|\.cpp|\.txt|\.dat)'
create   TestData/aria.dat
create   TestData/rsa2048a.dat
create   TestVectors/aria.txt
create   TestVectors/kalyna.txt
create   TestVectors/sha1_160_fips_180.txt
create   TestVectors/sha1_fips_180.txt
create   TestVectors/sha2.txt
create   TestVectors/sha2_224_fips_180.txt
create   TestVectors/sha2_256_fips_180.txt
create   TestVectors/sha2_384_fips_180.txt
create   TestVectors/sha2_512_fips_180.txt
create   TestVectors/sha2_fips_180.txt
create   TestVectors/sha3.txt
create   TestVectors/simon.txt
create   TestVectors/siphash.txt
create   TestVectors/sm3.txt
create   TestVectors/sm4.txt
create   TestVectors/speck.txt
create   TestVectors/threefish.txt
create   adv-simd.h
create   aria-simd.cpp
create   aria.cpp
create   aria.h
create   ariatab.cpp
create   blake2-simd.cpp
create   crc-simd.cpp
create   drbg.h
create   ecpoint.h
create   gcm-simd.cpp
create   hashfwd.h
create   kalyna.cpp
create   kalyna.h
create   kalynatab.cpp
create   nacl.h
create   neon-simd.cpp
create   padlkrng.cpp
create   padlkrng.h
create   poly1305.cpp
create   poly1305.h
create   ppc-simd.cpp
create   ppc-simd.h
delete   regtest.cpp
create   regtest1.cpp
create   regtest2.cpp
create   regtest3.cpp
create   rijndael-simd.cpp
create   sha-simd.cpp
create   shacal2-simd.cpp
create   simon-simd.cpp
create   simon.cpp
create   simon.h
create   siphash.h
create   sm3.cpp
create   sm3.h
create   sm4.cpp
create   sm4.h
create   speck-simd.cpp
create   speck.cpp
create   speck.h
create   sse-simd.cpp
create   threefish.cpp
create   threefish.h
create   tweetnacl.cpp
create   tweetnacl.h
create   validat0.cpp
create   validat4.cpp