RustCrypto / stream-ciphers

Collection of stream cipher algorithms
255 stars 49 forks source link

Re-add SSE2 with soft fallback for non salsa20/20 variants #348

Closed oxarbitrage closed 4 months ago

oxarbitrage commented 6 months ago

Here i re-added the SSE2 with the caveat of variants.

oxarbitrage commented 5 months ago

@baloo i think your comments were good and i wanted to give it a try however i was not able to find the time yet, iirc i tried that before i was not able to make the whole thing work so i ended up with the current layout. i might want to give it a new look. can you readd the comments ?

baloo commented 5 months ago

@oxarbitrage I deleted my comments because they were incorrect. Situation is more complex than I initially thought.

oxarbitrage commented 5 months ago

@oxarbitrage I deleted my comments because they were incorrect. Situation is more complex than I initially thought.

That makes sense, as i think i already tried what was in those comments without being able to make it work. Thanks.

baloo commented 5 months ago

https://github.com/objectx/salsa20/blob/20d595b37597320a73acf87b3d3cc3ad3c9b66e6/src/salsa20.cxx#L182-L185 This is another implementation of salsa20 with sse2.

I like a lot the visual representation of the matrices in this one.

I still think it should be possible to reproduce the quarter round in the soft backend. I might try that at some point when I have more time.