]> git.ipfire.org Git - thirdparty/linux.git/commit
crypto: virtio - Simplify RSA key size caching
authorLukas Wunner <lukas@wunner.de>
Mon, 3 Feb 2025 13:37:02 +0000 (14:37 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 22 Feb 2025 07:56:02 +0000 (15:56 +0800)
commit17410baf65c51d9792528c5484c8167bd186e98d
tree5d211187839181b7541259024832e5bcce4bbb68
parentdede7911e603d6d1952f766fb4541b988e4439c0
crypto: virtio - Simplify RSA key size caching

When setting a public or private RSA key, the integer n is cached in the
transform context virtio_crypto_akcipher_ctx -- with the sole purpose of
calculating the key size from it in virtio_crypto_rsa_max_size().
It looks like this was copy-pasted from crypto/rsa.c.

Cache the key size directly instead of the integer n, thus simplifying
the code and reducing the memory footprint.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/virtio/virtio_crypto_akcipher_algs.c