Commit Graph

2541 Commits (cfa98a32c0e5231ce2c37f2618ae67c31330500a)

Author SHA1 Message Date
Jeffrey Walton cfa98a32c0
Add Win64 to exclude until the issues are sorted out 2017-04-17 01:06:27 -04:00
Jeffrey Walton 3d9ac8f66f
Add Travis configuration file 2017-04-17 00:25:57 -04:00
Jeffrey Walton b784852998
Add no-asm target to ease testing of -DCRYPTOPP_DISABLE_ASM
This is intended to be used on Travis CI
2017-04-17 00:20:22 -04:00
Jeffrey Walton 7df4418258
Add allow_failures to appveyor.yml until we sort out some of the issues 2017-04-16 15:57:46 -04:00
Jeffrey Walton 3504f1da25
Add VS2010 - VS2017 images to appveyor.yml 2017-04-16 15:10:20 -04:00
Jeffrey Walton dad532cb4b
Remove stdio.h header 2017-04-16 13:23:27 -04:00
Jeffrey Walton 1d1a150737
Avoid extra loads of workspace variables 2017-04-16 13:00:45 -04:00
Jeffrey Walton ddc0f3a899
Switch to Put and Get blocks. Remove unneeded macros 2017-04-16 08:06:20 -04:00
Jeffrey Walton 83a87cb4df
Group DSA-RFC6979 tests together by hash value
Previously, all 1024-bit tests were run, and then 2048-bit tests were run. Splitting them meant there were two entries for DSA-RFC6979/SHA-1, two entries for DSA-RFC6979/SHA-256 and so on. Now there will be one entry output during testing.
2017-04-15 09:03:22 -04:00
Jeffrey Walton 106106813a
Add missing sha2 and sha3 test file names
sha2.txt and sha3.txt are just collections of other files, so they don't take up much space.

This commit stens from and exception when running 'cryptest.exe tv sha2' and  'cryptest.exe tv sha3'. Its not obvious the name of the file to be run sha2_224_fips_180.txt. Users should not have to hunt for the reason sha2 and sha3 do not work.
2017-04-15 08:50:03 -04:00
Jeffrey Walton 5e27404a15
Add missing sha2 and sha3 test file names
sha2.txt and sha3.txt are just collections of other files, so they don't take up much space.

This commit stens from and exception when running 'cryptest.exe tv sha2' and  'cryptest.exe tv sha3'. Its not obvious the name of the file to be run sha2_224_fips_180.txt. Users should not have to hunt for the reason sha2 and sha3 do not work.
2017-04-15 08:49:00 -04:00
Jeffrey Walton 922568864e
Convert tab to space for .appveyor.yml
The configuration validated but the test build died
2017-04-15 04:26:19 -04:00
Jeffrey Walton 2fba69fb16
Add whitespace to test_script cmd
Without the additional CRLF, Appveyor dies with on the command . The odd thing is, YAML validated OK.
2017-04-15 04:22:26 -04:00
Jeffrey Walton 424bd710ac
Add Configuration and Platform information 2017-04-15 04:15:06 -04:00
Jeffrey Walton 1ace49049a
Add clone depth to Appveyor 2017-04-15 03:12:08 -04:00
Jeffrey Walton c0d6f3882b
Add Appveyor configuration file 2017-04-15 02:54:35 -04:00
Jeffrey Walton 556e3610e8
Add CopyCryptestToRoot target
Also see https://www.cryptopp.com/wiki/MSBuild_(Command_Line)#CopyCryptestToRoot
2017-04-15 02:36:03 -04:00
Jeffrey Walton 163f8febe6
Fix comment 2017-04-14 07:19:04 -04:00
Jeffrey Walton 0f7aba8b4c Merge pull request #398 from anonimal/cmake
Build: apply patch for GNU assembler errors to CMake
2017-04-14 06:27:56 -04:00
Jeffrey Walton b081f7c634
Use full S1 table for timing attack counter measures
Change stride to cache line size divided by word size based on Yun's 32-bit word implementation
2017-04-14 06:24:54 -04:00
Jeffrey Walton cf160e91c4
Added comments on using InformationDisperseFile and SecretShareFile
This is based on feedback from https://groups.google.com/forum/#\!topic/cryptopp-users/XEKKLCEFH3Y
2017-04-13 23:13:07 -04:00
Jeffrey Walton bf92cb0039
Split regtest.cpp into regtest{1|2|3}.cpp
regtest.cpp is where ciphers register by name. The library has added a number of ciphers over the last couple of years and the source file has experienced bloat. Most of the ARM and MIPS test borads were suffering Out of Memory (OOM) kills as the compiler processed the source fille and the included header files.
This won't stop the OOM kills, but it will help the situation. An early BeagleBoard with 512 MB of RAM is still going to have trouble, but it can be worked around by building with 1 make job as opposed to 2 or 4.
2017-04-13 21:45:21 -04:00
Jeffrey Walton bae30d6767
Add ARIA to nmake makefile for Windows 2017-04-13 18:44:20 -04:00
Jeffrey Walton 70cf88f230
Apply S-box timing attack counter measures to ARIA
The ARIA S-boxes could leak timining information. This commit applies the counter measures present in Rijndael and Camellia to ARIA. We take a penalty of about 0.05 to 0.1 cpb. It equates to about 0 MiB/s on an ARM device, and about 2 MiB/s on a modern Skylake.

