-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
feat(signature-validation): add ed25519 signature validation to twilight-util #2205
feat(signature-validation): add ed25519 signature validation to twilight-util #2205
Conversation
It would be nice if we could use a digest API for the signature so we don't have to allocate a vec for it. A quick look makes it seem like it is currently not possible but it may be possible in version 2 of ed2519-dalek. Though it may need a pr such as the below one. |
I agree, it'd be really nice to have that. So, I'm following up over there to see if we can get what we need for that added. |
Okay, I've been a little busy for a bit, but I'm going to have a solid few days soon I can dedicate to this. While it would be nice to have that feature on So with that in mind, my goal is going to be getting this in a working state and ready to merge here, and later on pushing the stuff over at |
Well, I never did get that time I was expecting to for this, but it turns out the remaining work is small. I've added |
Side note: For avoiding the extra allocation, it seems we are waiting on one of these two PRs to be merged over at curve25519-dalek: |
Should we get it merged and then have a issue tracking the version with less allocations in a issue? |
Yeah, that'd be for the best. I'm going to do some housecleaning on this PR today, and then it should be ready for final review and merge.
|
e7286b8
to
4f765c2
Compare
It's essentially done at this point, but I'd like to suggest doing additional feature gates to support someone using only |
44d726f
to
ff22ff0
Compare
620cbfd
to
d3f3f85
Compare
Rebased to fix conflict with updates to the main branch (in particular, in the examples directory) that appeared after I made this PR. |
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.
I think it looks good, only a few small nits that I would like to have changed.
Added the last doc comment required by your Clippy configuration. But I have no idea what's making these tests fail. |
They fail because of the issue solved here: #2326 so you can just look away from those. |
7c29025
to
4dccad7
Compare
|
||
/// Extracting the body of an Interaction failed. | ||
#[cfg(feature = "signature-validation-extract-interaction")] | ||
pub enum ExtractFailure { |
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.
Shouldn't this have Debug derived on it? All the other error structs do. Ditto Display and Error.
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.
There's a few formatting and documentation issues too that I've not commented on that I'll cover in the next round of reviews. Sorry for letting this linger.
...Next round of reviews? I'd rather be able to churn through all your change requests in one session. Mind if I just wait until you're done? |
The next round will just be documentation and formatting pointers (see CONTRIBUTING.md), if we stick with my changes. Formatting doesn't matter that much until the API is finalized. |
I should state this publicly. I am no longer going to be working on this PR. The maintainers are invited to edit and bikeshed it to completion. This PR has the "Allow edits by maintainers" option checked. If no one does anything, I'm going to change gears and build a separate crate. |
e51e9bf
to
094684e
Compare
I don't think this PR offers any measurable advantage for users over just using dalek directly, it rather only adds new code that needs maintaining. As it is, I'm against merging this PR. The only way in which I can see this being useful is if we were to add APIs for a webserver that accepts interactions, but I think that is out of the scope of twilight. |
Alright then. |
Implementing #2169. This PR is not complete, but I felt like making what I wrote just now public quickly so people know progress exists.