salsa20: support insecure 16-byte keys #433
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #432.
This adds a
KeySize
parameter toSalsaCore
(like RC4), and sets it toU32
by default, for compatibility with existing code.I had a look at implementing 10 byte keys, but couldn't find test vectors for it, so I've left it out.
I haven't added support for
XSalsa
with other key sizes; that would need a similar change.I tested this with
aarch64-apple-darwin
andx86_64-apple-darwin
(via Rosetta 2, which seems to support SSE2).ECRYPT test vectors were acquired via https://github.com/oxarbitrage/salsa20-ecrypt-vectors-converter, with a little
jq
to convert their JSON files intoblobby
's text format: