-
Notifications
You must be signed in to change notification settings - Fork 164
chore(deps): bump signature
to 3.0.0-pre
#505
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
base: master
Are you sure you want to change the base?
Conversation
The upgrade seems to hurt the type inference here:
I'm not sure I understand why quite yet. |
This is just that we now need to carry the Digest as type parameter of the signature, I think I'm fine with such a change. |
eaaea51
to
e81c85a
Compare
e81c85a
to
22a4bd9
Compare
Ugh, that’s really annoying if the blanket impl leads to an inference failure. Regarding carrying the digest, perhaps something like https://docs.rs/ecdsa/latest/ecdsa/struct.SignatureWithOid.html ? |
I opened RustCrypto/traits#1831 to discuss the inference regression. We might want to consider backing out this change. |
I'm not sure I get what you're trying to suggest with I think this overall is a side effect of having to provide the I otherwise think that specifying the digest attached to a signature makes sense (and that we should actually embrace that change, whether or not we fix the inference for it). |
One thing that would be weird about attaching a digest type to the signature type is algorithm information isn't available in the serialized signature, so you'll be able to parse signatures generated by other digest algorithms successfully |
Yeah but that should be inferred from the VerifierDigest call that should ensue (otherwise the digest can be whatever)
|
Wait, we do have the digest in the SigningKey, there should not be an issue with selecting the DigestSigner. I’ll have another look tomorrow. |
#505 (comment) We get away with not having the Digest in |
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub struct Signature { | ||
#[derive(Eq)] | ||
pub struct Signature<D> { |
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.
This still seems a little weird to me because there isn't a strong binding or relationship between the signature as a cryptographic object and the digest algorithm that was used to compute it.
This means that the type does not actually maintain an invariant e.g. "this is a signature that was known to be computed by using digest D over the input message". It could've been computed with any digest algorithm.
I guess there's a type safety argument to it in that the type identifies what digest you're supposed to use, but as cryptographic objects they're not really parameterized/distinguished by the digest, it's just something that happens earlier in the computation of the signature.
No description provided.