]> www.infradead.org Git - users/jedix/linux-maple.git/commit
crypto: rsa-pkcs1pad - Deduplicate set_{pub,priv}_key callbacks
authorLukas Wunner <lukas@wunner.de>
Tue, 10 Sep 2024 14:30:15 +0000 (16:30 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 5 Oct 2024 05:22:04 +0000 (13:22 +0800)
commit7964b0d4bd1271f82d6b455366a200d320f7dbf8
tree8d5c04a910f873f121d962185f5ab64bc91fc667
parentae117924b291b2ccf6be0fe197695c96fc62e78c
crypto: rsa-pkcs1pad - Deduplicate set_{pub,priv}_key callbacks

pkcs1pad_set_pub_key() and pkcs1pad_set_priv_key() are almost identical.

The upcoming migration of sign/verify operations from rsa-pkcs1pad.c
into a separate crypto_template will require another copy of the exact
same functions.  When RSASSA-PSS and RSAES-OAEP are introduced, each
will need yet another copy.

Deduplicate the functions into a single one which lives in a common
header file for reuse by RSASSA-PKCS1-v1_5, RSASSA-PSS and RSAES-OAEP.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/rsa-pkcs1pad.c
include/crypto/internal/rsa.h