Following the license change, modify the boilerplates in crypto/bn/
[openssl.git] / crypto / arm64cpuid.pl
index caa33875c93739e9f9645f1350078bb231bfeb69..06c8add7a07561f1f00b2e5edb6826881771ba83 100755 (executable)
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the OpenSSL license (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -63,6 +63,7 @@ _armv8_sha256_probe:
        sha256su0       v0.4s, v0.4s
        ret
 .size  _armv8_sha256_probe,.-_armv8_sha256_probe
+
 .globl _armv8_pmull_probe
 .type  _armv8_pmull_probe,%function
 _armv8_pmull_probe:
@@ -70,6 +71,13 @@ _armv8_pmull_probe:
        ret
 .size  _armv8_pmull_probe,.-_armv8_pmull_probe
 
+.globl _armv8_sha512_probe
+.type  _armv8_sha512_probe,%function
+_armv8_sha512_probe:
+       .long   0xcec08000      // sha512su0    v0.2d,v0.2d
+       ret
+.size  _armv8_sha512_probe,.-_armv8_sha512_probe
+
 .globl OPENSSL_cleanse
 .type  OPENSSL_cleanse,%function
 .align 5
@@ -107,6 +115,19 @@ OPENSSL_cleanse:
 CRYPTO_memcmp:
        eor     w3,w3,w3
        cbz     x2,.Lno_data    // len==0?
+       cmp     x2,#16
+       b.ne    .Loop_cmp
+       ldp     x8,x9,[x0]
+       ldp     x10,x11,[x1]
+       eor     x8,x8,x10
+       eor     x9,x9,x11
+       orr     x8,x8,x9
+       mov     x0,#1
+       cmp     x8,#0
+       csel    x0,xzr,x0,eq
+       ret
+
+.align 4
 .Loop_cmp:
        ldrb    w4,[x0],#1
        ldrb    w5,[x1],#1