-
Notifications
You must be signed in to change notification settings - Fork 1
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
make wasm32
compatible
#2
Conversation
so that multikey can compile to wasm32 target
I also ran into the issue of using This cannot compile to I also switch |
Last blocking issue should be cryptidtech/multisig#1 Once that is merged, that dependency can be updated and this crate will compile to |
sodiumoxide
with chacha20
and poly1305
crateswasm32
compatible
I have excluded default-features on |
When cryptidtech/multisig#1 get merged, I'll update this PR and make it no longer Draft |
Your multisig PR was just landed. Flip this one out of Draft so we can move forward. |
I updated to test I added various target checks in the CI, including All tests passing now, should be good to go! |
Sorry, fighting with Git a bit this morning. Github was showing conflicts, which I tried to resolve and now there's no conflicts showing. Weird. Recommend running the CI again to confirm it's still good to merge and there are no conflicts. |
Somewhere in my merge and revert, the clippy fixes were lost. This commit ensures all the clippy corrections are back. Git!
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.
It looks like there was a merge/clippy --fix error in all of these changes. Duplicated code everywhere. BTW, I like fn from(mk: Multikey)
better than fn from(val: Multikey)
. This may be my fault because I was pushing clippy fixes this week but it's in your PR so you get to fix it 😂
because Dave likes it better
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.
Fix the SshError derivation to use thiserror and a lot of the changes go away because the error elision is possible at compile time. There's also a few changes you made that are incorrect. I think using standard macros like vec! and matches! produces faster code IIRC.
I don't recall the ratioanle for this change, but now it's fixed
@dhuseby I believe I have addressed and changed all your points, can you have another look with the latest commits? |
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.
LGTM
🚀 |
While trying to use
multikey
in WebAssembly code, I realizedsodiumoxide
doesn't compile to that target, and should be upgraded to the RustCrypto crates as it uses the older 8 bytes nonce instead of the latest 12 byte nonce.I took some liberty to make some small clippy clean ups too.
I changed the serde tests, but didn't look too deeply into the details as they seem a bit fragile with the hard-coded checks in there. Recommend those serde tests be made into something a bit more robust eventually, like roundtrip or somehow codify the encoding to automate the checking. Anyway, the tests pass but should be looked at further I think.
In the meanime, this fixes issue #1 and compiles to wasm32 =)