Commit Graph

66 Commits (1f06c512c4b6834656729061f1877bea2f90d5f9)

Author SHA1 Message Date
Jeffrey Walton 1f06c512c4
Add LEA lightweight block cipher (GH #669) 2018-06-17 22:36:41 -04:00
Jeffrey Walton 64d02e3a18
Add scrypt key derivation function (GH #613, PR #626) 2018-03-31 20:09:38 -04:00
Jeffrey Walton ff82b5a886
Fix incorrect InverseMod (GH #602) (#603) 2018-03-25 00:43:21 -04:00
Jeffrey Walton 13ea8f374f
Add interface to TweetNaCl library (#566)
TweetNaCl is a compact reimplementation of the NaCl library by Daniel J. Bernstein, Bernard van Gastel, Wesley Janssen, Tanja Lange, Peter Schwabe and Sjaak Smetsers. The library is less than 20 KB in size and provides 25 of the NaCl library functions.

The compact library uses curve25519, XSalsa20, Poly1305 and SHA-512 as default primitives, and includes both x25519 key exchange and ed25519 signatures. The complete list of functions can be found in TweetNaCl: A crypto library in 100 tweets (20140917), Table 1, page 5.

Crypto++ retained the function names and signatures but switched to data types provided by <stdint.h> to promote interoperability with Crypto++ and avoid size problems on platforms like Cygwin. For example, NaCl typdef'd u64 as an unsigned long long, but Cygwin, MinGW and MSYS are LP64 systems (not LLP64 systems). In addition, Crypto++ was missing NaCl's signed 64-bit integer i64.

Crypto++ enforces the 0-key restriction due to small points. The TweetNaCl library allowed the 0-keys to small points. Also see RFC 7748, Elliptic Curves for Security, Section 6.

TweetNaCl is well written but not well optimized. It runs 2x to 3x slower than optimized routines from libsodium. However, the library is still 2x to 4x faster than the algorithms NaCl was designed to replace.

The Crypto++ wrapper for TweetNaCl requires OS features. That is, NO_OS_DEPENDENCE cannot be defined. It is due to TweetNaCl's internal function randombytes. Crypto++ used DefaultAutoSeededRNG within randombytes, so OS integration must be enabled. You can use another generator like RDRAND to avoid the restriction.
2018-01-17 22:02:09 -05:00
Jeffrey Walton 746fd6a648
add self test for custom Encoder and Decoder alphabet (GH #562) 2018-01-12 18:59:48 -05:00
Linmao Song 1823b9d9c4 Fix error in bits2octets: should use the base point's bit count, instead of the hash value's. Also add test case for GetRandom, with original data from RFC6979 (#560) 2018-01-10 20:18:15 -05:00
Jeffrey Walton e85b388234
Add thorough param to ValidateECGDSA 2017-11-25 03:27:07 -05:00
Jeffrey Walton 5267723a49
Add SM3 hash function (GH #541) 2017-11-23 23:19:09 -05: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 7fb5953055
Add VIA Padlock RNG 2017-08-19 15:41:45 -04:00
Jeffrey Walton a2cab93117
Add hash static transform test (Issue 455) 2017-08-04 23:35:38 -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 8c02c60584
Add missing <sstream> header
This failed under C++03 builds. C++11 was OK, so it slipped past the initial smoke tests
2017-05-20 04:09:17 -04:00
Jeffrey Walton 4fef9b8837
Rework benchmark code
This change moves test selections from test.cpp into bench.cpp. It also allows us finer control over test classes and algorithms
2017-05-19 23:29:59 -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 5f0cbde980
Removed MSVC warning suppression for many warnings (Issue 412)
Most of these appear to have been cleared over the last couple of years.

C4127 is too prevelant. We are probably going to have to live with it.

We may be able to clear C4250 with a using statement. For example 'using ASN1CryptoMaterial::Load'.

MSVC resisted clearing C4661 by pushing/poping in iterhash.h and osrng.h. It was like MSVC simply ignored it.
2017-05-16 03:52:03 -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 c62e1ade6e
Add Makefile recipe for Valgrind builds 2017-05-06 22:54:49 -04:00
Jeffrey Walton 14236ce94b
Fold compressor and default encryptor tests 2017-05-06 19:20:57 -04:00
Jeffrey Walton 02df6ea847
Add additional self tests under debug builds 2017-05-05 23:16:28 -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 661ddad1f2
Fix Solaris compile due to StreamState
"validate.h", line 155: Error: Overloading ambiguity between "std::ios::basic_ios(std::streambuf *)" and "std::ios::basic_ios(int)".
2017-03-24 23:24:46 -04:00
Jeffrey Walton 71afcadadb
Clear Coverity STREAM_FORMAT_STATE (CID 177736, 177737, 177732)
Yet another attempt to clear the stream state finding.
2017-03-18 09:48:54 -04:00
Jeffrey Walton 13bcfbe249
Add width field to StreamState 2017-03-18 08:18:05 -04:00
Jeffrey Walton ad47231dc0
Switch to std::ostream::char_type for StreamState 2017-03-18 08:11:44 -04:00
Jeffrey Walton 1bfb6be934
Clear Coverity STREAM_FORMAT_STATE (CID 177735)
This was a valid finding in the Test suite. The stream state findings are annoying.
2017-03-18 05:08:04 -04:00
Jeffrey Walton 804feccfd9
Add TimeToString function (Issue 386)
This was supposed to be checked-in with ce38a411fc
2017-03-08 17:15:16 -05:00
Jeffrey Walton 73836e58a5
Add Test namespace within CryptoPP namespace (Issue 379) 2017-02-21 02:03:29 -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 1778432013
Add self tests for RoundUpToMultipleOf (Issue 360)
Thanks to Boldizsár Lipka
2017-01-10 22:09:38 -05:00
Jeffrey Walton 5c932fcc3b
Add NIST SP800-90A Hash_DRBG generator 2016-12-30 21:46:03 -05:00
Jeffrey Walton 7031fc7f6f
Add test cases for ASN.1 parsing (Issue 346) 2016-12-24 04:56:34 -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 62e99837e8
Add Poly1305 class (Issue 338) 2016-11-27 15:31:50 -05: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 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
Jeffrey Walton 6f4bcfd88f Merge branch 'master' into hmqv 2016-08-21 15:10:58 -04:00
Jeffrey Walton 1e7c837442 Add test for Huffman codes (Issue 242) 2016-08-21 03:18:26 -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 bf22c4575b Add CRC-32C using CXX and SSE4 (Issue 160) 2016-04-24 13:24:45 -04:00
Jeffrey Walton 63cd55901c Added BLAKE2 self tests 2016-04-18 02:39:10 -04:00
Jeffrey Walton 0c1f7d30ea Added additional tests 2016-01-03 12:53:46 -05:00