mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 07:47:50 +00:00
lib/crypto: x86/polyval: Migrate optimized code into library
Migrate the x86_64 implementation of POLYVAL into lib/crypto/, wiring it up to the POLYVAL library interface. This makes the POLYVAL library be properly optimized on x86_64. This drops the x86_64 optimizations of polyval in the crypto_shash API. That's fine, since polyval will be removed from crypto_shash entirely since it is unneeded there. But even if it comes back, the crypto_shash API could just be implemented on top of the library API, as usual. Adjust the names and prototypes of the assembly functions to align more closely with the rest of the library code. Also replace a movaps instruction with movups to remove the assumption that the key struct is 16-byte aligned. Users can still align the key if they want (and at least in this case, movups is just as fast as movaps), but it's inconvenient to require it. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20251109234726.638437-6-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
This commit is contained in:
@@ -48,6 +48,9 @@ struct polyval_key {
|
||||
#ifdef CONFIG_ARM64
|
||||
/** @h_powers: Powers of the hash key H^8 through H^1 */
|
||||
struct polyval_elem h_powers[8];
|
||||
#elif defined(CONFIG_X86)
|
||||
/** @h_powers: Powers of the hash key H^8 through H^1 */
|
||||
struct polyval_elem h_powers[8];
|
||||
#else
|
||||
#error "Unhandled arch"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user