Commit Graph

3437 Commits (e3d79bf98c3d068c4be602c544a0b2dec207d5a1)

Author SHA1 Message Date
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 4e86f42d78
Fix Andoid ARMv8 builds
This toolchain is pretty lame. It does not make CRC or Crypto intrinsics available
2018-01-17 20:34:11 -05:00
Jeffrey Walton 9683b8068e
Clear unknown pragma warning under GCC 2018-01-17 18:58:29 -05:00
Jeffrey Walton c8389f89ea
Fix some variables for Ubuntu 16 (GH #565) 2018-01-16 18:40:15 -05:00
Jeffrey Walton cef4fa6683
Remove unused "USING_NAMESPACE(std)" 2018-01-14 21:38:39 -05:00
Jeffrey Walton 166d3f4363
Add C++20 elevated warnings test 2018-01-14 03:34:25 -05:00
Jeffrey Walton 23f3328948
Add additional Encoder and Decoder alphabet test (GH #562) 2018-01-13 09:01:18 -05:00
Jeffrey Walton aa7f6c47d1
Update documentation 2018-01-13 07:14:21 -05:00
Jeffrey Walton 73b08a82f2
Fix lookup array size in self test 2018-01-12 19:37:05 -05:00
Jeffrey Walton 29a15f6342
Add additional Encoder and Decoder alphabet test (GH #562) 2018-01-12 19:20:32 -05:00
Jeffrey Walton 746fd6a648
add self test for custom Encoder and Decoder alphabet (GH #562) 2018-01-12 18:59:48 -05:00
Jeffrey Walton a9d6604ee9
Update documentation 2018-01-12 09:04:12 -05:00
Jeffrey Walton 751252b2d9
Update documentation 2018-01-12 08:54:07 -05:00
Kirit Sælensminde 59b94d2bbf C++17 compatible lambda expressions to replace `bind2nd` (#559)
* Conditionally use a lambda rather than the older `bind2nd` style.

* Duplicate the if statements.

* Centralise the conditional compilation to an implementation of find_if_not.

* Refactoring of name and code placement after review.

* Use `FindIfNot` where appropriate.

* Remove whitespace.
2018-01-12 08:38:56 -05:00
Jeffrey Walton c6289edd44
Try to fix MSVC C4589 warning again (GH #214)
This one is a chronic problem. It appears Microsoft needs to fix it in their compiler
2018-01-12 08:24:42 -05:00
Jeffrey Walton 788cd1794d
Use x86 highest basic before calling a leaf function
This was a latent bug that just surfaced on a Sun Core2 workstation. RDSEED caused an illegal instruction exception on the Core2. It seems we managed to miss it because old processors had family and stepping values so low they never set CPUID.EBX.RDSEED[bit 18] = 1. Newer processors had the feature so CPUID.EBX.RDSEED[bit 18] = 1 was accurate.
2018-01-11 17:59:24 -05:00
Jeffrey Walton 591d70f1c7
Update documentation 2018-01-11 14:20:59 -05:00
Jeffrey Walton 8cc24aa9c0
Update head notes in ppc-simd.cpp 2018-01-11 13:20:29 -05:00
Jeffrey Walton a49ff560e7 Update head notes 2018-01-11 13:16:13 -05:00
Jeffrey Walton 691e7af29a
Fix defines for PPC feature probes
Thanks to Bob Wilkinson for reporting at https://groups.google.com/d/msg/cryptopp-users/gPJOMOUMLhU/xHTxD8P-AgAJ
2018-01-11 13:04:59 -05:00
Jeffrey Walton 226516f590
Update documentation 2018-01-11 12:26:32 -05:00
Jeffrey Walton 6f9f9e5177
Update documentation 2018-01-11 11:27:11 -05:00
Jeffrey Walton 29029c6a33
Update documentation 2018-01-11 11:21:49 -05:00
Jeffrey Walton 7a080c32c8
Fix C++03 compile
Whitespace check-in
2018-01-10 20:49:07 -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 2c295b2454
Add topic on Side Channel leakage 2018-01-08 09:13:15 -05:00
Jeffrey Walton 5ae79afd89
Add CRYPTOPP_CXX11_LAMBDA for N2927 (v1.1) (GH #558) 2018-01-07 21:35:12 -05:00
Jeffrey Walton 0e32a7f1e6
Fix "Internal compiler error: max number of generated reload insns ..." (GH #554) 2018-01-07 10:53:15 -05:00
Jeffrey Walton 3360e97ad9
Add C++20 testing to cryptest.sh
This is initial testing support for N4713, "Working Draft, Standard for Programming Language C++". We know GCC uses -std=c++20 and -std=gnu++20, so we can start testing things
2018-01-06 05:00:24 -05:00
Jeffrey Walton 4f2c605209
Add Power4 unaligned Load and Store 2018-01-05 21:27:27 -05:00
Jeffrey Walton bfc2b5f02d
Fix double leading "0x" prefix (GH #557)
Thanks to John McCabe for reporting
2018-01-05 18:59:28 -05:00
Jeffrey Walton 9624f928f8
Fix missing SM2 methods in Windows DLL
This was not ready to be checked in. I think it cross-pollinated duing a checkin for documentation
2018-01-05 18:47:28 -05:00
Jeffrey Walton 9c80a706c8
Fix "impossible register constraint in ASM" (GH #554)
Thanks to Eduardo Miravalls for reporting the issue
2018-01-02 10:51:16 -05:00
Jeffrey Walton eaa8185e61
Clear GCC -Wreorder warnings 2018-01-02 10:34:06 -05:00
Jeffrey Walton d6d53f2e9d
Add Power4 Vector Load, Store, Add and Xor 2018-01-02 08:13:42 -05:00
Jeffrey Walton fac3a44a84
Move Altivec AdvancedProcessBlocks into adv-simd.h 2018-01-02 07:08:13 -05:00
Jeffrey Walton fb0ecfde62
Clear clang-tidy warnings
This commit also tweaks the way Integer parses byte arrays. The modified routines are slightly faster. On a Core-i5 6400 the self tests are 0.1 to 0.2 seconds faster
2018-01-02 04:17:22 -05:00
Jeffrey Walton 1a7f19cdde
Use 'command -v' to test for ld.gold 2018-01-02 01:13:59 -05:00
Jeffrey Walton 58726498f1
Clear clang-tidy warnings 2018-01-02 00:15:34 -05:00
Jeffrey Walton 5f083d652e
Clear signed/unsigned warnings 2017-12-31 03:54:33 -05:00
Jeffrey Walton ba98c2bfb9
Clear signed/unsigned warning in Debug 2017-12-31 02:24:16 -05:00
Jeffrey Walton 651563e6c2
Temporary fix for IBM XLC failed SM3 self tests (GH #553) 2017-12-30 22:18:08 -05:00
Jeffrey Walton 8b7f21b07d
Update makefiles to use one call to $(CXX) -dumpmachine 2017-12-30 18:38:40 -05:00
Jeffrey Walton f3618f4b7f
Fix IBM xlC compile 2017-12-30 18:37:56 -05:00
Tanzinul Islam b4df31c7f9 Change ::log() to log() to work with C++Builder (#552)
As reported in #520, C++Builder standard libraries don't have a `log()` function at global namespace. Change the invocations to unqualified name lookup, and apply a using-declaration to `std::log()` when compiling under C++Builder.
2017-12-30 15:16:27 -05:00
Jeffrey Walton 1699562581 Remove commented code 2017-12-28 19:25:45 -05:00
Jeffrey Walton cd35346f70
Fix Solaris failed compile due to SHA with GCC (GH #551) 2017-12-28 19:14:20 -05:00
Jeffrey Walton 3c6eb74cd7
Clear Coverity issue CID 186341 2017-12-28 01:29:31 -05:00
Jeffrey Walton 7b14ead0f3
Fix unaligned load for _mm_loaddup_pd with GCC and UBsan
This function was missed earlier. Unfortunately, it does not squash all of the unaligned load findings. I'm pretty sure it is a GCC problem
2017-12-28 01:16:17 -05:00
Jeffrey Walton 24883ca79f
Clear Coverity issue CID 186337 2017-12-27 00:43:00 -05:00