We recently gained some performance though use of SSE and NEON in ProcessAndXorBlock, so the net result is an improvement.
2017-04-13 17:46:51 -04:00
Jeffrey Walton 65c3c63b52
Breakout and cleanup macros. Add CRYPTOPP_ENABLE_ARIA_SSE2_INTRINSICS, CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS and CRYPTOPP_ENABLE_ARIA_NEON_INTRINSICS.
Tune CRYPTOPP_ENABLE_ARIA_SSE2_INTRINSICS and CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS macro for older GCC and Clang. Clang needs some more tuning on Aarch64 becuase performance is off by about 15%.

Add additional NEON code paths.

Remove keyBits from Aarch64 code paths.
2017-04-13 17:45:58 -04:00
Jeffrey Walton 471e2f0d91
Remove unneeded assert from Camellia 2017-04-13 16:53:53 -04:00
Jeffrey Walton 2bb36c790e
Add ARIA test vectors from RFC 5794 2017-04-13 16:00:59 -04:00
Jeffrey Walton 04908cca48
Improve x86 and x64 ARIA performance
The changes were meant to improve Windows, but GCC benefited more. Windows gained 0.3 cpb, while GCC gained 1.2 cpb
2017-04-13 06:52:56 -04:00
Jeffrey Walton 35f95fb739
Fix unaligned pointer crash on Win32 due to _mm_load_si128
The SSSE3 intrinsics were performing aligned loads using _mm_load_si128 using user supplied pointers. The pointers are only a byte pointer, so its alignment can drop to 1 or 2. Switching to _mm_loadu_si128 will sidestep potential problems. The crash surfaced under Win32 testing.

Switch to memcpy's when performing bulk assignment x[0]=y[0] ... x[3]=y[3]. I believe Yun used the pattern to promote vectorization. Some compilers appear to be braindead and issue integer move's one word at a time. Non-braindead compiler will still take the optimization when advantageous, and slower compilers will benefit from the bulk move. We also cherry picked vectorization opportunities, like in ARIA_GSRK_NEON.

Remove keyBits variable. We now use UncheckedSetKey's keylen throughout.

Also fix a typo in CRYPTOPP_BOOL_SSSE3_INTRINSICS_AVAILABLE. __SSSE3__ was listed twice.
2017-04-13 04:28:02 -04:00
Jeffrey Walton 59767be52e
Add Intel and ARM intrinsics
Win32 and Win64 benefited from the Intel intrinsics. A32 and Aarch64 benefited from the ARM intrinsics. The intrinsics shaved 150 to 350 cycles from key setup.

The intrinsics slowed modern GCC down a small bit, and did not appear to affect old GCC. As such, Intel intrinsics were only enabled for Microsoft compilers.

