You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Confusion over pkcs1v15::VerifyingKey::new vs ::new_with_prefix #238
In #234 we had some people confused about signature verification failing with ::new, and they had trouble discovering ::new_with_prefix.
It would be good to either improve the documentation here, or eliminate the distinction between ::new and ::new_with_prefix and automatically determining if the prefix is needed (e.g. based on the OID of the provided digest).
It seems like other RSA libraries are able to make this determination automatically.
new_prefix(p: Prefix) explicitly expects a prefix or not. With enum Prefix { Yes, No } (names can be bikeshedded) for when you want to enforce one or the other.
I think part of the rationale for the current split is avoiding the need to have an AssociatedOid on the digest used. However, that just seems to be causing confusion.
Looking at RFC8017 Appendix 2.4, I'm unclear under what circumstances the OID can actually be omitted?
So perhaps the current new should be renamed to something like new_unprefixed, and new_with_prefixed should be renamed to new?
Activity
dignifiedquire commentedon Jan 6, 2023
I think it would be great if we had
new()-> determines it automaticallynew_prefix(p: Prefix)explicitly expects a prefix or not. Withenum Prefix { Yes, No }(names can be bikeshedded) for when you want to enforce one or the other.tarcieri commentedon Jan 6, 2023
I think part of the rationale for the current split is avoiding the need to have an
AssociatedOidon the digest used. However, that just seems to be causing confusion.Looking at RFC8017 Appendix 2.4, I'm unclear under what circumstances the OID can actually be omitted?
So perhaps the current
newshould be renamed to something likenew_unprefixed, andnew_with_prefixedshould be renamed tonew?Add `sha2` feature with `oid` subfeature enabled
Add `sha2` feature with `oid` subfeature enabled (#255)
pkcs1v15: make `*_with_prefix` methods the default
pkcs1v15: make `*_with_prefix` methods the default (#290)
Add `sha2` feature with `oid` subfeature enabled (RustCrypto#255)
pkcs1v15: make `*_with_prefix` methods the default (RustCrypto#290)