Files
linux-cix/crypto
Stefan Berger e7fcd5d696 crypto: ecdsa - Convert byte arrays with key coordinates to digits
[ Upstream commit d67c96fb97b5811e15c881d5cb72e293faa5f8e1 ]

For NIST P192/256/384 the public key's x and y parameters could be copied
directly from a given array since both parameters filled 'ndigits' of
digits (a 'digit' is a u64). For support of NIST P521 the key parameters
need to have leading zeros prepended to the most significant digit since
only 2 bytes of the most significant digit are provided.

Therefore, implement ecc_digits_from_bytes to convert a byte array into an
array of digits and use this function in ecdsa_set_pub_key where an input
byte array needs to be converted into digits.

Suggested-by: Lukas Wunner <lukas@wunner.de>
Tested-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Stable-dep-of: 3b0565c70350 ("crypto: ecdsa - Avoid signed integer overflow on signature decoding")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-09 13:31:40 +01:00
..
2023-06-23 16:15:36 +08:00
2023-05-24 18:12:33 +08:00
2023-02-14 13:39:33 +08:00
2023-06-16 20:30:35 +08:00
2023-06-27 15:40:24 +08:00
2023-02-14 13:39:33 +08:00
2022-12-02 18:12:40 +08:00
2022-12-02 18:12:40 +08:00
2024-10-04 16:28:49 +02:00