We were not able to improve encryption and decryption. In fact, some of the attempted macro conversions and intrinsics attempts slowed things down considerably. For example, GCC 5.4 on x86_64 went from 120 MB/s to about 70 MB/s when we tried to improve code around the Key XOR Layer (ARIA_KXL).
2017-04-12 23:28:41 -04:00
Jeffrey Walton f44e705c16 Add NEON intrinsics for ARIA_GSRK_NEON
Update documentation
2017-04-12 12:15:32 -04:00
Jeffrey Walton af561758df
Rework ARIA_GSRK to have MSVC generate "rotate imm" rather than "rot reg"
The immediate version of rotate can be 4 to 6 times faster than the register version
2017-04-11 20:47:54 -04:00
Jeffrey Walton d6b295203b
Additional library integration for ARIA 2017-04-11 16:19:36 -04:00
Jeffrey Walton 0d742591e0
Switch to code based on 32-bit implementation
The 32-bit code is based on Aaram Yun's code. Yun's code combined with a few library specific tweaks improves performance to roughly Camellia.
2017-04-11 11:39:45 -04:00
Jeffrey Walton 7990da2c02
Reformat aria.txt test vectors 2017-04-11 06:53:44 -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 8c7408bcd5
Fix typo 2017-04-03 20:27:49 -04:00
anonimal a9f2518a2c
Build: apply patch for GNU assembler errors to CMake
References weidai11/cryptopp#395
2017-03-29 07:01:04 +00:00
Jeffrey Walton c21023e2dc
Removed 'aligned' makefile target. It was made default in 5.6.5 2017-03-28 23:49:58 -04:00
Jeffrey Walton c305e88127
Fix runtime crash when CRYPTOPP_INIT_PRIORITY=0
Couple use of initialization priorities to no NO_OS_DEPENDENCE
Add comments explaining what integer does, how it does it, and why we want to inprove on the Singleton pattern as a resource manager.
Update documentation.
2017-03-27 06:06:12 -04:00
Jeffrey Walton 0e55f5ac7d
Remove g_pAssignIntToInteger pointer, add CRYPTOPP_NO_ASSIGN_TO_INTEGER (Issue 389)
This effectively decouples Integer and Public Key from the rest of the library. The change means a compile time define is used rather than a runtime pointer. It avoids the race with Issue 389.
The Public Key algorithms will fail if you use them. For example, running the self tests with CRYPTOPP_NO_ASSIGN_TO_INTEGER in effect results in "CryptoPP::Exception caught: NameValuePairs: type mismatch for 'EquivalentTo', stored 'i', trying to retrieve 'N8CryptoPP7IntegerE'". The exception is expected, and the same happend when g_pAssignIntToInteger was present.
2017-03-25 16:38:42 -04:00
Jeffrey Walton 6c50a99254
Fix GNUmakefile to keep *.s files
The distclean recipe deleted ASM files (*.s) rather than preprocessed ASM files (*.S). Leave them both now.
2017-03-25 01:42:23 -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 effe103641 Merge pull request #392 from janblome/issue391
Remove unnecessary static from reference to singleton
2017-03-23 16:45:18 -04:00
Jeffrey Walton 6381faf277
Rename rdrand.S to rdrand.s 2017-03-23 16:05:30 -04:00
Jeffrey Walton 30263ee497 Rename rdrand.S to rdrand.s
The file is not preprocessed
2017-03-23 15:39:43 -04:00
Jeffrey Walton d865cf9e62
Fix OpenBSD 6.0 compile with GCC 4.9 (Issue 395)
This check-in also enables the 64-bit RDRAND routines for X32. The changes were with held until they could be tested. The testing occurred with Issue 395
2017-03-22 17:26:25 -04:00
Jeffrey Walton 2ea91ba1b9
Fix ARM compile under VS2013 2017-03-20 15:11:27 -04:00
Jeffrey Walton f502ee9218
Simplify C++ dynamic object initialization
Wrap DetectArmFeatures and DetectX86Features in InitializeCpu class
Use init_priority for InitializeCpu
Remove HAVE_GCC_CONSTRUCTOR1 and HAVE_GCC_CONSTRUCTOR0
Use init_seg(<name>) on Windows and explicitly insert at XCU segment
Simplify logic for HAVE_GAS
Remove special recipies for MACPORTS_GCC_COMPILER
Move C++ static initializers into anonymous namespace when possible
Add default NullNameValuePairs ctor for Clang
2017-03-20 08:51:10 -04:00
Jeffrey Walton 0c6510b0a5
Guard string assignment
Visual Studio 2005 fired an assert on the negative self tests because the SecByteBlock was 0-sized and returned a null pointer.
2017-03-19 22:13:12 -04:00