On Tue, Nov 24, 2020 at 11:47:19AM +0100, Ard Biesheuvel wrote: > ecdh_set_secret() casts a void* pointer to a const u64* in order to > feed it into ecc_is_key_valid(). This is not generally permitted by > the C standard, and leads to actual misalignment faults on ARMv6 > cores. In some cases, these are fixed up in software, but this still > leads to performance hits that are entirely avoidable. > > So let's copy the key into the ctx buffer first, which we will do > anyway in the common case, and which guarantees correct alignment. > > Cc: <[email protected]> > Signed-off-by: Ard Biesheuvel <[email protected]> > --- > crypto/ecdh.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-)
Patch applied. Thanks. -- Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
