Commit Graph

2613 Commits (093499260ec23c901059c45a4048781a8da41848)

Author SHA1 Message Date
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 4904a951ce
Fix bad code generation with GCC, -Os and rdseed 2017-05-10 01:28:25 -04:00
Jeffrey Walton 5c42ec96f2
Fix bad GCC code generation with -Os
It appears GCC was doing something wonky with the call to RDSEED. The test script was experiencing a hang
2017-05-09 22:47:14 -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 3b4a9e2ccf
Update padding check logic 2017-05-09 15:48:52 -04:00
Jeffrey Walton f817fc7c2e
Clear C4100 warning (Issue 412) 2017-05-09 15:40:49 -04:00
Jeffrey Walton a0832a63be
Whitespace check-in 2017-05-09 15:28:42 -04:00
Jeffrey Walton bc29f1b5b8
Updated documentation 2017-05-09 15:13:11 -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 8a177c58e6
Add validation for W3C_PADDING InitializeDerivedAndReturnNewSizes
This should have occurred with PR 368 or Commit 8e088b4865
2017-05-09 00:58:42 -04:00
Jeffrey Walton 6ca68e714b
Updated documentation 2017-05-08 23:25:39 -04:00
Jeffrey Walton ffa92b09e6
Add test for Carmichael pseudo-primes 2017-05-08 22:36:58 -04:00
Jeffrey Walton ba8882db39
Use [31398, 31468] for prime gap test 2017-05-08 17:03:06 -04:00
Jeffrey Walton 7421bd2055
Fix "Load of address X with insufficient space for an object of type const word32" 2017-05-08 16:17:17 -04:00
Jeffrey Walton fe2d5752cd
Switch to library's GetUserKey 2017-05-08 14:32:30 -04:00
Jeffrey Walton 7ba33868e0
Add zLib compressor and decompressor tests 2017-05-08 06:08:27 -04:00
Jeffrey Walton 798f1c9ed8
Clear warnings under Visual Studio 2017-05-08 05:13:55 -04:00
Jeffrey Walton 238b5e6188
Whitespace check-in 2017-05-08 03:20:23 -04:00
Jeffrey Walton 1d7dfc6927
Port Kalyna to big-endian (Issue 411)
Tested on GCC110 from the GCC compile farm. Performance is comparable to AES on GCC110.
2017-05-08 01:59:37 -04:00
Jeffrey Walton c35e616cbf
Make make_odd_key_NNN a template function 2017-05-06 23:59:17 -04:00
Jeffrey Walton c62e1ade6e
Add Makefile recipe for Valgrind builds 2017-05-06 22:54:49 -04:00
Jeffrey Walton 9cf9f4235d
Add timing attack countermeasures to Kalyna (Issue 411)
The code at check-in a5c67cfdd6 did not include it. Unlike Threefish, it looks like Kalyna could benefit from the cache hardening given how similar Kalyna is to AES. The hardening costs less than 0.1 cpb, which equates to about 199 MB/s vs 201 MB/s on a 6th gen Skylake
2017-05-06 20:14:26 -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 3ea8e0655f
Add constants to default encryptor classes 2017-05-06 09:07:24 -04:00
Jeffrey Walton 6ad999ef2f
Updated documentation 2017-05-06 08:18:54 -04:00
Jeffrey Walton a5c67cfdd6
Add Kalyna block cipher (Issue 411)
Thanks to Roman Oliynykov and Oleksandr Kazymyrov for their assistance. Thanks to Keru Kuro for the reference implementation.
2017-05-06 00:24:35 -04:00
Jeffrey Walton 06092259c2
Make UncheckedKeySet and ProcessXorBlocks protected 2017-05-06 00:21:24 -04:00
Jeffrey Walton 02df6ea847
Add additional self tests under debug builds 2017-05-05 23:16:28 -04:00
Jeffrey Walton ac930b084d
Add additional tests
Whitespace check-in
2017-05-05 20:34:43 -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 9614307ab7
Add CRYPTOPP_COVERAGE define for 'make coverage' recipe 2017-05-04 03:01:07 -04:00
Jeffrey Walton 7131a0fbb8
Add VariableBlockSize constants to FixedBlockSize
This also follows the pattern set forth by FxiedKeyLength and VariableKeyLength
2017-05-03 22:34:37 -04:00
Jeffrey Walton 2d9678fa6d
Remove BLOCKSIZE from VariableBlockSize (Issue 408)
VariableBlockSize and VariableBlockCipherImpl were added at Commit bd8edfa87b. Reflecting on FixedKeyLength and VariableKeyLength, the const KEYLENGTH is only provided by FixedKeyLength. VariableKeyLength provides DEFAULT_KEYLENGTH. This check-in makes VariableBlockSize follow VariableKeyLength.
This check-in also splits block size and iv length. Its conceivable we will encounter a cipher with a block size of 128-bits with an iv of 256-bits. The bd8edfa87b check-in could not handle the difference, so we fix it now.
2017-05-03 21:06:49 -04:00
Jeffrey Walton ca9e788fbf
Add const GetStream() member function 2017-05-02 18:25:58 -04:00
Jeffrey Walton 554b7a2747
Fix "error: inlining failed ... target specific option mismatch (Issue 407) 2017-05-01 17:54:05 -04:00
Jeffrey Walton f8c1348667
Fix "There are no arguments to ‘GetAlgorithm’ that depend on a template parameter" 2017-05-01 16:56:21 -04:00
Jeffrey Walton a33a3435f4
Remove HashFunction typedef (Issue 369)
This should have happened when we removed most of MAINTAIN_BACKWARDS_COMPATIBILITY artifacts.
2017-05-01 16:41:43 -04:00
Jeffrey Walton 9db82ed793
Use symbolic defines StaticGetDefaultBlockSize 2017-05-01 16:40:32 -04:00
Jeffrey Walton bd8edfa87b
Add variable block size support for block ciphers
This should lead the way for more modern block ciphers like Threefish and Kalyna. It tested well with both regular cipher modes (the mode has an instance of the cipher) and external cipher modes (the cipher and mode are distinct objects, and the mode holds a reference to the cipher).

