diff options
author | Andy Polyakov <appro@openssl.org> | 2016-05-15 17:01:15 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2016-05-19 22:33:00 +0200 |
commit | e33826f01bd78af76e0135c8dfab3387927a82bb (patch) | |
tree | a44459e3859610fe7ce35bc4923d8af6d6110e09 /crypto/arm64cpuid.pl | |
parent | rand/randfile.c: remove _XOPEN_SOURCE definition. (diff) | |
download | openssl-e33826f01bd78af76e0135c8dfab3387927a82bb.tar.xz openssl-e33826f01bd78af76e0135c8dfab3387927a82bb.zip |
Add assembly CRYPTO_memcmp.
GH: #102
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/arm64cpuid.pl')
-rwxr-xr-x | crypto/arm64cpuid.pl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crypto/arm64cpuid.pl b/crypto/arm64cpuid.pl index c0af608142..caa33875c9 100755 --- a/crypto/arm64cpuid.pl +++ b/crypto/arm64cpuid.pl @@ -100,6 +100,26 @@ OPENSSL_cleanse: cbnz x1,.Little // len!=0? ret .size OPENSSL_cleanse,.-OPENSSL_cleanse + +.globl CRYPTO_memcmp +.type CRYPTO_memcmp,%function +.align 4 +CRYPTO_memcmp: + eor w3,w3,w3 + cbz x2,.Lno_data // len==0? +.Loop_cmp: + ldrb w4,[x0],#1 + ldrb w5,[x1],#1 + eor w4,w4,w5 + orr w3,w3,w4 + subs x2,x2,#1 + b.ne .Loop_cmp + +.Lno_data: + neg w0,w3 + lsr w0,w0,#31 + ret +.size CRYPTO_memcmp,.-CRYPTO_memcmp ___ print $code; |