author: Mian Yousaf Kaukab <ykaukab@suse.de> 2021-07-21 10:39:05 +0200
committer: Herbert Xu <herbert@gondor.apana.org.au> 2021-07-30 10:58:36 +0800
commit: 0469dede0eeeefe12a9a2fd76078f4a266513457
parent: d5ee8e750c9449e9849a09ce6fb6b8adeaa66adc
Commit Summary:
Diffstat:
1 file changed, 3 insertions, 2 deletions
diff --git a/crypto/ecc.h b/crypto/ecc.h
index a006132646a4..1350e8eb6ac2 100644
--- a/crypto/ecc.h
+++ b/crypto/ecc.h
@@ -27,6 +27,7 @@
#define _CRYPTO_ECC_H
#include <crypto/ecc_curve.h>
+#include <asm/unaligned.h>
/* One digit is u64 qword. */
#define ECC_CURVE_NIST_P192_DIGITS 3
@@ -46,13 +47,13 @@
* @out: Output array
* @ndigits: Number of digits to copy
*/
-static inline void ecc_swap_digits(const u64 *in, u64 *out, unsigned int ndigits)
+static inline void ecc_swap_digits(const void *in, u64 *out, unsigned int ndigits)
{
const __be64 *src = (__force __be64 *)in;
int i;
for (i = 0; i < ndigits; i++)
- out[i] = be64_to_cpu(src[ndigits - 1 - i]);
+ out[i] = get_unaligned_be64(&src[ndigits - 1 - i]);
}
/**