diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2022-02-23 08:07:01 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2022-03-03 10:49:20 +1200 |
commit | ad91155d98938a18a52d582af1d6d3d924e867ce (patch) | |
tree | 508062f60ecba3eece0b673d8f0bcbd3f53c4be0 /crypto/sha512_generic.c | |
parent | 0a51cda331bd1374440b5b66547f2389eb57e1e2 (diff) | |
download | linux-crypto-ad91155d98938a18a52d582af1d6d3d924e867ce.tar.gz linux-crypto-ad91155d98938a18a52d582af1d6d3d924e867ce.zip |
crypto: crypto_xor - use helpers for unaligned accesses
Dereferencing a misaligned pointer is undefined behavior in C, and may
result in codegen on architectures such as ARM that trigger alignments
traps and expensive fixups in software.
Instead, use the get_aligned()/put_aligned() accessors, which are cheap
or even completely free when CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y.
In the converse case, the prior alignment checks ensure that the casts
are safe, and so no unaligned accessors are necessary.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/sha512_generic.c')
0 files changed, 0 insertions, 0 deletions