Skip to content

Commit c10ca92

Browse files
Update cryptopp from 8.6.0 to 8.7.0 (#2837)
Update cryptopp from 8.6 to 8.7
1 parent 44577e8 commit c10ca92

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+989
-587
lines changed

vendor/cryptopp/Filelist.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ poly1305.cpp
257257
poly1305.h
258258
polynomi.cpp
259259
polynomi.h
260-
ppc_power7.cpp
261-
ppc_power8.cpp
262-
ppc_power9.cpp
260+
power7_ppc.cpp
261+
power8_ppc.cpp
262+
power9_ppc.cpp
263263
ppc_simd.cpp
264264
ppc_simd.h
265265
pssr.cpp
@@ -587,6 +587,7 @@ TestPrograms/test_32bit.cpp
587587
TestPrograms/test_64bit.cpp
588588
TestPrograms/test_arm_acle_header.cpp
589589
TestPrograms/test_arm_aes.cpp
590+
TestPrograms/test_arm_armv7.cpp
590591
TestPrograms/test_arm_asimd.cpp
591592
TestPrograms/test_arm_crc.cpp
592593
TestPrograms/test_arm_neon.cpp

vendor/cryptopp/History.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,3 +542,41 @@ last several releases.
542542
- expanded community input and support
543543
* 70 unique contributors as of this release
544544
- port to Apple M1 hardware
545+
546+
8.6.0 - September 21, 2021
547+
- minor release, recompile of programs required
548+
- expanded community input and support
549+
* 74 unique contributors as of this release
550+
- fix ElGamal encryption
551+
- fix ChaCha20 AVX2 implementation
552+
- add octal and decimal literal prefix parsing to Integer
553+
- add missing overload in ed25519Signer and ed25519Verifier
554+
- make SHA-NI independent of AVX and AVX2
555+
- fix OldRandomPool GenerateWord32
556+
- use CPPFLAGS during feature testing
557+
- fix compile on CentOS 5
558+
- fix compile on FreeBSD
559+
- fix feature testing on ARM A-32 and Aarch64
560+
- enable inline ASM for CRC and PMULL on Apple M1
561+
- fix Intel oneAPI compile
562+
- rename test files with *.cpp extension
563+
- fix GCC compile error due to missing _mm256_set_m128i
564+
- add LSH-256 and LSH-512 hash functions
565+
- add ECIES_P1363 for backwards compatibility
566+
- fix AdditiveCipherTemplate<T> ProcessData
567+
- remove CRYPTOPP_NO_CXX11 define
568+
- add -fno-common for Darwin builds
569+
- update documentation
570+
571+
8.7.0 - August 7, 2022
572+
- minor release, recompile of programs required
573+
- expanded community input and support
574+
* 81 unique contributors as of this release
575+
- fix RSA key generation for small moduli
576+
- fix AES-GCM with AESNI but without CLMUL
577+
- fix Clang warning with C++17
578+
- fix MinGW builds due to use of O_NOFOLLOW
579+
- rework CFB_CipherTemplate::ProcessData and AdditiveCipherTemplate::ProcessData
580+
* restored performance and avoided performance penalty of a temp buffer
581+
- fix undersized SecBlock buffer in Integer bit operations
582+
- work around several GCC 11 & 12 problems

vendor/cryptopp/Install.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ ACCEPTANCE TESTING
204204

205205
Crypto++ uses five security gates in its engineering process. The library must maintain the quality provided by the review system and integrity of the test suites. You can use the information to decide if the Crypto++ library suits your needs and provides a compatible security posture.
206206

207-
The first gate is code review and discussion of proposed chnages. Git commits often cross reference a User Group discussions.
207+
The first gate is code review and discussion of proposed changes. Git commits often cross reference a User Group discussions.
208208

209209
Second is the compiler warning system. The code must clean compile under the equivalent of GCC's -Wall -Wextra (modulo -Wno-type-limits -Wno-unknown-pragmas). This is a moving target as compiler analysis improves.
210210

vendor/cryptopp/License.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ Han Lulu, Markku-Juhani O. Saarinen - sm4.cpp sm4_simd.cpp
2828
Daniel J. Bernstein, Jack Lloyd - chacha.cpp, chacha_simd.cpp, chacha_avx.cpp
2929
Andrew Moon - ed25519, x25519, donna_32.cpp, donna_64.cpp, donna_sse.cpp
3030

31-
The Crypto++ Library uses portions of Andy Polyakov's CRYPTOGAMS for Poly1305
32-
scalar multiplication, aes_armv4.S, sha1_armv4.S and sha256_armv4.S. CRYPTOGAMS
33-
is dual licensed with a permissive BSD-style license. The CRYPTOGAMS license is
34-
reproduced below.
31+
The Crypto++ Library uses portions of Andy Polyakov's CRYPTOGAMS on Linux
32+
for 32-bit ARM with files aes_armv4.S, sha1_armv4.S and sha256_armv4.S.
33+
CRYPTOGAMS is dual licensed with a permissive BSD-style license. The
34+
CRYPTOGAMS license is reproduced below. You can disable Cryptogams code by
35+
undefining the relevant macros in config_asm.h.
3536

3637
The Crypto++ Library uses portions of Jack Lloyd's Botan for ChaCha SSE2 and
3738
AVX. Botan placed the code in public domain for Crypto++ to use.

vendor/cryptopp/Readme.txt

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Crypto++: free C++ Class Library of Cryptographic Schemes
2-
Version 8.6 - TBD
2+
Version 8.8 - TBD
33

44
Crypto++ Library is a free C++ class library of cryptographic schemes.
55
Currently the library contains the following algorithms:
@@ -91,13 +91,13 @@ for any purpose without paying anyone, but see License.txt for the fine print.
9191
The following compilers are supported for this release. Please visit
9292
http://www.cryptopp.com the most up to date build instructions and porting notes.
9393

94-
* Visual Studio 2003 - 2019
95-
* GCC 3.3 - 10.1
94+
* Visual Studio 2003 - 2022
95+
* GCC 3.3 - 12.2
9696
* Apple Clang 4.3 - 12.0
97-
* LLVM Clang 2.9 - 11.0
97+
* LLVM Clang 2.9 - 14.0
9898
* C++ Builder 2015
9999
* Intel C++ Compiler 9 - 16.0
100-
* Sun Studio 12u1 - 12.6
100+
* Sun Studio 12u1 - 12.7
101101
* IBM XL C/C++ 10.0 - 14.0
102102

103103
*** Important Usage Notes ***
@@ -294,6 +294,19 @@ documentation is one of the highest returns on investment.
294294
The items in this section comprise the most recent history. Please see History.txt
295295
for the record back to Crypto++ 1.0.
296296

297+
8.7.0 - August 7, 2022
298+
- minor release, recompile of programs required
299+
- expanded community input and support
300+
* 81 unique contributors as of this release
301+
- fix RSA key generation for small moduli
302+
- fix AES-GCM with AESNI but without CLMUL
303+
- fix Clang warning with C++17
304+
- fix MinGW builds due to use of O_NOFOLLOW
305+
- rework CFB_CipherTemplate::ProcessData and AdditiveCipherTemplate::ProcessData
306+
* restored performance and avoided performance penalty of a temp buffer
307+
- fix undersized SecBlock buffer in Integer bit operations
308+
- work around several GCC 11 & 12 problems
309+
297310
8.6.0 - September 21, 2021
298311
- minor release, recompile of programs required
299312
- expanded community input and support

vendor/cryptopp/arm_simd.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ inline uint64x2_t VEXT_U8(uint64x2_t a, uint64x2_t b)
351351
:"=w" (r) : "w" (a), "w" (b), "I" (C) );
352352
return r;
353353
#endif
354-
//@}
355354
}
356355

