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
Factor out message digest calculation in internal RSA padding interface #348
When reviewing PR #262, I noticed that it almost definitely a good idea to refactor the padding API like so:
/// The term "Encoding" comes from RFC 3447.#[cfg(feature = "rsa_signing")]pubtraitEncoding:Sync{fnencode(&self,m_hash:&digest::Digest,m_out:&mut[u8],mod_bits: bits::BitLength,rng:&rand::SecureRandom)
-> Result<(), error::Unspecified>;}/// The term "Verification" comes from RFC 3447.pubtraitVerification:Sync{fnverify(&self,m_hash:&digest::Digest,m:&mut untrusted::Reader,mod_bits: bits::BitLength) -> Result<(), error::Unspecified>;}
Notice in particular that we do digest::digest(digest_alg, msg) in both PKCS#1 and PSS padding, for both encoding and verification, so it makes sense to do the digesting in the callers, verify_rsa() and RSASigningState::sign().
Activity
briansmith commentedon Nov 15, 2016
/cc @samscott89
briansmith commentedon Nov 23, 2016
This was done in 5a96fa8.