Commit Graph

155 Commits

Author SHA1 Message Date
Jeffrey Walton
11eee26d76
Add LSH-256 and LSH-512 hash functions (GH #1025, PR #1026)
Add South Korea's LSH-256 and LSH-512 families of hash functions.
2021-04-16 03:23:15 -04:00
Jeffrey Walton
ab9461ec5e
Add additional ASN.1 self tests 2021-03-21 04:06:38 -04:00
Jeffrey Walton
9f0b2e27bb
Fix MinGW compile
Also see https://groups.google.com/d/msg/cryptopp-users/fVLk79sIBEE/Euhu6x9nAQAJ
2020-01-27 02:27:51 -05:00
Jeffrey Walton
b91ce07bfb
Revert BlowfishCompat changes (PR #877) 2019-10-12 09:40:34 -04:00
Jeffrey Walton
76c29eadaf
Add XTS block cipher mode of operation (GH #891, PR #892) 2019-10-12 07:14:38 -04:00
Răzvan Cojocaru
9912d0630e Add support for Mcrypt's blowfish-compat (PR #877) 2019-09-29 20:18:56 -04:00
Jeffrey Walton
033f204a86 Fix .Net 2002 compile
This testing occurs on Windows XP. We are still rockin it
2019-08-27 14:44:27 -04:00
Jeffrey Walton
b1c691b53a
Fix RDSEED hang on x86 (GH #872) (#873)
Calls to `MASM_RDSEED_GenerateBlock` would hang for an unknown reasons on Windows 10 and VS2017/VS2019 toolchains. Similar calls to `MASM_RDRAND_GenerateBlock` worked as expected. They were effectively the same code. The only differences were the function names and the opcodes (they were literally copy/paste).

Splitting `rdrand.asm` (with both `RDRAND` and `RDSEED`) into `rdrand.asm` (with `RDRAND`) and `rdseed.asm` (with `RDSEED`) resolved the issue. We don't know why.
2019-08-06 21:01:22 -04:00
Jeffrey Walton
c9ef9420e7
Fix ECP leakage in Add() and Double() (GH #869, PR #871)
This check-in provides the fix for leaks in ECP's Add() and Double(). The fixes were taken from Joost Renes, Craig Costello, and Lejla Batina's [Complete addition formulas for prime order elliptic curves](https://eprint.iacr.org/2015/1060.pdf).

The Pull Request includes two additional changes that were related to testing the primary fix. First, an `AuthenticatedKeyAgreementWithRolesValidate` interface was added. It allows us to test key agreement when roles are involved. Roles are "client", "server", "initiator", "recipient", etc.

Second, `SetGlobalSeed` was added to `test.cpp` to help with reproducible results. We had code in two different places that set the seed value for the random number generator. But it was sloppy and doing a poor job since results could not be reproduced under some circumstances.
2019-08-05 03:51:58 -04:00
Jeffrey Walton
00f9c1f0eb
Enable extended output in SHAKE-128 and SHAKE-256 (GH #805, PR #806) 2019-02-13 11:31:18 -05:00
Jeffrey Walton
5603661eec
Add ChaChaTLS implementation (GH #265)
We tweaked ChaCha to arrive at the IETF's implementation specified by RFC 7539. We are not sure how to handle block counter wrap. At the moment the caller is responsible for managing it. We were not able to find a reference implementation so we disable SIMD implementations like SSE, AVX, NEON and Power4. We need the wide block tests for corner cases to ensure our implementation is correct.
2019-01-24 09:36:05 -05:00
Jeffrey Walton
6ada677461
Whitespace check-in 2019-01-22 03:44:34 -05:00
Jeffrey Walton
8572541841
Use #pragma omp simd for OpenMP 3.0 compilers (GH #787) 2019-01-22 03:42:53 -05:00
Jeffrey Walton
2113a471eb
Fix compile on MinGW32 2019-01-16 03:14:06 -05:00
Jeffrey Walton
dbec62cdb2
Update distclean rule in cryptest.nmake 2019-01-09 01:04:59 -05:00
Jeffrey Walton
7428fa82ab
Clear unused variable warning with GCC 2019-01-08 17:31:53 -05:00
Jeffrey Walton
6d5316812f
Fix compile when NO_OS_DEPENDENCE is defined 2019-01-08 17:03:45 -05:00
Jeffrey Walton
a79fe3a826
Use _NSGetExecutablePath on OS X (GH #760)
Also test for symlinks and reject them, if found.
2019-01-02 23:43:44 -05:00
Jeffrey Walton
7819af671b
Use _get_pgmptr on Windows (GH #760)
Let's see how well this works across the versions of Visual Studio we support
2019-01-02 20:22:55 -05:00
Jeffrey Walton
748ebe6328
Use getexecname() on Solaris (GH #) 2019-01-02 19:46:00 -05:00
Jeffrey Walton
9484815960
Cache DataDir when C++11 dynamic init is available (GH #760) 2019-01-02 03:30:49 -05:00
Jeffrey Walton
83a37b8284
Fix Debug PowerPC build 2018-12-26 12:29:32 -05:00
Jeffrey Walton
a749296504
Add additional self tests
And whitespace check-in
2018-12-25 10:08:49 -05:00
Jeffrey Walton
77923a291a
Add Langley's curve25519 (GH #761, PR# 762) 2018-12-11 16:17:56 -05:00
Jeffrey Walton
5b0df2592a
Handle test vectors with extensions 2018-12-07 14:25:10 -05:00
Jeffrey Walton
1c88fd6f59
Add search for test vectors and test data (GH #760) 2018-12-07 12:25:52 -05:00
Jeffrey Walton
af9fb9d21e
Add ChaCha to self tests (GH #732) 2018-11-08 22:08:59 -05:00
Jeffrey Walton
ca08d63a10
Add SIMON and SPECK to validation suite 2018-10-14 10:45:46 -04:00
Jeffrey Walton
1d5eaf5268
Fix test scripts on ancient Bash
This showed up on Solaris 9 with Bash 2.05. Also see https://unix.stackexchange.com/q/468579/56041
2018-09-12 13:06:28 -04:00
Jeffrey Walton
f2171cbe2f
Remove Thread and Socket classes (GH #208, PR #703)
Also see https://groups.google.com/forum/#!topic/cryptopp-users/5btwLoxXXD4.
2018-08-17 23:55:39 -04:00
Jeffrey Walton
989c3bfbf2
Update comments 2018-08-09 18:18:40 -04:00
Jeffrey Walton
d4428d7f1c
Add VectorLoad and VectorStore test code
Applies to POWER4 and above only
2018-08-06 22:19:59 -04:00
Jeffrey Walton
3ff7d7f028
Add ARM AES asm implementation from Cryptogams (GH #683) 2018-07-11 06:59:44 -04:00
Jeffrey Walton
1836a7feb4
Cleanup datatest.cpp
Switch to non-blocking rngs for Linux and Windows
2018-07-10 17:34:55 -04:00
Jeffrey Walton
a2ca2cfc0f
Use OS rng as alternate test generator 2018-07-10 17:08:13 -04:00
Jeffrey Walton
50f99ae802
Increase use of ptrdiff_t when performing pointer math 2018-07-10 09:21:52 -04:00
Jeffrey Walton
989bf6dc5e
Add HC-256 stream cipher (GH #680) 2018-07-05 06:43:04 -04:00
Jeffrey Walton
dd31eb80c0
Add HC-128 stream cipher (GH #679) 2018-07-05 00:29:07 -04:00
Jeffrey Walton
d00777e1d7
Add Rabbit stream cipher (GH #678) 2018-07-04 03:47:28 -04:00
Jeffrey Walton
61f635b837
Add additional SIMECK tests (GH #675) 2018-06-30 08:25:32 -04:00
Jeffrey Walton
54d5100344
Add CHAM lightweight block cipher (PR #670)
Add CHAM lightweight block cipher
2018-06-17 23:24:47 -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
9b174e84de
Remove AsymmetricAlgorithm::BERDecode (GH #569) 2018-01-21 08:45:02 -05: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
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
e4498a105e
Use ::time() and ::log() instead of std::time() and std::log() (GH #512)
The 35c0fa82fd change broke GCC 4.8
2017-09-20 18:43:51 -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
c40a4dc9f7
Fix Clang warning on missing template definitions 2017-08-16 12:21:07 -04:00