Commit Graph

33 Commits (a9be7ced8682c5628e26aea0d157147ea19e0f7f)

Author SHA1 Message Date
Jeffrey Walton e499131ea6
Latch previous ROUNDS in Salsa and ChaCha ciphers (GH #800, PR #804) 2019-02-12 16:56:01 -05:00
Jeffrey Walton 26c83877ef
Add IETF XChaCha (GH #727, PR #794) 2019-02-06 01:03:28 -05:00
Jeffrey Walton 3f37cfc3a3
Update documentation 2019-01-27 11:54:35 -05:00
Jeffrey Walton b9d2310beb
Use ROUNDS constant for ChaChaTLS 2019-01-25 23:27:48 -05:00
Jeffrey Walton 76bdb328a6
Switch to RFC 8439 for ChaChaTLS
Unfortunately the block counter wrap problem is still present.
2019-01-25 21:51:43 -05:00
Jeffrey Walton 6a68abea0a
Update comments 2019-01-25 08:14:23 -05:00
Jeffrey Walton 70dcd29e0b
Refactor ChaCha and ChaChaTLS use a common core 2019-01-25 06:18:58 -05:00
Jeffrey Walton d25ba0c59a
Enable SIMD implementation for ChaChaTLS (GH #265) 2019-01-25 02:57:11 -05: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 3be1ae60f8
Clear warning on unitialized rounds 2018-11-19 23:41:34 -05:00
Jeffrey Walton d9011f07d2
Add ChaCha AVX2 implementation (GH #735) 2018-11-08 16:20:31 -05:00
Jeffrey Walton 29be6ed97a
Work-around potential counter increment problem in ChaCha20 (GH #732)
This is only a work-around for the moment. The issue only affects SIMD code. The problem is, the algorithm we use performs a 32-bit add as an intermediate result, but we really need a 64-bit add. We are running 4 transforms in parallel, and we can't add and carry the way we need to.

The workaround is, whenever we could cross the 32-bit counter boundary we use the C version of the transform. We determine the cross-over point by 'bool safe = 0xffffffff - state.low > 4'. When not safe we skip the SIMD version of the algorithm and use the C version. Once we are safe again we use the SIMD version again.

The work-around costs us about 0.1 to 0.2 cpb. At 1.10 or 1.15 cpb that equates to about 200 MB/s on a Skylake. We'd like to get it back eventually.
2018-11-04 14:49:26 -05:00
Jeffrey Walton 8da2b91cba
Add ChaCha AlgorithmName override 2018-10-26 03:13:06 -04:00
Jeffrey Walton b4b3623938
Whitespace check-in 2018-10-25 12:15:33 -04:00
Jeffrey Walton d230999b40
Fix ChaCha compile on ARM and MIPS 2018-10-24 01:11:45 -04:00
Jeffrey Walton 916c4484a2
Add ChaCha SSE2 implementation
Thanks to Jack Lloyd and Botan for allowing us to use the implementation.
The numbers for SSE2 are very good. When compared with Salsa20 ASM the results are:
  * Salsa20 2.55 cpb; ChaCha/20 2.90 cpb
  * Salsa20/12 1.61 cpb; ChaCha/12 1.90 cpb
  * Salsa20/8 1.34 cpb; ChaCha/8 1.5 cpb
2018-10-23 07:57:59 -04:00
Jeffrey Walton e2be0cdecc
Make ChaCha an Salsa use the same design pattern 2018-08-17 06:19:30 -04:00
Jeffrey Walton 2f83777e9b
Backout ChaCha changes to Crypto++ 7.0
These changes made it in by accident at Commit b74a6f4445. We were going to try to let them ride but they broke versioning. They may be added later but we should avoid the change at this time.
2018-07-25 16:25:41 -04:00
Jeffrey Walton b74a6f4445
Add algorithm provider member function to Algorithm class 2018-07-06 09:23:37 -04:00
Jeffrey Walton befd04312d
Remove unneeded Doxygen directive 2018-01-19 14:31:20 -05:00
Jeffrey Walton 61ec50dabe
Change Doxygen comment style from //! to ///
Also see https://groups.google.com/forum/#!topic/cryptopp-users/A7-Xt5Knlzw
2017-11-29 10:54:33 -05:00
Jeffrey Walton 8c20630c2d
Remove extra preamble for copyright.
Similar text may be added in the future
2017-02-21 02:54:09 -05:00
Ralph Tandetzky 35a2ef10a2 Fix: GCC warning "type qualifiers ignored on function return type".
This pedantic message appeared all over the code. Also removed one warning about an unused variable in release build.
2016-12-01 15:37:04 +01:00
Jeffrey Walton 76b11b010c
Add CRYPTOPP_STATIC_CONSTEXPR macro 2016-11-13 11:50:34 -05:00
Jeffrey Walton 947b411f9d Updated documentation 2016-09-12 18:38:03 -04:00
Jeffrey Walton 36d769e907 Updated documentation 2016-09-09 05:19:29 -04:00
DevJPM f83cc3a19c shortened ChaCha typedefs
shortened ChaCha typedefs
2016-09-08 13:28:23 +02:00
Jeffrey Walton e2f2ace688 Add constexpr-ness to ChaCha StaticAlgorithmName member function 2016-09-07 06:39:52 -04:00
Jeffrey Walton 7378a1b86d Cleared analysis warning on use of boolean in arithmetic expression 2016-07-23 19:37:17 -04:00
Jeffrey Walton 5849050e14 Cleared warning 'extra ";" ignored' 2016-06-08 16:13:48 -04:00
Jeffrey Walton f4877218fa Updated documentation 2016-04-24 22:20:25 -04:00
Jeffrey Walton 38f6c33789 Update ChaCha to latest sources 2016-04-21 12:12:42 -04:00
Jeffrey Walton d4d418503f Add ChaCha family of stream ciphers 2016-04-21 12:08:21 -04:00