Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openssl/openssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Cosgrove <tom.cosgrove@arm.com>2021-06-17 14:21:23 +0300
committerTomas Mraz <tomas@openssl.org>2022-11-11 12:04:11 +0300
commitbfdcbe95fde121b769f263b29566833dadc2ed41 (patch)
tree97ae2d32a55b1dfdd7c2d5d103595df67a635522
parent8a2941870ec85767bed7e96f42433b6912726dff (diff)
Use Perl to generate bsaes-armv8.S
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14592) (cherry picked from commit a35c3a9f5be07c4c1bcabdd98ea56ff3ff20b645)
-rw-r--r--crypto/aes/asm/bsaes-armv8.pl (renamed from crypto/aes/asm/bsaes-armv8.S)44
-rw-r--r--crypto/aes/build.info2
2 files changed, 45 insertions, 1 deletions
diff --git a/crypto/aes/asm/bsaes-armv8.S b/crypto/aes/asm/bsaes-armv8.pl
index 27b2ff384d..5270ca7c62 100644
--- a/crypto/aes/asm/bsaes-armv8.S
+++ b/crypto/aes/asm/bsaes-armv8.pl
@@ -1,3 +1,37 @@
+#!/usr/bin/env perl
+# Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (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
+
+use strict;
+
+my $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+my $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+my $xlate;
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1;
+( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or
+( $xlate="${dir}../../perlasm/arm-xlate.pl" and -f $xlate ) or
+die "can't locate arm-xlate.pl";
+
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
+
+my $code = data();
+print $code;
+
+close STDOUT or die "error closing STDOUT: $!"; # enforce flush
+
+sub data
+{
+ local $/;
+ return <DATA>;
+}
+
+__END__
// Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
//
// Licensed under the OpenSSL license (the "License"). You may not use
@@ -26,6 +60,10 @@
.text
+.extern AES_cbc_encrypt
+.extern AES_encrypt
+.extern AES_decrypt
+
.type _bsaes_decrypt8,%function
.align 4
// On entry:
@@ -981,7 +1019,13 @@ _bsaes_key_convert:
// No output registers, usual AAPCS64 register preservation
ossl_bsaes_cbc_encrypt:
cmp x2, #128
+#ifdef __APPLE__
+ bhs .Lcbc_do_bsaes
+ b AES_cbc_encrypt
+.Lcbc_do_bsaes:
+#else
blo AES_cbc_encrypt
+#endif
// it is up to the caller to make sure we are called with enc == 0
diff --git a/crypto/aes/build.info b/crypto/aes/build.info
index cdc893a33b..2171baeca4 100644
--- a/crypto/aes/build.info
+++ b/crypto/aes/build.info
@@ -80,7 +80,7 @@ IF[{- !$disabled{module} && !$disabled{shared} -}]
ENDIF
GENERATE[aes-ia64.s]=asm/aes-ia64.S
-GENERATE[bsaes-armv8.S]=asm/bsaes-armv8.S
+GENERATE[bsaes-armv8.S]=asm/bsaes-armv8.pl
GENERATE[aes-586.S]=asm/aes-586.pl
DEPEND[aes-586.S]=../perlasm/x86asm.pl