diff options
author | Daniel Neus <[email protected]> | 2016-06-28 18:19:41 +0200 |
---|---|---|
committer | Daniel Neus <[email protected]> | 2016-06-28 18:19:41 +0200 |
commit | dae2bff6dab46c6c9d0ce5f62d0eac8f058c670b (patch) | |
tree | 9e2a45613850fe6ecc281357ceae898dda611e0e /src/lib | |
parent | d70e8347738df1e1e061514cc42413006a1ab9a1 (diff) |
reuse BigInt::encode_1363 instead of self written logic
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/prov/pkcs11/p11_rsa.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/lib/prov/pkcs11/p11_rsa.cpp b/src/lib/prov/pkcs11/p11_rsa.cpp index 331e1d0a7..9e5675301 100644 --- a/src/lib/prov/pkcs11/p11_rsa.cpp +++ b/src/lib/prov/pkcs11/p11_rsa.cpp @@ -163,12 +163,7 @@ class PKCS11_RSA_Decryption_Operation : public PK_Ops::Decryption // Unblind for RSA/RAW decryption if(!m_mechanism.padding_size()) { - secure_vector<byte> unblinded_data = BigInt::encode_locked(m_blinder.unblind(BigInt::decode(decrypted_data))); - - // pad possible leading zeros that were stripped off during conversion to BigInt - secure_vector<byte> padded_result(m_key.get_n().bits() / 8 - unblinded_data.size()); - padded_result.insert(padded_result.end(), unblinded_data.begin(), unblinded_data.end()); - decrypted_data = padded_result; + decrypted_data = BigInt::encode_1363(m_blinder.unblind(BigInt::decode(decrypted_data)), m_key.get_n().bits() / 8 ); } valid_mask = 0xFF; |