Commit Graph

19 Commits

Author SHA1 Message Date
Jeffrey Walton
f5f63850f9
Use std namespace for memset, memcpy, memcmp (#1204) 2023-04-15 16:45:02 -04:00
Jeffrey Walton
d86f5ad449
Use ConstBytePtr and BytePtrSize in test 2020-04-13 00:38:09 -04: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
6bead34bd9
Update headers for 'make dep' 2019-07-05 02:42:27 -04: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
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
28fe1a6a4d
Split validat*.cpp source files
Also see https://groups.google.com/forum/#\!topic/cryptopp-users/j_aQj6r-PoI
2018-07-28 14:57:12 -04:00
Jeffrey Walton
365e65c2eb
Whitespace check-in 2018-07-20 13:38:55 -04:00
Jeffrey Walton
d8946df8eb
Add crypto_sign_sk2pk (PR #668)
This should allow users to convert a ed25519 seret key to a public key without rolling their own code
2018-07-17 08:28:33 -04:00
Jeffrey Walton
3958fad099
Add sbyte, sword16, sword32 and sword64 (GH #608, GH #609)
Visual Studio 2008 kind of forced out hand with this. VS2008 lacks <stdint.h> and <cstdint> and it caused compile problems in NaCl gear. We were being a tad bit lazy by relying on int8_t, int32_t and int64_t, but the compiler errors made us act
2018-03-27 20:47:20 -04: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
1df1d25428
Cleanup warnings under MSC 2018-01-21 16:25:49 -05:00
Jeffrey Walton
58b6999274
Convert Kalyna from variable block size (GH #535) 2018-01-18 20:26:10 -05:00
Jeffrey Walton
0bb73e7035
Add _unchecked versions of crypto_box, crypto_box_open and crypto_box_beforenm
This check-in adds three additional functions for backwards compatibility: crypto_box_unchecked, crypto_box_open_unchecked and crypto_box_beforenm_unchecked. The functions can be used for interoperability with downlevel clients, like old versions of NaCl and libsodium. It should also help some cryptocurrencies, like Bitcoin, Ethereum, Monero and Zcash.

Also see https://eprint.iacr.org/2017/806.pdf (low order element attack) and https://github.com/jedisct1/libsodium/issues/662 (Zcash break).
2018-01-18 12:43:57 -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