crypto: sig - Introduce sig_alg backend
Commit 6cb8815f41 ("crypto: sig - Add interface for sign/verify")
began a transition of asymmetric sign/verify operations from
crypto_akcipher to a new crypto_sig frontend.
Internally, the crypto_sig frontend still uses akcipher_alg as backend,
however:
"The link between sig and akcipher is meant to be temporary. The
plan is to create a new low-level API for sig and then migrate
the signature code over to that from akcipher."
https://lore.kernel.org/r/ZrG6w9wsb-iiLZIF@gondor.apana.org.au/
"having a separate alg for sig is definitely where we want to
be since there is very little that the two types actually share."
https://lore.kernel.org/r/ZrHlpz4qnre0zWJO@gondor.apana.org.au/
Take the next step of that migration and augment the crypto_sig frontend
with a sig_alg backend to which all algorithms can be moved.
During the migration, there will briefly be signature algorithms that
are still based on crypto_akcipher, whilst others are already based on
crypto_sig. Allow for that by building a fork into crypto_sig_*() API
calls (i.e. crypto_sig_maxsize() and friends) such that one of the two
backends is selected based on the transform's cra_type.
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -64,6 +64,7 @@ enum crypto_attr_type_t {
|
||||
CRYPTOCFGA_STAT_AKCIPHER, /* No longer supported, do not use. */
|
||||
CRYPTOCFGA_STAT_KPP, /* No longer supported, do not use. */
|
||||
CRYPTOCFGA_STAT_ACOMP, /* No longer supported, do not use. */
|
||||
CRYPTOCFGA_REPORT_SIG, /* struct crypto_report_sig */
|
||||
__CRYPTOCFGA_MAX
|
||||
|
||||
#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
|
||||
@@ -207,6 +208,10 @@ struct crypto_report_acomp {
|
||||
char type[CRYPTO_MAX_NAME];
|
||||
};
|
||||
|
||||
struct crypto_report_sig {
|
||||
char type[CRYPTO_MAX_NAME];
|
||||
};
|
||||
|
||||
#define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \
|
||||
sizeof(struct crypto_report_blkcipher))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user