Commit Graph

226 Commits (0c6dc33d2bb96519ea4e65db3f65f613b2189f98)

Author SHA1 Message Date
Jeffrey Walton 23b939c62b
Clear warnings under GCC with -Wall -Wextra 2017-09-05 12:23:12 -04:00
Jeffrey Walton 14a5221d82
Remove unneeded Debug tests
These tests are effectively performed in MDC, SEAL and OldRandomPool
2017-09-01 02:37:41 -04:00
Jeffrey Walton 7851a0d510 Remove BOOL macro value (GH #462)
Currently the CRYPTOPP_BOOL_XXX macros set the macro value to 0 or 1. If we remove setting the 0 value (the #else part of the expression), then the self tests speed up by about 0.3 seconds. I can't explain it, but I have observed it repeatedly.
This check-in prepares for the removal in Upstream master
2017-08-20 21:25:29 -04:00
Jeffrey Walton 3db6f361d2
Fix compile under MSVC
(ClCompile target) ->
  validat1.cpp(1081): warning C4800: 'CryptoPP::word32' : forcing value to bool
 'true' or 'false' (performance warning) [c:\Users\cryptopp\cryptest.vcxproj]
  validat1.cpp(1090): warning C4800: 'CryptoPP::word32' : forcing value to bool
 'true' or 'false' (performance warning) [c:\Users\cryptopp\cryptest.vcxproj]
  validat1.cpp(1099): warning C4800: 'CryptoPP::word32' : forcing value to bool
 'true' or 'false' (performance warning) [c:\Users\cryptopp\cryptest.vcxproj]
2017-08-20 07:15:02 -04:00
Jeffrey Walton 88f08afcb0
Add additional VIA RNG tests
The are configurations tests as recommended by Cryptography Research, Inc in their 2003 audit report
2017-08-20 07:01:59 -04:00
Jeffrey Walton 7fb5953055
Add VIA Padlock RNG 2017-08-19 15:41:45 -04:00
Jeffrey Walton adfb30a579
Clear Coverity finding CHECKED_RETURN (CID 182769) 2017-08-18 04:51:50 -04:00
Jeffrey Walton e2c377effd Split source files to support Base Implementation + SIMD implementation (GH #461)
Split source files to support Base Implementation + SIMD implementation
2017-08-17 12:33:43 -04:00
Jeffrey Walton 953252e44d
Move from 'static' to 'enum' for class constants
Enums don't take up space in class objects. Its should result in smaller objects and faster code
2017-08-11 17:13:15 -04:00
Jeffrey Walton a2cab93117
Add hash static transform test (Issue 455) 2017-08-04 23:35:38 -04:00
Jeffrey Walton 860a9f4266
Use non-0 seed OldRandomPool test
This should tickle endianness issues
2017-08-04 16:57:45 -04:00
Jeffrey Walton e52be9ae84
Clear declaration hides previous local declaration 2017-08-04 07:28:35 -04:00
Jeffrey Walton 76ff3fc03b
Remove pre-Crypto++ 5.5 interface
Users of OldRandomPool must use the new interface. All that means is they must call IncorporateEntropy instead of Put, and GenerateBlock instead of Get
2017-08-02 19:43:56 -04:00
Jeffrey Walton 4da4ece5a5
Cut-in RandomNumberGenerator interface to OldRandPool
The existing interface still exists. The new interface is routed into the old methods. Without the new interface, using OldRandPool could result in:
    $ ./cryptest.exe v
    terminate called after throwing an instance of CryptoPP::NotImplemented
      what():  RandomNumberGenerator: IncorporateEntropy not implemented
    Aborted (core dumped)
2017-08-02 18:55:10 -04:00
Jeffrey Walton 5fbbc5311c
Add self tests for OldRandomPool
We still need to get the test result cross-validated
2017-08-01 18:57:23 -04:00
Jeffrey Walton 7ac77ca9ac Revert "Revert "Clear Visual Studio warnings (Issue 412)""
This reverts commit c3871aec94.
2017-06-02 05:18:52 -04:00
Jeffrey Walton c3871aec94 Revert "Clear Visual Studio warnings (Issue 412)"
This reverts commit eb3b27a6a5. The change broke GCC 4.8 and unknown version of Clang on OS X. UB reported the OS X break, and JW found duplicated the break on a ARM CubieTruck with GCC 4.8.
2017-06-02 05:06:56 -04:00
Jeffrey Walton eb3b27a6a5
Clear Visual Studio warnings (Issue 412) 2017-05-30 16:37:41 -04:00
Jeffrey Walton ae3922dda0
Remove calls to cout.flush() for AppVeyor
They seemed to produce a hang when running self tests in AppVeyor.
Also use IsDebuggerPresent() to determine when we should call DebugBreak(). The OS killed our debug build when fuzzing caused an assert to fail
2017-05-29 00:43:20 -04:00
Jeffrey Walton 9dcb72f9e5
Fix "error LNK2019: unresolved external symbol TestAutoSeededX917()" under Windows Phone 2017-05-18 09:35:09 -04:00
Jeffrey Walton ddcd70b152
Fix "error C2065: prng undeclared identifier" under Windows Phone 2017-05-18 08:36:00 -04:00
Jeffrey Walton 1b1c32d7cf
Build RDRAND for all platofrms (Issue 419, PR 424)
We have not been able to determine a reliable way to detect cpu's and platforms with Cmake. We are side stepping the Cmake problem by building rdrand.cpp all the time. If its not avilable for a cpu or platform, then RDRAND or RDSEED throw an exception.
2017-05-17 16:21:20 -04:00
Jeffrey Walton 32ab4af5ff
Add Threefish to project files
Whitespace check-in
2017-05-14 15:27:50 -04:00
Jeffrey Walton 537ee61ade
Switch to _MSC_FULL_VER for SP1 releases 2017-05-11 12:05:57 -04:00
Jeffrey Walton 07dbcc3d96
Add Inflator::BadDistanceErr exception (Issue 414)
The improved validation and excpetion clears the Address Sanitizer and Undefined Behavior Sanitizer findings
2017-05-10 18:17:12 -04:00
Jeffrey Walton 093499260e
Fix compile error with NO_OS_DEPENDENCE 2017-05-10 03:50:32 -04:00
Jeffrey Walton 151ec518e8
Add additional tests 2017-05-10 01:28:52 -04:00
Jeffrey Walton 0cbaea0428
Add tests for Information Dispersal and Secret Sharing 2017-05-09 18:44:45 -04:00
Jeffrey Walton 35ec7b105e
Enable MD4 testing under extended validations 2017-05-09 16:40:02 -04:00
Jeffrey Walton 33235f88db
Removed unneeded guard
Whitespace check-in
2017-05-09 16:23:30 -04:00
Jeffrey Walton a0832a63be
Whitespace check-in 2017-05-09 15:28:42 -04:00
Jeffrey Walton 4f7fee38d6
Mkaake RDRAND and RDSEED throw if not available
Fix Carmichael pseudo-prime tests
2017-05-09 13:20:53 -04:00
Jeffrey Walton 14236ce94b
Fold compressor and default encryptor tests 2017-05-06 19:20:57 -04:00
Jeffrey Walton bdd82d781e
Added additional tests 2017-05-06 18:51:55 -04:00
Jeffrey Walton c04b98072c
Fix compile error with -DNO_OS_DEPENDENCE
Whitespace check-in
2017-05-06 18:00:57 -04:00
Jeffrey Walton 374b8a419f
Added additional tests 2017-05-06 11:37:22 -04:00
Jeffrey Walton 02df6ea847
Add additional self tests under debug builds 2017-05-05 23:16:28 -04:00
Jeffrey Walton 9225ca09cb
Updated MersenneTwister tests
The tests now include the first 10 elements of the sequence to ensure a properly implemented algorithm and endianess correctness.
2017-05-05 19:00:17 -04:00
Jeffrey Walton c1377b2955
Add additional self tests under debug builds 2017-05-05 17:21:08 -04:00
Jeffrey Walton 5c1de7b5a5
Add variable block size support to test and benchmarks
CRYPTOPP_COVERAGE was added at 9614307ab7 to increase code coverage support. This commit enables additional validation routines when  CRYPTOPP_COVERAGE is in effect.
2017-05-04 19:11:24 -04:00
Jeffrey Walton 8ca0f47939
Add ARIA block cipher
This is the reference implementation, test data and test vectors from the ARIA.zip package on the KISA website. The website is located at http://seed.kisa.or.kr/iwt/ko/bbs/EgovReferenceList.do?bbsId=BBSMSTR_000000000002.

We have optimized routines that improve Key Setup and Bulk Encryption performance, but they are not being checked-in at the moment. The ARIA team is updating its implementation for contemporary hardware and we would like to use it as a starting point before we wander too far away from the KISA implementation.
2017-04-10 10:52:40 -04:00
Jeffrey Walton 7fb6b3df74
Fix compile under Visual Studio 2005/MSC 14.00
Previous testing occurred with Visual Studio 2005 SP 1, and it lacks some of the Safe C++/security enhanced functions.
2017-03-18 16:56:14 -04:00
Jeffrey Walton 14d92f9eba
Improve performance of RDRAND and RDSEED (Issue 387) 2017-03-07 03:57:23 -05:00
Jeffrey Walton 7f0c0fb0c0
Add ValidateBaseCode to DEBUG tests by default 2017-03-02 00:24:52 -05:00
Jeffrey Walton 5efb019d8b
Add C++ nullptr support (Issue 383) 2017-03-01 06:10:06 -05:00
Jeffrey Walton 0dc97f1d3a
Unroll decoder initialization (Issue 376) 2017-03-01 02:19:12 -05:00
Jeffrey Walton 73836e58a5
Add Test namespace within CryptoPP namespace (Issue 379) 2017-02-21 02:03:29 -05:00
Jeffrey Walton 6511868bc8
Guard use of LibraryVersion() under MSVC (Issue 371) 2017-02-07 15:03:13 -05:00
Jeffrey Walton 2868452193
Add NIST SP800-90A HMAC_DRBG generator
Move bodies out-of-line
Whitespace
2017-02-07 08:51:58 -05:00
Jeffrey Walton 42af35fd2b
Change to more intuitive names LibraryVersion and HeaderVersion (Issue 371) 2017-01-28 07:09:27 -05:00
Jeffrey Walton 6f7339c81b
Add BuildVersion and RuntimeVersion functions (Issue 371)
These function are intended to catch mining and matching of library versions. BuildVersion provides CRYPTOPP_VERSION when the shared object was built. RuntimeVersion provides CRYPTOPP_VERSION the app compiled against, which could be different than the shared object's version
2017-01-28 05:43:24 -05:00
Jeffrey Walton 81b1a18063
Change file preamble to include "originally written by Wei Dai"
We have made a fair number of changes, and we don't want WD to receive credit for issues he was not part of
2017-01-27 07:05:45 -05:00
Jeffrey Walton 1778432013
Add self tests for RoundUpToMultipleOf (Issue 360)
Thanks to Boldizsár Lipka
2017-01-10 22:09:38 -05:00
Jeffrey Walton 841c37e347
Add NIST_DRBG::Err class. Add additional checking per SP 800-90A. Update documentation 2017-01-01 05:53:55 -05:00
Jeffrey Walton 5c932fcc3b
Add NIST SP800-90A Hash_DRBG generator 2016-12-30 21:46:03 -05:00
Jeffrey Walton 06f79d904d
Remove vectorization test. This one test needs to be in its own script 2016-12-24 07:25:12 -05:00
Jeffrey Walton 9739ba8afe
Add Aumasson and Bernstein's SipHash (Issue 348) 2016-12-17 03:58:36 -05:00
Jeffrey Walton cecf719fcd
Add German digital signature algorithm (ECGDSA) (Issue 113)
Also see ISO/IEC 15946 and http://www.teletrust.de/fileadmin/files/oid/ecgdsa_final.pdf
2016-12-13 16:20:41 -05:00
Jeffrey Walton 26db40567d
Add Integer Bitops tests (Issue 344) 2016-12-06 20:56:57 -05:00
Jeffrey Walton ba75834ae9
Removed VC++ 5.0 and 6.0 workarounds (Issue 342) 2016-12-03 05:05:56 -05:00
Jeffrey Walton 62e99837e8
Add Poly1305 class (Issue 338) 2016-11-27 15:31:50 -05:00
Jeffrey Walton ac01277d93
Add X86 SHA cpu feature detection 2016-10-26 22:35:24 -04:00
Jeffrey Walton e794d53806
Cleanup comments 2016-10-18 02:23:07 -04:00
Jeffrey Walton 51d3cc945f
Switch to std::copy due to MinGW issues with memcpy_s
Also see http://github.com/weidai11/cryptopp/issues/28 and http://groups.google.com/d/msg/cryptopp-users/PRTVKTh0gRk/euPM_TzdBAAJ
2016-10-18 02:02:49 -04:00
Jeffrey Walton 54d17c7361
Updated CRYPTOPP_ASSERT based on comments
Also see 399a1546de (commitcomment-19448453)
2016-10-17 22:00:31 -04:00
Jeffrey Walton c621ce0532
Add misc.h header for library's memcpy_s 2016-10-11 00:02:23 -04:00
Jeffrey Walton 32fa9f6a8b
Remove deprecated warning supressions under MSC
pragma warning(disable: 4996)
2016-10-10 17:33:13 -04:00
Jeffrey Walton fb6a11ff08 Remove library supplied aesenc, aesdec and friends (Issue 206) 2016-09-18 21:06:41 -04:00
Jeffrey Walton 01b4ada148 Merge dev-branch 'trap' into 'master' 2016-09-17 17:21:53 -04:00
Jeffrey Walton 91ca6c117d Change from NDEBUG to CRYPTOPP_DEBUG in source files to ensure all debug behavior pivots on CRYPTOPP_DEBUG, and not NDEBUG (Issue 277, CVE-2016-7420) 2016-09-16 14:51:48 -04:00
Uri Blumenthal 8ad82f3f66 $%^@! 448 bits is 56 bytes, not 58!!! Fixing that oversight. 2016-09-16 12:36:05 -04:00
Uri Blumenthal 58c33810e7 Restore MARS capability to use 448-bit keys 2016-09-16 12:19:12 -04:00
Jeffrey Walton 399a1546de Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420)
trap.h and CRYPTOPP_ASSERT has existed for over a year in Master. We deferred on the cut-over waiting for a minor version bump (5.7). We have to use it now due to CVE-2016-7420
2016-09-16 11:27:15 -04:00
Jeffrey Walton 0d66fd8f82 Fixed use of FixedSizeAlignedSecBlock and non-aligned allocator in validat1.cpp (Issue 256) 2016-09-09 06:33:31 -04:00
Jeffrey Walton 7f958575ea Squashed commit of the following:
commit 47c75c6e9397e240919207e50e5a611d3e2a2428
Merge: d7685c2 42085ee
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 20:20:39 2016 -0400

    Attempting to fix binary file merge conflict

commit d7685c2d946beecc419ddb6901c24e972c7cf3ee
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 16:39:23 2016 -0400

    Add vsClean.cmd to vs2010.zip

commit 4b96fdf1c551260da60eb021f324bcc3fcfec626
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 16:15:38 2016 -0400

    Add Keccak to vs2010.zip

commit 3962db73b7113ee805b46a5bb4da64e204fe6bb0
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 15:40:35 2016 -0400

    Fold hmqv.cpp and fhmqv.cpp into mqv.cpp. There's no need for three empty source files

commit 44401448cbb6c8125b0f1ab4419c5b174408ffd7
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 15:39:23 2016 -0400

    Fold hmqv.cpp and fhmqv.cpp into mqv.cpp. There's no need for three empty source files

commit 847bfccb8d5c388e67745dc8c69768fa503c5135
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 14:48:02 2016 -0400

    Whitespace cleanup

commit 46a37be6fef361704dcf852bc9a099ce0a1da4c8
Merge: aefb8f8 3697867
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 14:43:01 2016 -0400

    Merge 'master' into 'keccak'

commit aefb8f8ff2b81b967089c53b457a92fc6f7544d6
Merge: 51a828b 3c91d93
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 12:39:51 2016 -0400

    Merge 'master' into 'keccak'

commit 51a828b88e37a4d18abb00300cd5522bd0e110c5
Merge: 4152870 e7c7722
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 10:41:36 2016 -0400

    Merge 'master' into 'keccak'

commit 415287041e69ddadf5ca1f6fc794b87e145fc2db
Merge: 357a0c5 83ac849
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 10:34:45 2016 -0400

    Merge 'master' into 'keccak'

commit 357a0c510f75e4e58078b500dd469462e90f7650
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 10:13:32 2016 -0400

    Removed deprecated warning from SHA3 classes

commit 5cf9ec10d53b895b5a583e265e4e1298ed402195
Merge: 10ce0ed c2d60cc
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 09:43:15 2016 -0400

    Merge 'master' into 'keccak'

commit 10ce0ed4c5b8a1ea230062fd2dfdec0d87ec5b42
Author: Jeffrey Walton <noloader@gmail.com>
Date:   Thu Sep 8 09:37:40 2016 -0400

    Add Keccak implementation based on early SHA3. Change SHA3 to NIST FIPS 202 conforming implementation
2016-09-08 20:24:25 -04:00
Jeffrey Walton 01b40aab31 Merge 'master' into 'hmqv' 2016-09-08 01:30:29 -04:00
Jeffrey Walton c80d179274 Merge 'master' into 'hmqv' 2016-09-07 12:29:48 -04:00
Jeffrey Walton 53bc3f146a Merge 'master' into 'constexpr' 2016-09-07 12:29:43 -04:00
Jeffrey Walton 8e5663fe23 Fix "error: integer constant is too large for ‘long’ type" on PowerMac 2016-09-07 12:29:29 -04:00
Jeffrey Walton 416605c311 Add additional KEYLENGTH and DEFAULT_KEYLENGTH tests 2016-09-07 10:10:27 -04:00
Jeffrey Walton f0e7b45bcb Remove comma operator from return values for StaticGetDefaultRounds and StaticGetValidKeyLength in non-constexpr builds (Issue 255) 2016-09-07 09:32:06 -04:00
Jeffrey Walton 13037d8e64 Merge 'master' into 'hmqv' 2016-09-07 01:29:22 -04:00
Jeffrey Walton c45c854da0 Merge 'master' into 'constexpr' 2016-09-07 01:29:18 -04:00
Jeffrey Walton e91c85e84d Add tests for word64 and word128 Allocate, Concatenate, Append, FixedSizeAllocator Grow and Overflow. Add test for HuffmanEncoder::GenerateCodeLengths 2016-09-07 01:29:08 -04:00
Jeffrey Walton cdf659a277 Const-ify input, ky and iv 2016-09-06 23:04:42 -04:00
Jeffrey Walton 622e958098 Cleared "declaration hides other declaration" under VS2015 2016-09-06 22:57:46 -04:00
Jeffrey Walton edf7bd8fa6 Add StaticGetValidKeyLength tests for MARS, RC5 and RC6 block ciphers (Issue 252) 2016-09-05 13:08:15 -04:00
Jeffrey Walton 022c33a172 Add StaticGetValidKeyLength tests for block ciphers (Issue 252) 2016-09-05 11:35:00 -04:00
Jeffrey Walton 88bc98fa25 Modify "Algorithm key lengths" output format 2016-09-05 09:37:51 -04:00
Jeffrey Walton 5057991a31 Add StaticGetValidKeyLength tests for RijndaelEncryption, RijndaelDecryption, TwofishEncryption and TwofishDecryption 2016-09-05 09:10:12 -04:00
Jeffrey Walton 6f4bcfd88f Merge branch 'master' into hmqv 2016-08-21 15:10:58 -04:00
Jeffrey Walton 898d6a3f78 Fix compile under VS2012 X86 2016-08-21 04:36:32 -04:00
Jeffrey Walton 1e7c837442 Add test for Huffman codes (Issue 242) 2016-08-21 03:18:26 -04:00
Jeffrey Walton 11c723e1b9 Merge branch 'master' into hmqv 2016-07-24 20:43:25 -04:00
Jeffrey Walton f0f0408c89 Add polynomial multiply instruction detection 2016-07-24 09:48:28 -04:00
Mouse c6c0bdeebe Revert "Add HMQV implementation (and merge the old FHMQV into the new codebase)"
This reverts commit ec35099589.
2016-07-06 12:15:47 -04:00
Mouse 5bdabb7a68 Add HMQV and merge untracked FHMQV 2016-07-04 13:05:38 -04:00
Uri Blumenthal ec35099589 Add HMQV implementation (and merge the old FHMQV into the new codebase) 2016-07-01 14:30:43 -04:00
Jeffrey Walton 36aeb16171 Cleared "warning: unused variable ‘hasPadlockRNG’". Whitespace cleanup 2016-06-16 01:15:07 -04:00
Jeffrey Walton 77e4bd7a7b Cleared warning 'Warning: key hides CryptoPP::FixedRoundsCipherFactory::key' 2016-06-09 00:15:02 -04:00