macaba

Results 18 comments of macaba

I meant to say ChaCha20 rather than ChaCha20-Poly1305, so that might have confused the issue. See here for an implementation that has an optimized path for >512 bytes: https://github.com/jedisct1/libsodium/blob/dcc2e06c93067f421ab549550b89fec45993b7a7/src/libsodium/crypto_stream/chacha20/dolbeau/u8.h#L129 I...

Pain points: The CommonParallel.For and Storage APIs are not Span compatible, hence the fallback to Memory and .ToArray(). Hopefully someone more familiar with Math.Net can weigh in here with possible...

Posting comment to keep this current.

That sounds like a good plan, I am interested.

A little update. Before going too far into this, I wanted to find out if intrinsics will give any worthwhile improvement, so I picked ChaCha20 to fully convert to intrinsics....

![image](https://user-images.githubusercontent.com/1031306/64922245-f5dd6580-d7c4-11e9-8395-8d5d4e129cfe.png) Now down to 2.3us, a ratio of 0.14. The unit tests have been extremely valuable in ironing out implementation bugs. (Particularly the RFC and Wycheproof test vectors) Update: 1.5us.

Thanks for the feedback! I was thinking about what the ultimate goal is - it's to get near libsodium performance which is probably the fastest implemention. So I hacked together...

This micro benchmark run of ChaCha20 encrypt in NaCl.Core and libsodium is in 3 runtimes: .NET 4.7.2, Core 2.2, and Core 3.0. Core 3.0 has intrinsics enabled, the other 2...

Here is my suggested workaround for the performance issue that kaczart (and I) noticed: https://github.com/macaba/HidLibrary/commit/8f1864e1351ccca4772d5bbc18a0f94d7ba07fe7 Usage is along the lines of: ``` device.ConnectionCheckOverride = device.IsConnected; methodRequiringFasterUSBReadWrite(); device.ConnectionCheckOverride = false; ```...

Please see my solution too: https://github.com/mikeobrien/HidLibrary/issues/11#issuecomment-170944469