-
Notifications
You must be signed in to change notification settings - Fork 119
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 XChaChaPoly cipher #73
Conversation
Rad! Thanks for taking this on. I'd love to get this merged in. Because XChaChaPoly isn't in the official Noise specification, I'm thinking this should be behind a feature gate. Thoughts? |
This makes sense, I added a feature gate. |
I rebased this on master and simplified the implementation similar to the ChaChaPoly cipher after the move to the aead crate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, thanks for updating it!
Before merging this, we need to update ci-tests.sh
since xchachapoly
is not a default feature but we want to test it regardless.
When enabling the feature a la:
set -e
TARGET="$([ -n "$1" ] && echo "--target $1" || echo "")"
+COMMON_FEATURES="xchachapoly vector-tests"
set -x
cargo check --benches
cargo test $TARGET --no-default-features
-cargo test $TARGET --features "vector-tests"
-cargo test $TARGET --features "ring-resolver vector-tests"
-cargo test $TARGET --features "ring-accelerated vector-tests"
-cargo test $TARGET --features "hfs pqclean_kyber1024 vector-tests"
-cargo test $TARGET --features "ring-resolver hfs pqclean_kyber1024 vector-tests"
-cargo test $TARGET --features "libsodium-resolver vector-tests"
-cargo test $TARGET --features "libsodium-accelerated vector-tests"
+cargo test $TARGET --features "$COMMON_FEATURES"
+cargo test $TARGET --features "ring-resolver $COMMON_FEATURES"
+cargo test $TARGET --features "ring-accelerated $COMMON_FEATURES"
+cargo test $TARGET --features "hfs pqclean_kyber1024 $COMMON_FEATURES"
+cargo test $TARGET --features "ring-resolver hfs pqclean_kyber1024 $COMMON_FEATURES"
+cargo test $TARGET --features "libsodium-resolver $COMMON_FEATURES"
+cargo test $TARGET --features "libsodium-accelerated $COMMON_FEATURES"
we'll see some tests fail when other resolvers are enabled, so we'll have to fix those before pushing.
Right, I added the feature to CI tests and updated the ring resolver to not crash. |
It's behind a feature gate "xchachapoly" because it is a the moment a quite uncommon cipher for NOISE handshaking (but used in some protocols, e.g. the Hypercore protocol).
Hei, can this be merged now that the CI changes are done? |
Sorry for the delay and thanks for rebasing. Merged :). |
Does this close #71 ? |
Yes, it does! There's been no release though since it has been merged. |
This adds the
XChaChaPoly
cipher to snow. The crypto used is the chacha20poly1305 crate, which also has a dependency on the aead crate. I added a simple test that follows the ChaChaPoly test. Likely more tests are needed.I notices that XChaChaPoly is missing when trying to handshake with a hypercore-protocol stream from nodejs