Following the license change, modify the boilerplates in crypto/bn/
[openssl.git] / crypto / bn / asm / co-586.pl
index 0bcb5a6d471c4c6b3b44364474233f382ad5fd93..a0f5a46979f78a468b8cf6697a0869bd035c9994 100644 (file)
@@ -1,9 +1,19 @@
-#!/usr/local/bin/perl
-
-push(@INC,"perlasm","../../perlasm");
+#! /usr/bin/env perl
+# Copyright 1995-2016 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
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
+push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
-&asm_init($ARGV[0],"bn-586.pl");
+$output = pop;
+open STDOUT,">$output";
+
+&asm_init($ARGV[0]);
 
 &bn_mul_comba("bn_mul_comba8",8);
 &bn_mul_comba("bn_mul_comba4",4);
@@ -12,6 +22,8 @@ require "x86asm.pl";
 
 &asm_finish();
 
+close STDOUT;
+
 sub mul_add_c
        {
        local($a,$ai,$b,$bi,$c0,$c1,$c2,$pos,$i,$na,$nb)=@_;
@@ -35,7 +47,7 @@ sub mul_add_c
         &mov("edx",&DWP(($nb)*4,$b,"",0)) if $pos == 1;        # laod next b
         ###
        &adc($c2,0);
-        # is pos > 1, it means it is the last loop 
+        # is pos > 1, it means it is the last loop
         &mov(&DWP($i*4,"eax","",0),$c0) if $pos > 0;           # save r[];
        &mov("eax",&DWP(($na)*4,$a,"",0)) if $pos == 1;         # laod next a
        }
@@ -64,7 +76,7 @@ sub sqr_add_c
         &mov("edx",&DWP(($nb)*4,$a,"",0)) if ($pos == 1) && ($na != $nb);
         ###
        &adc($c2,0);
-        # is pos > 1, it means it is the last loop 
+        # is pos > 1, it means it is the last loop
         &mov(&DWP($i*4,$r,"",0),$c0) if $pos > 0;              # save r[];
        &mov("eax",&DWP(($na)*4,$a,"",0)) if $pos == 1;         # load next b
        }
@@ -115,7 +127,7 @@ sub bn_mul_comba
        $c2="ebp";
        $a="esi";
        $b="edi";
-       
+
        $as=0;
        $ae=0;
        $bs=0;
@@ -130,9 +142,9 @@ sub bn_mul_comba
         &push("ebx");
 
        &xor($c0,$c0);
-        &mov("eax",&DWP(0,$a,"",0));   # load the first word 
+        &mov("eax",&DWP(0,$a,"",0));   # load the first word
        &xor($c1,$c1);
-        &mov("edx",&DWP(0,$b,"",0));   # load the first second 
+        &mov("edx",&DWP(0,$b,"",0));   # load the first second
 
        for ($i=0; $i<$tot; $i++)
                {
@@ -140,7 +152,7 @@ sub bn_mul_comba
                $bi=$bs;
                $end=$be+1;
 
-               &comment("################## Calculate word $i"); 
+               &comment("################## Calculate word $i");
 
                for ($j=$bs; $j<$end; $j++)
                        {