linux/Documentation/crypto
Lukas Wunner a2471684da crypto: ecdsa - Move X9.62 signature size calculation into template
software_key_query() returns the maximum signature and digest size for a
given key to user space.  When it only supported RSA keys, calculating
those sizes was trivial as they were always equivalent to the key size.

However when ECDSA was added, the function grew somewhat complicated
calculations which take the ASN.1 encoding and curve into account.
This doesn't scale well and adjusting the calculations is easily
forgotten when adding support for new encodings or curves.  In fact,
when NIST P521 support was recently added, the function was initially
not amended:

https://lore.kernel.org/all/b749d5ee-c3b8-4cbd-b252-7773e4536e07@linux.ibm.com/

Introduce a ->max_size() callback to struct sig_alg and take advantage
of it to move the signature size calculations to ecdsa-x962.c.

Introduce a ->digest_size() callback to struct sig_alg and move the
maximum ECDSA digest size to ecdsa.c.  It is common across ecdsa-x962.c
and the upcoming ecdsa-p1363.c and thus inherited by both of them.

For all other algorithms, continue using the key size as maximum
signature and digest size.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2024-10-05 13:22:04 +08:00
..
device_drivers crypto: octeontx2 - add devlink option to set t106 mode 2023-12-29 11:25:38 +08:00
api-aead.rst crypto: doc - optimize compilation 2016-12-13 16:38:07 -07:00
api-akcipher.rst crypto: akcipher - Drop sign/verify operations 2024-10-05 13:22:04 +08:00
api-digest.rst crypto: doc - Fix hash export state information 2017-02-03 18:16:11 +08:00
api-intro.rst It's been a busy cycle for documentation - hopefully the busiest for a 2020-08-04 22:47:54 -07:00
api-kpp.rst crypto: doc - optimize compilation 2016-12-13 16:38:07 -07:00
api-rng.rst crypto: doc - optimize compilation 2016-12-13 16:38:07 -07:00
api-samples.rst crypto: doc - improve the skcipher API example code 2019-06-13 14:31:40 +08:00
api-sig.rst crypto: ecdsa - Move X9.62 signature size calculation into template 2024-10-05 13:22:04 +08:00
api-skcipher.rst crypto: remove cipher routines from public crypto API 2021-01-03 08:41:35 +11:00
api.rst crypto: sig - Introduce sig_alg backend 2024-10-05 13:22:04 +08:00
architecture.rst crypto: sig - Introduce sig_alg backend 2024-10-05 13:22:04 +08:00
asymmetric-keys.rst docs: crypto: convert asymmetric-keys.txt to ReST 2020-06-19 14:03:46 -06:00
async-tx-api.rst docs: crypto: async-tx-api: fix broken code example 2024-06-12 15:41:09 -06:00
crypto_engine.rst crypto: engine - Add KPP Support to Crypto Engine 2021-10-29 21:04:03 +08:00
descore-readme.rst docs: crypto: descore-readme.txt: convert to ReST format 2020-06-19 14:05:22 -06:00
devel-algos.rst crypto: ahash - remove support for nonzero alignmask 2023-10-27 18:04:29 +08:00
index.rst Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
intro.rst crypto: doc - convert crypto API documentation to Sphinx 2016-12-13 16:37:54 -07:00
userspace-if.rst crypto: af_alg - Support symmetric encryption via keyring keys 2022-10-28 12:36:34 +08:00