356+
//@}
357357
#endif // CRYPTOPP_ARM_PMULL_AVAILABLE
358358

359359
#if CRYPTOPP_ARM_SHA3_AVAILABLE || defined(CRYPTOPP_DOXYGEN_PROCESSING)
@@ -385,19 +385,19 @@ inline uint64x2_t VEOR3(uint64x2_t a, uint64x2_t b, uint64x2_t c)
385385
/// \param a the first value
386386
/// \param b the second value
387387
/// \param c the third value
388-
/// \return two-way exclusive OR of the values, then rotated by imm6
388+
/// \return two-way exclusive OR of the values, then rotated by c
389389
/// \details VXARQ() performs vxarq_u64(). VXARQ is provided as GCC inline assembly due
390390
/// to Clang and lack of support for the intrinsic.
391391
/// \details VXARQ requires ARMv8.2.
392392
/// \since Crypto++ 8.6
393-
inline uint64x2_t VXAR(uint64x2_t a, uint64x2_t b, const int imm6)
393+
inline uint64x2_t VXAR(uint64x2_t a, uint64x2_t b, const int c)
394394
{
395395
#if defined(_MSC_VER)
396-
return vxarq_u64(a, b, imm6);
396+
return vxarq_u64(a, b, c);
397397
#else
398398
uint64x2_t r;
399399
__asm__ ("xar %0.2d, %1.2d, %2.2d, %3 \n\t"
400-
:"=w" (r) : "w" (a), "w" (b), "I" (imm6));
400+
:"=w" (r) : "w" (a), "w" (b), "I" (c));
401401
return r;
402402
#endif
403403
}

