zig/std/crypto
Marc Tiehuis 87eb95f816 speed up chacha20
The main changes are:

    Unrolling the inner rounds of salsa20_wordtobyte which doubles the speed.
    Passing the slice explicitly instead of returning the array saves a copy (can optimize out in future with copy elision) and gives ~10% improvement.
    Inlining the outer loop gives ~15-20% improvement but it costs an extra 4Kb of code space. I think the tradeoff is worthwhile here.
    The other inline loops are small and can be done by the compiler if it is worthwhile.
    The rotate function replacement doesn't alter the performance from the former.

The modified throughput test I've used to benchmark is as follows. Interestingly we need to allocate memory instead of using a fixed buffer else Zig optimizes the whole thing out.

https://github.com/ziglang/zig/pull/1369#issuecomment-416456628
2018-08-27 22:55:53 -07:00
..
blake2.zig remove integer and float casting syntax 2018-06-17 02:57:07 -04:00
chacha20.zig speed up chacha20 2018-08-27 22:55:53 -07:00
hmac.zig partial conversion to post-fix pointer deref using zig fmt 2018-05-10 00:29:49 -04:00
index.zig std.crypto: add chaCha20 2018-08-27 19:44:11 -07:00
md5.zig remove integer and float casting syntax 2018-06-17 02:57:07 -04:00
sha1.zig all integer sizes are available as primitives 2018-07-16 10:53:15 -04:00
sha2.zig remove integer and float casting syntax 2018-06-17 02:57:07 -04:00
sha3.zig use * for pointer type instead of & 2018-05-31 17:28:07 -04:00
test.zig run zig fmt on the codebase 2018-05-30 16:09:11 -04:00
throughput_test.zig Update throughput_test.zig. (#1211) 2018-07-09 17:21:20 -04:00