Skip to content
Commit d858b071 authored by Herbert Xu's avatar Herbert Xu
Browse files

crypto: rsa-pkcs1pad - Avoid copying output when possible



In the vast majority of cases (2^-32 on 32-bit and 2^-64 on 64-bit)
cases, the result from encryption/signing will require no padding.

This patch makes these two operations write their output directly
to the final destination.  Only in the exceedingly rare cases where
fixup is needed to we copy it out and back to add the leading zeroes.

This patch also makes use of the crypto_akcipher_set_crypt API
instead of writing the akcipher request directly.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 73f79189
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment