]> git.ipfire.org Git - thirdparty/openssl.git/commit
Optimize x86/aarch64 MD5 implementation
authorJonathan Swinney <jswinney@amazon.com>
Fri, 18 Oct 2024 16:55:07 +0000 (11:55 -0500)
committerTomas Mraz <tomas@openssl.org>
Mon, 6 Jan 2025 10:43:36 +0000 (11:43 +0100)
commitebe34f9a62630b45a825bc07a2e9cf52731e836e
treed67734e0db11499a2caba29ed031b2c066b2c59b
parent0a0862969f954dddaae12cf7b598bed6016a55d7
Optimize x86/aarch64 MD5 implementation

As suggested in https://github.com/animetosho/md5-optimisation?tab=readme-ov-file#dependency-shortcut-in-g-function,
we can delay the dependency on 'x' by recognizing that ((x & z) | (y & ~z))
is equivalent to ((x & z) + (y + ~z)) in this scenario, and we can perform
those additions independently, leaving our dependency on x to the final
addition. This speeds it up around 5% on both platforms.

Signed-off-by: Oli Gillespie <ogillesp@amazon.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Hugo Landau <hlandau@devever.net>
(Merged from https://github.com/openssl/openssl/pull/25737)
crypto/md5/asm/md5-aarch64.pl
crypto/md5/asm/md5-x86_64.pl