AArch64 assembly pack: authenticate return addresses.
[oweals/openssl.git] / crypto / bn / asm / armv8-mont.pl
index f04aab16bc59d69c26cca058b4c4eefddcff7f52..ed419c3d0e62bb4b61cacdc1cba426985558db9a 100755 (executable)
@@ -1,4 +1,11 @@
-#!/usr/bin/env perl
+#! /usr/bin/env perl
+# Copyright 2015-2016 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
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
 
 # ====================================================================
 # Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
@@ -280,6 +287,7 @@ __bn_sqr8x_mont:
        cmp     $ap,$bp
        b.ne    __bn_mul4x_mont
 .Lsqr8x_mont:
+       .inst   0xd503233f              // paciasp
        stp     x29,x30,[sp,#-128]!
        add     x29,sp,#0
        stp     x19,x20,[sp,#16]
@@ -1033,6 +1041,7 @@ $code.=<<___;
        ldp     x25,x26,[x29,#64]
        ldp     x27,x28,[x29,#80]
        ldr     x29,[sp],#128
+       .inst   0xd50323bf              // autiasp
        ret
 .size  __bn_sqr8x_mont,.-__bn_sqr8x_mont
 ___
@@ -1056,6 +1065,7 @@ $code.=<<___;
 .type  __bn_mul4x_mont,%function
 .align 5
 __bn_mul4x_mont:
+       .inst   0xd503233f              // paciasp
        stp     x29,x30,[sp,#-128]!
        add     x29,sp,#0
        stp     x19,x20,[sp,#16]
@@ -1489,6 +1499,7 @@ __bn_mul4x_mont:
        ldp     x25,x26,[x29,#64]
        ldp     x27,x28,[x29,#80]
        ldr     x29,[sp],#128
+       .inst   0xd50323bf              // autiasp
        ret
 .size  __bn_mul4x_mont,.-__bn_mul4x_mont
 ___