Closed FirelightFlagboy closed 1 year ago
A TryFrom<&[u8]>
bound is required by the SignatureEncoding
trait.
It doesn't mandate an error type though, so Infallible
and with it the blanket impl of TryFrom
for types which impl From
should be allowed, so it could potentially be replaced with From<&[u8]>
.
However, it would probably make sense to set an upper bound on the size of a PSS signature (e.g. 2048-bytes) to prevent it from parsing some extremely large value as a BigUint
.
Thank you for the clarification, I'll close this issue since my question was answered :smile:
Hello,
I have a question concerning the implementation of
pss::Signature
when we try to build a new signature from raw bytes.Signature
implementTryFrom<&[u8]>
for that, indicating that it may fail but the implementation always returnOk
.Is there a reason for
Signature
to implTryFrom<&[u8]>
and notFrom<&[u8]>
?https://github.com/RustCrypto/RSA/blob/40069a5408dc9eb531d68a50b3ada5c9ab47466d/src/pss/signature.rs#L35-L44