aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org> 2024-05-20 08:47:54 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org> 2024-05-20 08:47:54 -0700
commit568c98a0f6eff6d44accfe56d0c58008bf0d498e (patch)
tree1a63e4f278c0917745861dd0bcd85ae84dd3d659 /include
parentMerge tag 'mm-nonmm-stable-2024-05-19-11-56' of git://git.kernel.org/pub/scm/... (diff)
parentcrypto: ecc - Prevent ecc_digits_from_bytes from reading too many bytes (diff)
downloadlinux-568c98a0f6eff6d44accfe56d0c58008bf0d498e.tar.gz
linux-568c98a0f6eff6d44accfe56d0c58008bf0d498e.tar.bz2
linux-568c98a0f6eff6d44accfe56d0c58008bf0d498e.zip
Merge tag 'v6.10-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "Fix a bug in the new ecc P521 code as well as a buggy fix in qat" * tag 'v6.10-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: ecc - Prevent ecc_digits_from_bytes from reading too many bytes crypto: qat - Fix ADF_DEV_RESET_SYNC memory leak
Diffstat (limited to 'include')
-rw-r--r--include/crypto/internal/ecc.h15
1 files changed, 2 insertions, 13 deletions
diff --git a/include/crypto/internal/ecc.h b/include/crypto/internal/ecc.h
index 7ca1f463d1ec..f7e75e1e71f3 100644
--- a/include/crypto/internal/ecc.h
+++ b/include/crypto/internal/ecc.h
@@ -64,19 +64,8 @@ static inline void ecc_swap_digits(const void *in, u64 *out, unsigned int ndigit
* @out Output digits array
* @ndigits: Number of digits to create from byte array
*/
-static inline void ecc_digits_from_bytes(const u8 *in, unsigned int nbytes,
- u64 *out, unsigned int ndigits)
-{
- unsigned int o = nbytes & 7;
- __be64 msd = 0;
-
- if (o) {
- memcpy((u8 *)&msd + sizeof(msd) - o, in, o);
- out[--ndigits] = be64_to_cpu(msd);
- in += o;
- }
- ecc_swap_digits(in, out, ndigits);
-}
+void ecc_digits_from_bytes(const u8 *in, unsigned int nbytes,
+ u64 *out, unsigned int ndigits);
/**
* ecc_is_key_valid() - Validate a given ECDH private key