We still have to work out the details of naming a cipher. For example, Kalyna with a 128-bit key can use a 128-bit or 256-bit block size. Kalyna-128 is not enough to describe the algorithm and locate it in the object registry. Kalyna-128-128 looks kind of weird; maybe Kalyna-128(128) or Kalyna-128(256) would be better.

Here are the initial test cases to verify functionality:

byte key[64] = {}, iv[32] = {};

ECB_Mode<Kalyna>::Encryption enc1;
enc1.SetKey(key, 16);

CBC_Mode<Kalyna>::Encryption enc2;
enc2.SetKeyWithIV(key, 16, iv);

AlgorithmParameters params = MakeParameters
                        (Name::BlockSize(), 32)
                        (Name::IV(), ConstByteArrayParameter(iv, 32));

CTR_Mode<Kalyna>::Encryption enc3;
enc3.SetKey(key, 16, params);

CBC_Mode<Kalyna>::Encryption enc4;
enc4.SetKey(key, 32, params);

Kalyna::Encryption enc5;
ECB_Mode_ExternalCipher::Encryption ecb(enc5);
ecb.SetKey(key, 16, params);

Kalyna::Encryption enc6;
ECB_Mode_ExternalCipher::Encryption cbc(enc6);
cbc.SetKey(key, 32, params);
2017-05-01 16:23:57 -04:00
Jeffrey Walton 1543649ead
Cleanup ARIA typedefs 2017-04-28 21:35:55 -04:00
Jeffrey Walton ff9b46e513 Merge pull request #405 from kvirund/alignment.issues
Added -xmemalign=4i for Sparc
2017-04-27 15:52:39 -04:00
Anton Gorev 7eeab3d0bf Added -xmemalign=4i compiler option for Sparc's. 2017-04-27 14:15:12 -05:00