RustCrypto / RSA

RSA implementation in pure Rust
Apache License 2.0
536 stars 148 forks source link

Fix possible panic in internals::left_pad #262

Closed dfabregat closed 1 year ago

dfabregat commented 1 year ago

This commit prevents potential panics in internals::left_pad when the requested padded length is smaller than the input length. It also removes related dead-code in the implementation of EncryptionPrimitive for RsaPublicKey (when not panicking, the returned vector was always of length pad_size).

Feedback welcome :)