Commit Graph

52 Commits

Author SHA1 Message Date
Jeffrey Walton
15b14cc618
Remove Simon and Speck ciphers (GH #585)
We recently learned our Simon and Speck implementation was wrong. The removal will stop harm until we can loop back and fix the issue.
The issue is, the paper, the test vectors and the ref-impl do not align. Each produces slightly different result. We followed the test vectors but they turned out to be wrong for the ciphers.
We have one kernel test vector but we don't have a working implementation to observe it to fix our implementation. Ugh...
2018-02-14 04:06:16 -05:00
Jeffrey Walton
8ffd165c7a
Rename nacl.h to naclite.h
This should avoid confusion with header files from the reference implementation and libsodium
2018-01-21 17:04:15 -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
8a5911e6eb
Refactor <cipher>_AdvancedProcessBlocks_<arch> into adv-simd.h
This also fixes the SPECK64 bug where CTR mode self tests fail. It was an odd failure because it only affected 64-bit SPECK. SIMON was fine and it used nearly the same code. We tracked it down through trial and error to the table based rotates.
2017-12-09 21:04:25 -05:00
Jeffrey Walton
07c2047cec
Add simon-simd.cpp to file list and nmake file 2017-11-27 01:20:15 -05:00
Jeffrey Walton
568e608ea6
Add NEON and ASIMD intrinsics for SPECK-128 (GH #539)
Performance increased by about 200% on a 980 MHz BananaPi dev-board. Throughput went from about 176.6 cpb to about 60.3 cpb.
2017-11-27 00:36:45 -05:00
Jeffrey Walton
5267723a49
Add SM3 hash function (GH #541) 2017-11-23 23:19:09 -05:00
Jeffrey Walton
2c8a618a03
Add SM4 block ciphers (GH #540) 2017-11-23 11:41:40 -05:00
Jeffrey Walton
f2bc3cd0ca
Add speck-simd.cpp to project files (GH #538, #539)
Cleaned up whitespace
2017-11-22 08:45:38 -05:00
Jeffrey Walton
3970a066e3
Add SIMON-64 and SIMON-128 lightweight block ciphers (GH #539) 2017-11-21 04:58:51 -05:00
Jeffrey Walton
b9fc470bc7
Add SPECK-64 and SPECK-128 lightweight block ciphers (GH #538) 2017-11-20 06:30:21 -05:00
Jeffrey Walton
bd41c3d5dd
Remove SSE2 from cpu.cpp, add sse-simd.cpp
We need to ensure SSE2 does not cross pollinate into other CPU functions since SSE2 is greater than the minimum arch. The minimum arch is i586/i686, and both lack SSE2 instructions
2017-11-16 15:11:51 -05:00
Jeffrey Walton
7fb5953055
Add VIA Padlock RNG 2017-08-19 15:41:45 -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
8f4b0dc081
Suppress C4251 and C4275 warnings in project files (Issue 412) 2017-08-16 11:24:48 -04:00
Jeffrey Walton
9a3f45cee6
Update VCXPROJ files for AppVeyor testing 2017-08-04 00:10:11 -04:00
Jeffrey Walton
64c098fbae Revert "Reinstate commit ac513c06f8c80"
This broke MSbuild, which can no longer build a static library. Attempting to build with 'msbuild /t:Build cryptlib.vcxproj' results in:

  ...
  X64\cryptlib\Debug\zinflate.obj
  X64\cryptlib\Debug\zlib.obj
  LINK : fatal error LNK1561: entry point must be defined [c:\Users\cryptopp\cryptlib.vcxproj]
  Done Building Project "c:\Users\Jeff\Desktop\cryptopp\cryptlib.vcxproj" (Build target(s)) -- FAILED.

Microsoft tools are so fucked up. It should be illegal to sell them.
2017-08-03 05:22:03 -04:00
Jeffrey Walton
1702c93b30
Reinstate commit ac513c06f8c80
Even though it breaks AppVeyor worse, its needed that way. Also see https://stackoverflow.com/a/45458443/608639.
2017-08-03 04:34:56 -04:00
Jeffrey Walton
fe9eb75dd2
Suppress warnings C4231, C4355 and C4505 (Issue 412)
This should not cross-pollinate like when they were present in config.h
2017-08-02 23:25:54 -04:00
Marcel Raad
3485d2180d Fix Visual Studio project file issues (#446)
- don't enable SSE2 explicitly for x64, it's always enabled and causes
  warnings (issue #445)
- remove newlines in project files that Visual Studio doesn't like and
  removes on every change to project options
2017-07-19 07:17:55 -04:00
Jeffrey Walton
32ab4af5ff
Add Threefish to project files
Whitespace check-in
2017-05-14 15:27:50 -04:00
Jeffrey Walton
20c3d556c3 Revert "XOR block in specialized ProcessBlock"
This reverts commit 76bb4ead40. The Visual Studio project files and other test files were not supposed to be checked-in.
2017-05-10 06:30:08 -04:00
Jeffrey Walton
76bb4ead40
XOR block in specialized ProcessBlock
Use Put and Get blocks consistently
2017-05-10 06:26:29 -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
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
5c932fcc3b
Add NIST SP800-90A Hash_DRBG generator 2016-12-30 21:46:03 -05:00
Jeffrey Walton
9739ba8afe
Add Aumasson and Bernstein's SipHash (Issue 348) 2016-12-17 03:58:36 -05:00
Jeffrey Walton
484da03c7b
Add Poly1305 class to project files (Issue 338) 2016-11-27 16:56:57 -05:00
Jeffrey Walton
7363c49a67
Add ecpoint.h header file. Add EncodedPoint interface. Add documntation 2016-11-04 11:13:07 -04:00
Jeffrey Walton
dc035c6bc0
Add Output for clean rule 2016-10-15 21:09:26 -04:00
Jeffrey Walton
5edee711f4
Whitespace cleanup 2016-10-09 02:13:10 -04:00
Jeffrey Walton
ce8d6b8d99
Reorder objects for ARM-based MSBuilds (Issue 316) 2016-10-06 17:13:29 -04:00
Jeffrey Walton
b62637d08e
Fix x64masm.asm and x64dll.asm ASM with ARM-based MSBuilds (Issue 316) 2016-10-06 16:59:50 -04:00
Jeffrey Walton
c400c7b38d
Fix rdrand ASM with ARM-based MSBuilds (Issue 316) 2016-10-06 16:00:28 -04:00
Jeffrey Walton
21fcc7b995
Disable ErrorReporting for cryptlib 2016-10-05 15:37:10 -04:00
Jeffrey Walton
cff762518f
Add ImageHasSafeExceptionHandlers option for X86 2016-10-05 15:27:44 -04:00
Jeffrey Walton
601da2611c
Consistnt use of Optimization, OptimizeReferences and EnableCOMDATFolding 2016-10-05 12:36:20 -04:00
Jeffrey Walton
d58df54b54
Cleanup CRYPTLIB project file 2016-10-05 11:00:39 -04:00
Jeffrey Walton
f579c1caf1
Add missing PlatformToolset and RootNamespace for Globals PropertyGroup
Also see http://blogs.msdn.microsoft.com/visualstudio/2010/05/14/a-guide-to-vcxproj-and-props-file-structure/
2016-10-04 02:22:25 -04:00
Jeffrey Walton
969536ac2b
Add NDEBUG for release builds
The remediations for CVE-2016-7420 removed the library's reliance on NDEBUG. The library now uses CRYPTOPP_ASSERT() instead of assert(), and it requires positive confirmation with CRYPTOPP_DEBUG, DEBUG or _DEBUG.
Some other projects may inadvertenly depend on our definition of NDEBUG. This restores the definition in case its needed by others
2016-10-03 18:27:52 -04:00
Jeffrey Walton
3904be4676 Revert "Add NDEBUG for Release builds. Set /arch:SSE2 as minimum arch"
This reverts commit 640f0272a0.
2016-10-03 03:17:00 -04:00
Jeffrey Walton
640f0272a0
Add NDEBUG for Release builds. Set /arch:SSE2 as minimum arch
Fold source files configuration settings for CRYPTDLL project
2016-10-03 02:27:32 -04:00
Jeffrey Walton
652c154759
Change UUIDs for VS solution and projects 2016-10-02 20:32:47 -04:00
Jeffrey Walton
5e3d0097fa
Visual Studio 2010 project files cleanup (Issue 314) 2016-10-02 14:39:58 -04:00
Jeffrey Walton
478d573416 Whitespace checkin 2016-09-19 19:07:27 -04:00
Marcel Raad
54fa27ae79 cryptlib.vcxproj: remove empty PreprocessorDefinitions properties
They have no effect.
2016-09-19 18:36:21 +02:00
Marcel Raad
567e17587c cryptlib.vcxproj: remove per-file optimization properties
They have no effect and make it hard to manually change the
optimization level as it has to be done for every single file.
2016-09-19 18:07:55 +02:00
Marcel Raad
782ed4e5e0 Whitespace fixes in VC10 project files
Visual Studio doesn't like tabs and newlines in project files and
always removes them when saving the project.
2016-09-19 18:02:32 +02: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
4414b864cf Make VS2010 default. Archive VS2005 project files. Archive Borland project files
VS2005 project files are available in vs2005.zip
Borland 10 project files are available in bds10.zip
2016-09-10 04:32:04 -04:00