briansmith / ring

Safe, fast, small crypto using Rust
Other
3.69k stars 697 forks source link

Improve the type of signature padding types. #1887

Open briansmith opened 8 months ago

briansmith commented 8 months ago

The signature padding constants are of type PSS (for 'RSA_PSS_SHA256', 'RSA_PSS_SHA384', and 'RSA_PSS_SHA512') and PKCS1 (for RSA_PKCS1_SHA256, RSA_PKCS1_SHA384, and RSA_PKCS1_SHA512). But, PSS and PKCS1 are not actually exported.

This makes it difficult to discover how to use the API because these values are used with functions that take &dyn Padding values but there's nothing in the rustdoc that indicates that PSS and PKCS1 implement Padding.

Perhaps instead these values should have type &'static dyn Padding.

I think this would be a SemVer-breaking change.