vendor/cryptopp/asn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class CRYPTOPP_DLL UnknownOID : public BERDecodeErr
110110
/// \brief Construct an UnknownOID
111111
UnknownOID() : BERDecodeErr("BER decode error: unknown object identifier") {}
112112
/// \brief Construct an UnknownOID
113-
/// \param err error message to use for the execption
113+
/// \param err error message to use for the exception
114114
UnknownOID(const char *err) : BERDecodeErr(err) {}
115115
};
116116

vendor/cryptopp/basecode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void BaseN_Decoder::InitializeDecodingLookupArray(int *lookup, const byte *alpha
182182
for (unsigned int i=0; i<base; i++)
183183
{
184184
// Debug asserts for 'lookup[alphabet[i]] == -1' removed because the self tests
185-
// have unusal tests that try to break the encoders and decoders. Tests include
185+
// have unusual tests that try to break the encoders and decoders. Tests include
186186
// a string of the same characters. I.,e., a string of stars like '********...'.
187187
if (caseInsensitive && isalpha(alphabet[i]))
188188
{

vendor/cryptopp/chacha.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// and Bernstein's reference ChaCha family implementation at
44
// http://cr.yp.to/chacha.html.
55

6-
// The library added Bernstein's ChaCha classses at Crypto++ 5.6.4. The IETF
6+
// The library added Bernstein's ChaCha classes at Crypto++ 5.6.4. The IETF
77
// uses a slightly different implementation than Bernstein, and the IETF
88
// ChaCha and XChaCha classes were added at Crypto++ 8.1. We wanted to maintain
99
// ABI compatibility at the 8.1 release so the original ChaCha classes were not

vendor/cryptopp/chacha_avx.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@ extern const char CHACHA_AVX_FNAME[] = __FILE__;
3636
# define MAYBE_CONST const
3737
#endif
3838

39-
// VS2017 and global optimization bug. TODO, figure out when
40-
// we can re-enable full optimizations for VS2017. Also see
39+
// VS2017 and global optimization bug. Also see
4140
// https://github.com/weidai11/cryptopp/issues/649 and
4241
// https://github.com/weidai11/cryptopp/issues/735. The
4342
// 649 issue affects AES but it is the same here. The 735
4443
// issue is ChaCha AVX2 cut-in where it surfaced again.
45-
#if (_MSC_VER >= 1910)
44+
#if (_MSC_VER >= 1910) && (_MSC_VER < 1916)
4645
# ifndef CRYPTOPP_DEBUG
4746
# pragma optimize("", off)
4847
# pragma optimize("ts", on)

vendor/cryptopp/config_asm.h

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
#endif
131131

132132
// Couple to CRYPTOPP_DISABLE_AESNI, but use CRYPTOPP_CLMUL_AVAILABLE so we can selectively
133-
// disable for misbehaving platofrms and compilers, like Solaris or some Clang.
133+
// disable for misbehaving platforms and compilers, like Solaris or some Clang.
134134
#if defined(CRYPTOPP_DISABLE_AESNI)
135135
#define CRYPTOPP_DISABLE_CLMUL 1
136136
#endif
@@ -311,6 +311,12 @@
311311
# endif // Platforms
312312
#endif
313313

314+
// Buggy Microsoft compiler, https://github.com/weidai11/cryptopp/issues/1096
315+
#if defined(_MSC_VER)
316+
# undef CRYPTOPP_ARM_SHA1_AVAILABLE
317+
# undef CRYPTOPP_ARM_SHA2_AVAILABLE
318+
#endif
319+
314320
// ARMv8 and SHA-512, SHA-3. -march=armv8.2-a+crypto or above must be present
315321
// Requires GCC 8.0, Clang 11.0, Apple Clang 12.0 or Visual Studio 20??
316322
#if !defined(CRYPTOPP_ARM_SHA3_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_SHA)
@@ -365,12 +371,14 @@
365371
// than C/C++. Define this to use the Cryptogams AES and SHA implementations
366372
// on GNU Linux systems. When defined, Crypto++ will use aes_armv4.S,
367373
// sha1_armv4.S and sha256_armv4.S. https://www.cryptopp.com/wiki/Cryptogams.
368-
#if defined(__arm__) && defined(__linux__)
369-
# if defined(__GNUC__) || defined(__clang__)
370-
# define CRYPTOGAMS_ARM_AES 1
371-
# define CRYPTOGAMS_ARM_SHA1 1
372-
# define CRYPTOGAMS_ARM_SHA256 1
373-
# define CRYPTOGAMS_ARM_SHA512 1
374+
#if !defined(CRYPTOPP_DISABLE_ARM_NEON)
375+
# if defined(__arm__) && defined(__linux__)
376+
# if defined(__GNUC__) || defined(__clang__)
377+
# define CRYPTOGAMS_ARM_AES 1
378+
# define CRYPTOGAMS_ARM_SHA1 1
379+
# define CRYPTOGAMS_ARM_SHA256 1
380+
# define CRYPTOGAMS_ARM_SHA512 1
381+
# endif
374382
# endif
375383
#endif
376384

vendor/cryptopp/config_dll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
/// \brief Override for internal linkage
105105
/// \details CRYPTOPP_TABLE can be used to override internal linkage
106106
/// on tables with the <tt>const</tt> qualifier. According to C++ rules
107-
/// a decalration with <tt>const</tt> qualifier is internal linkage.
107+
/// a declaration with <tt>const</tt> qualifier is internal linkage.
108108
/// \note The name CRYPTOPP_TABLE was chosen because it is often used to
109109
/// export a table, like AES or SHA constants. The name avoids collisions
110110
/// with the DLL gear macros, like CRYPTOPP_EXPORTS and CRYPTOPP_EXTERN.

vendor/cryptopp/config_ver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/// as a shared object if versions are inadvertently mixed and matched.
3636
/// \sa CRYPTOPP_VERSION, LibraryVersion(), HeaderVersion()
3737
/// \since Crypto++ 8.2
38-
#define CRYPTOPP_MINOR 6
38+
#define CRYPTOPP_MINOR 7
3939
/// \brief Library revision number
4040
/// \details CRYPTOPP_REVISION reflects the revision number of the library the
4141
/// headers came from. It is not necessarily the revision of the library built
@@ -50,7 +50,7 @@
5050
/// shared object if versions are inadvertently mixed and matched.
5151
/// \sa CRYPTOPP_MAJOR, CRYPTOPP_MINOR, CRYPTOPP_REVISION, LibraryVersion(), HeaderVersion()
5252
/// \since Crypto++ 5.6
53-
#define CRYPTOPP_VERSION 860
53+
#define CRYPTOPP_VERSION 870
5454

5555
// Compiler version macros
5656

vendor/cryptopp/cpu.cpp

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,8 @@ inline bool CPU_QuerySM4()
11301130

11311131
void DetectArmFeatures()
11321132
{
1133+
#ifndef CRYPTOPP_DISABLE_ASM
1134+
11331135
// The CPU_ProbeXXX's return false for OSes which
11341136
// can't tolerate SIGILL-based probes
11351137
g_hasARMv7 = CPU_QueryARMv7() || CPU_ProbeARMv7();
@@ -1155,14 +1157,16 @@ void DetectArmFeatures()
11551157
if (g_cacheLineSize == 0)
11561158
g_cacheLineSize = CRYPTOPP_L1_CACHE_LINE_SIZE;
11571159

1160+
#endif // CRYPTOPP_DISABLE_ASM
1161+
11581162
*const_cast<volatile bool*>(&g_ArmDetectionDone) = true;
11591163
}
11601164

11611165
// *************************** PowerPC and PowerPC64 ***************************
11621166

11631167
#elif (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64)
11641168

1165-
bool CRYPTOPP_SECTION_INIT g_PowerpcDetectionDone = false;
1169+
bool CRYPTOPP_SECTION_INIT g_PowerPcDetectionDone = false;
11661170
bool CRYPTOPP_SECTION_INIT g_hasAltivec = false;
11671171
bool CRYPTOPP_SECTION_INIT g_hasPower7 = false;
11681172
bool CRYPTOPP_SECTION_INIT g_hasPower8 = false;
@@ -1373,15 +1377,16 @@ inline bool CPU_QueryDARN()
13731377
return false;
13741378
}
13751379

1376-
void DetectPowerpcFeatures()
1380+
void DetectPowerPcFeatures()
13771381
{
1378-
// GCC 10 is giving us trouble in CPU_ProbePower9() and
1379-
// CPU_ProbeDARN(). GCC is generating POWER9 instructions
1380-
// on POWER8 for ppc_power9.cpp. The compiler idiots did
1381-
// not think through the consequences of requiring us to
1382-
// use -mcpu=power9 to unlock the ISA. Epic fail.
1382+
// GCC 10 is giving us trouble in CPU_ProbePower9() and CPU_ProbeDARN().
1383+
// GCC is generating POWER9 instructions on POWER8 for ppc_power9.cpp.
1384+
// The compiler idiots did not think through the consequences of
1385+
// requiring us to use -mcpu=power9 to unlock the ISA. Epic fail.
13831386
// https://github.com/weidai11/cryptopp/issues/986
13841387

1388+
#ifndef CRYPTOPP_DISABLE_ASM
1389+
13851390
// The CPU_ProbeXXX's return false for OSes which
13861391
// can't tolerate SIGILL-based probes, like Apple
13871392
g_hasAltivec = CPU_QueryAltivec() || CPU_ProbeAltivec();
@@ -1410,7 +1415,9 @@ void DetectPowerpcFeatures()
14101415
if (g_cacheLineSize == 0)
14111416
g_cacheLineSize = CRYPTOPP_L1_CACHE_LINE_SIZE;
14121417

1413-
*const_cast<volatile bool*>(&g_PowerpcDetectionDone) = true;
1418+
#endif // CRYPTOPP_DISABLE_ASM
1419+
1420+
*const_cast<volatile bool*>(&g_PowerPcDetectionDone) = true;
14141421
}
14151422

14161423
#endif
@@ -1430,7 +1437,7 @@ class InitCpu
14301437
#elif CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8
14311438
CryptoPP::DetectArmFeatures();
14321439
#elif CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64
1433-
CryptoPP::DetectPowerpcFeatures();
1440+
CryptoPP::DetectPowerPcFeatures();
14341441
#endif
14351442
}
14361443
};

0 commit comments

Comments
 (0)