Uh oh!
There was an error while loading. Please reload this page.
async-signature: remove mandatory Send + Sync bounds - #1375
Conversation
| pub trait AsyncSigner<S> | ||
| where | ||
| Self: Send + Sync, | ||
| S: Send + 'static, |
There was a problem hiding this comment.
Did you mean to remove the 'static bound here?
tarcieri
commented
Nov 12, 2023
Going to go ahead and merge this as we'd like to do some repo reorganization which impacts this crate |
Thanks for merging it, and apologies for not getting back to you on the static bounds yesterday! I did intentionally remove them, but I probably should have split that into a separate commit. I believe that the 'static bounds in the old code were actually superfluous, because all Send types are already 'static, and without the Send bound, requiring 'static would overconstrain the generic: I don't know whether that'd end up being a problem in practice though. |
tarcieri
commented
Nov 12, 2023
Oof, well it's out with the |
QuinnWilton
commented
Nov 12, 2023
No worries at all! I'll verify it still works with my code today or tomorrow, and let you know if the 'static bound gives any issues :) It's just on the type of the signature itself, which is probably fine, since that'll mostly just be first-party types from rust-crypto anyway, which shouldn't really be holding any references to the stack anyway. |
tarcieri
commented
Nov 17, 2023
When Rust 1.75 drops we can transition away from the |
As discussed in #1375. These bounds don't add value: it requires notating them even when unnecessary, and when necessary they still need to be notated anyway.
As discussed in #1375. These bounds don't add value: it requires notating them even when unnecessary, and when necessary they still need to be notated anyway.
See: #1373
I've confirmed that with these changes I'm able to produce signatures from non-extractable keys in a browser, using an implementation of
AsyncSigner<S>that calls out to theSubtleCryptoAPIs.I have not tested the
AsyncDigestSignertraits in a wasm project, however I have confirmed that I'm able to build the project with thedigestfeature enabled.