-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more test vectors to salsa20 ? #330
Comments
Sure, that'd be appreciated |
I was doing some research here and i ended up creating a little script to convert the data to JSON which i think it might be more useful in general than the old format used in the eSTREAM project: https://github.com/oxarbitrage/salsa20-ecrypt-vectors-converter So the files i was planning to use here are https://github.com/oxarbitrage/salsa20-ecrypt-vectors-converter/blob/main/test_vectors_128.json and https://github.com/oxarbitrage/salsa20-ecrypt-vectors-converter/blob/main/test_vectors_256.json In order to use that i will have to add a few dev dependencies in https://github.com/RustCrypto/stream-ciphers/blob/master/salsa20/Cargo.toml#L18 The dependencies i will need are There might be other reasons for not adding more dev dependencies i am not seeing so i preferred to ask first if that will be ok or not. I can think on other alternatives if this is a problem. Thanks! |
We have a standard format for test vectors implemented by the |
I can do conversion into the blobby format. If we want to use the standard test macros from the I am not sure how the |
The only thing i was able to find for the Unsure if we will want to test it. |
I was thinking on testing all the stream outputs similar to how it is done in https://github.com/RustCrypto/stream-ciphers/blob/master/salsa20/tests/mod.rs#L92-L99 but i will be happy to try whatever you guys think it will be the best. |
I this this research in a separated branch, i wanted to figure out if this implementation pass the ecrypt tests and it does: oxarbitrage#1 But i was able to test only the 256 bit key sizes as the 128 ones are not supported. |
Yeah, we don't currently support 128-bit Salsa20 or have plans to work on it. I'd consider it esoteric and not used in practice. |
The salsa20 implementation has a few test vectors here, some of them seems to be from here.
I was wondering if this implementation should add some more test vectors in order to lock the functionality against future changes and have more coverage.
I am pretty sure this implementation will pass all these test vectors but will be nice to confirm it:
These are the only test vectors from some sort of reliable source that i was able to find online for salsa20.
This is a lot of vectors, an option will be to just implement some here instead. Another approach taken here is a shell script that generate the tests. The simpler one will be to just add an
ecrypt
module inside thetests
, hardcode the vectors and run them.I could create a PR for this if there is some interest.
The text was updated successfully, but these errors were encountered: