Update copyright year
[openssl.git] / crypto / ec / asm / ecp_nistz256-armv4.pl
index de3cd5cd0f606c480487b205a49949c15911a35e..83abbdd895780d157f6dd71c02712d6dc8d7a687 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
@@ -233,7 +233,7 @@ __ecp_nistz256_add:
        @ if a+b >= modulus, subtract modulus.
        @
        @ But since comparison implies subtraction, we subtract
-       @ modulus and then add it back if subraction borrowed.
+       @ modulus and then add it back if subtraction borrowed.
 
        subs    $a0,$a0,#-1
        sbcs    $a1,$a1,#-1
@@ -894,13 +894,13 @@ ecp_nistz256_scatter_w7:
 .Loop_scatter_w7:
        ldr     $mask,[$inp],#4
        subs    $index,$index,#1
-       strb    $mask,[$out,#64*0-1]
+       strb    $mask,[$out,#64*0]
        mov     $mask,$mask,lsr#8
-       strb    $mask,[$out,#64*1-1]
+       strb    $mask,[$out,#64*1]
        mov     $mask,$mask,lsr#8
-       strb    $mask,[$out,#64*2-1]
+       strb    $mask,[$out,#64*2]
        mov     $mask,$mask,lsr#8
-       strb    $mask,[$out,#64*3-1]
+       strb    $mask,[$out,#64*3]
        add     $out,$out,#64*4
        bne     .Loop_scatter_w7
 
@@ -1222,7 +1222,7 @@ __ecp_nistz256_add_self:
        @ if a+b >= modulus, subtract modulus.
        @
        @ But since comparison implies subtraction, we subtract
-       @ modulus and then add it back if subraction borrowed.
+       @ modulus and then add it back if subtraction borrowed.
 
        subs    $a0,$a0,#-1
        sbcs    $a1,$a1,#-1
@@ -1405,27 +1405,19 @@ ecp_nistz256_point_add:
        stmdb   sp!,{r0-r12,lr}         @ push from r0, unusual, but intentional
        sub     sp,sp,#32*18+16
 
-       ldmia   $b_ptr!,{r4-r11}        @ copy in2
+       ldmia   $b_ptr!,{r4-r11}        @ copy in2_x
        add     r3,sp,#$in2_x
-       orr     r12,r4,r5
-       orr     r12,r12,r6
-       orr     r12,r12,r7
-       orr     r12,r12,r8
-       orr     r12,r12,r9
-       orr     r12,r12,r10
-       orr     r12,r12,r11
        stmia   r3!,{r4-r11}
-       ldmia   $b_ptr!,{r4-r11}
-       orr     r12,r12,r4
-       orr     r12,r12,r5
+       ldmia   $b_ptr!,{r4-r11}        @ copy in2_y
+       stmia   r3!,{r4-r11}
+       ldmia   $b_ptr,{r4-r11}         @ copy in2_z
+       orr     r12,r4,r5
        orr     r12,r12,r6
        orr     r12,r12,r7
        orr     r12,r12,r8
        orr     r12,r12,r9
        orr     r12,r12,r10
        orr     r12,r12,r11
-       stmia   r3!,{r4-r11}
-       ldmia   $b_ptr,{r4-r11}
        cmp     r12,#0
 #ifdef __thumb2__
        it      ne
@@ -1434,27 +1426,19 @@ ecp_nistz256_point_add:
        stmia   r3,{r4-r11}
        str     r12,[sp,#32*18+8]       @ !in2infty
 
-       ldmia   $a_ptr!,{r4-r11}        @ copy in1
+       ldmia   $a_ptr!,{r4-r11}        @ copy in1_x
        add     r3,sp,#$in1_x
-       orr     r12,r4,r5
-       orr     r12,r12,r6
-       orr     r12,r12,r7
-       orr     r12,r12,r8
-       orr     r12,r12,r9
-       orr     r12,r12,r10
-       orr     r12,r12,r11
        stmia   r3!,{r4-r11}
-       ldmia   $a_ptr!,{r4-r11}
-       orr     r12,r12,r4
-       orr     r12,r12,r5
+       ldmia   $a_ptr!,{r4-r11}        @ copy in1_y
+       stmia   r3!,{r4-r11}
+       ldmia   $a_ptr,{r4-r11}         @ copy in1_z
+       orr     r12,r4,r5
        orr     r12,r12,r6
        orr     r12,r12,r7
        orr     r12,r12,r8
        orr     r12,r12,r9
        orr     r12,r12,r10
        orr     r12,r12,r11
-       stmia   r3!,{r4-r11}
-       ldmia   $a_ptr,{r4-r11}
        cmp     r12,#0
 #ifdef __thumb2__
        it      ne
@@ -1649,7 +1633,7 @@ ___
 $code.=<<___;
 .Ladd_done:
        add     sp,sp,#32*18+16+16      @ +16 means "skip even over saved r0-r3"
-#if __ARM_ARCH__>=5 || defined(__thumb__)
+#if __ARM_ARCH__>=5 || !defined(__thumb__)
        ldmia   sp!,{r4-r12,pc}
 #else
        ldmia   sp!,{r4-r12,lr}
@@ -1684,27 +1668,19 @@ ecp_nistz256_point_add_affine:
        stmdb   sp!,{r0-r12,lr}         @ push from r0, unusual, but intentional
        sub     sp,sp,#32*15
 
-       ldmia   $a_ptr!,{r4-r11}        @ copy in1
+       ldmia   $a_ptr!,{r4-r11}        @ copy in1_x
        add     r3,sp,#$in1_x
-       orr     r12,r4,r5
-       orr     r12,r12,r6
-       orr     r12,r12,r7
-       orr     r12,r12,r8
-       orr     r12,r12,r9
-       orr     r12,r12,r10
-       orr     r12,r12,r11
        stmia   r3!,{r4-r11}
-       ldmia   $a_ptr!,{r4-r11}
-       orr     r12,r12,r4
-       orr     r12,r12,r5
+       ldmia   $a_ptr!,{r4-r11}        @ copy in1_y
+       stmia   r3!,{r4-r11}
+       ldmia   $a_ptr,{r4-r11}         @ copy in1_z
+       orr     r12,r4,r5
        orr     r12,r12,r6
        orr     r12,r12,r7
        orr     r12,r12,r8
        orr     r12,r12,r9
        orr     r12,r12,r10
        orr     r12,r12,r11
-       stmia   r3!,{r4-r11}
-       ldmia   $a_ptr,{r4-r11}
        cmp     r12,#0
 #ifdef __thumb2__
        it      ne
@@ -1713,7 +1689,7 @@ ecp_nistz256_point_add_affine:
        stmia   r3,{r4-r11}
        str     r12,[sp,#32*15+4]       @ !in1infty
 
-       ldmia   $b_ptr!,{r4-r11}        @ copy in2
+       ldmia   $b_ptr!,{r4-r11}        @ copy in2_x
        add     r3,sp,#$in2_x
        orr     r12,r4,r5
        orr     r12,r12,r6
@@ -1723,7 +1699,7 @@ ecp_nistz256_point_add_affine:
        orr     r12,r12,r10
        orr     r12,r12,r11
        stmia   r3!,{r4-r11}
-       ldmia   $b_ptr!,{r4-r11}
+       ldmia   $b_ptr!,{r4-r11}        @ copy in2_y
        orr     r12,r12,r4
        orr     r12,r12,r5
        orr     r12,r12,r6