Robert Sloan | c9abfe4 | 2018-11-26 12:19:07 -0800 | [diff] [blame] | 1 | // This file is generated from a similarly-named Perl script in the BoringSSL |
| 2 | // source tree. Do not edit by hand. |
| 3 | |
Pete Bentley | 0c61efe | 2019-08-13 09:32:23 +0100 | [diff] [blame^] | 4 | #if !defined(__has_feature) |
| 5 | #define __has_feature(x) 0 |
| 6 | #endif |
Robert Sloan | 726e9d1 | 2018-09-11 11:45:04 -0700 | [diff] [blame] | 7 | #if __has_feature(memory_sanitizer) && !defined(OPENSSL_NO_ASM) |
| 8 | #define OPENSSL_NO_ASM |
| 9 | #endif |
Robert Sloan | 726e9d1 | 2018-09-11 11:45:04 -0700 | [diff] [blame] | 10 | |
| 11 | #if !defined(OPENSSL_NO_ASM) |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 12 | #if defined(__aarch64__) |
Robert Sloan | 726e9d1 | 2018-09-11 11:45:04 -0700 | [diff] [blame] | 13 | #if defined(BORINGSSL_PREFIX) |
| 14 | #include <boringssl_prefix_symbols_asm.h> |
| 15 | #endif |
Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 16 | // Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. |
| 17 | // |
| 18 | // Licensed under the OpenSSL license (the "License"). You may not use |
| 19 | // this file except in compliance with the License. You can obtain a copy |
| 20 | // in the file LICENSE in the source distribution or at |
| 21 | // https://www.openssl.org/source/license.html |
| 22 | |
| 23 | // ==================================================================== |
| 24 | // Written by Andy Polyakov <appro@openssl.org> for the OpenSSL |
| 25 | // project. The module is, however, dual licensed under OpenSSL and |
| 26 | // CRYPTOGAMS licenses depending on where you obtain it. For further |
| 27 | // details see http://www.openssl.org/~appro/cryptogams/. |
| 28 | // |
| 29 | // Permission to use under GPLv2 terms is granted. |
| 30 | // ==================================================================== |
| 31 | // |
| 32 | // SHA256/512 for ARMv8. |
| 33 | // |
| 34 | // Performance in cycles per processed byte and improvement coefficient |
| 35 | // over code generated with "default" compiler: |
| 36 | // |
| 37 | // SHA256-hw SHA256(*) SHA512 |
| 38 | // Apple A7 1.97 10.5 (+33%) 6.73 (-1%(**)) |
| 39 | // Cortex-A53 2.38 15.5 (+115%) 10.0 (+150%(***)) |
| 40 | // Cortex-A57 2.31 11.6 (+86%) 7.51 (+260%(***)) |
| 41 | // Denver 2.01 10.5 (+26%) 6.70 (+8%) |
| 42 | // X-Gene 20.0 (+100%) 12.8 (+300%(***)) |
| 43 | // Mongoose 2.36 13.0 (+50%) 8.36 (+33%) |
| 44 | // |
| 45 | // (*) Software SHA256 results are of lesser relevance, presented |
| 46 | // mostly for informational purposes. |
| 47 | // (**) The result is a trade-off: it's possible to improve it by |
| 48 | // 10% (or by 1 cycle per round), but at the cost of 20% loss |
| 49 | // on Cortex-A53 (or by 4 cycles per round). |
| 50 | // (***) Super-impressive coefficients over gcc-generated code are |
| 51 | // indication of some compiler "pathology", most notably code |
| 52 | // generated with -mgeneral-regs-only is significanty faster |
| 53 | // and the gap is only 40-90%. |
| 54 | |
| 55 | #ifndef __KERNEL__ |
| 56 | # include <openssl/arm_arch.h> |
| 57 | #endif |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 58 | |
| 59 | .text |
| 60 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 61 | |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 62 | .globl sha256_block_data_order |
David Benjamin | 4969cc9 | 2016-04-22 15:02:23 -0400 | [diff] [blame] | 63 | .hidden sha256_block_data_order |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 64 | .type sha256_block_data_order,%function |
| 65 | .align 6 |
| 66 | sha256_block_data_order: |
Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 67 | #ifndef __KERNEL__ |
Pete Bentley | 0c61efe | 2019-08-13 09:32:23 +0100 | [diff] [blame^] | 68 | #if __has_feature(hwaddress_sanitizer) && __clang_major__ >= 10 |
| 69 | adrp x16,:pg_hi21_nc:OPENSSL_armcap_P |
| 70 | #else |
Robert Sloan | c9abfe4 | 2018-11-26 12:19:07 -0800 | [diff] [blame] | 71 | adrp x16,OPENSSL_armcap_P |
Pete Bentley | 0c61efe | 2019-08-13 09:32:23 +0100 | [diff] [blame^] | 72 | #endif |
| 73 | ldr w16,[x16,:lo12:OPENSSL_armcap_P] |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 74 | tst w16,#ARMV8_SHA256 |
| 75 | b.ne .Lv8_entry |
Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 76 | #endif |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 77 | stp x29,x30,[sp,#-128]! |
| 78 | add x29,sp,#0 |
| 79 | |
| 80 | stp x19,x20,[sp,#16] |
| 81 | stp x21,x22,[sp,#32] |
| 82 | stp x23,x24,[sp,#48] |
| 83 | stp x25,x26,[sp,#64] |
| 84 | stp x27,x28,[sp,#80] |
| 85 | sub sp,sp,#4*4 |
| 86 | |
| 87 | ldp w20,w21,[x0] // load context |
| 88 | ldp w22,w23,[x0,#2*4] |
| 89 | ldp w24,w25,[x0,#4*4] |
| 90 | add x2,x1,x2,lsl#6 // end of input |
| 91 | ldp w26,w27,[x0,#6*4] |
Robert Sloan | c9abfe4 | 2018-11-26 12:19:07 -0800 | [diff] [blame] | 92 | adrp x30,.LK256 |
| 93 | add x30,x30,:lo12:.LK256 |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 94 | stp x0,x2,[x29,#96] |
| 95 | |
| 96 | .Loop: |
| 97 | ldp w3,w4,[x1],#2*4 |
| 98 | ldr w19,[x30],#4 // *K++ |
| 99 | eor w28,w21,w22 // magic seed |
| 100 | str x1,[x29,#112] |
| 101 | #ifndef __ARMEB__ |
| 102 | rev w3,w3 // 0 |
| 103 | #endif |
| 104 | ror w16,w24,#6 |
| 105 | add w27,w27,w19 // h+=K[i] |
| 106 | eor w6,w24,w24,ror#14 |
| 107 | and w17,w25,w24 |
| 108 | bic w19,w26,w24 |
| 109 | add w27,w27,w3 // h+=X[i] |
| 110 | orr w17,w17,w19 // Ch(e,f,g) |
| 111 | eor w19,w20,w21 // a^b, b^c in next round |
| 112 | eor w16,w16,w6,ror#11 // Sigma1(e) |
| 113 | ror w6,w20,#2 |
| 114 | add w27,w27,w17 // h+=Ch(e,f,g) |
| 115 | eor w17,w20,w20,ror#9 |
| 116 | add w27,w27,w16 // h+=Sigma1(e) |
| 117 | and w28,w28,w19 // (b^c)&=(a^b) |
| 118 | add w23,w23,w27 // d+=h |
| 119 | eor w28,w28,w21 // Maj(a,b,c) |
| 120 | eor w17,w6,w17,ror#13 // Sigma0(a) |
| 121 | add w27,w27,w28 // h+=Maj(a,b,c) |
| 122 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 123 | //add w27,w27,w17 // h+=Sigma0(a) |
| 124 | #ifndef __ARMEB__ |
| 125 | rev w4,w4 // 1 |
| 126 | #endif |
| 127 | ldp w5,w6,[x1],#2*4 |
| 128 | add w27,w27,w17 // h+=Sigma0(a) |
| 129 | ror w16,w23,#6 |
| 130 | add w26,w26,w28 // h+=K[i] |
| 131 | eor w7,w23,w23,ror#14 |
| 132 | and w17,w24,w23 |
| 133 | bic w28,w25,w23 |
| 134 | add w26,w26,w4 // h+=X[i] |
| 135 | orr w17,w17,w28 // Ch(e,f,g) |
| 136 | eor w28,w27,w20 // a^b, b^c in next round |
| 137 | eor w16,w16,w7,ror#11 // Sigma1(e) |
| 138 | ror w7,w27,#2 |
| 139 | add w26,w26,w17 // h+=Ch(e,f,g) |
| 140 | eor w17,w27,w27,ror#9 |
| 141 | add w26,w26,w16 // h+=Sigma1(e) |
| 142 | and w19,w19,w28 // (b^c)&=(a^b) |
| 143 | add w22,w22,w26 // d+=h |
| 144 | eor w19,w19,w20 // Maj(a,b,c) |
| 145 | eor w17,w7,w17,ror#13 // Sigma0(a) |
| 146 | add w26,w26,w19 // h+=Maj(a,b,c) |
| 147 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 148 | //add w26,w26,w17 // h+=Sigma0(a) |
| 149 | #ifndef __ARMEB__ |
| 150 | rev w5,w5 // 2 |
| 151 | #endif |
| 152 | add w26,w26,w17 // h+=Sigma0(a) |
| 153 | ror w16,w22,#6 |
| 154 | add w25,w25,w19 // h+=K[i] |
| 155 | eor w8,w22,w22,ror#14 |
| 156 | and w17,w23,w22 |
| 157 | bic w19,w24,w22 |
| 158 | add w25,w25,w5 // h+=X[i] |
| 159 | orr w17,w17,w19 // Ch(e,f,g) |
| 160 | eor w19,w26,w27 // a^b, b^c in next round |
| 161 | eor w16,w16,w8,ror#11 // Sigma1(e) |
| 162 | ror w8,w26,#2 |
| 163 | add w25,w25,w17 // h+=Ch(e,f,g) |
| 164 | eor w17,w26,w26,ror#9 |
| 165 | add w25,w25,w16 // h+=Sigma1(e) |
| 166 | and w28,w28,w19 // (b^c)&=(a^b) |
| 167 | add w21,w21,w25 // d+=h |
| 168 | eor w28,w28,w27 // Maj(a,b,c) |
| 169 | eor w17,w8,w17,ror#13 // Sigma0(a) |
| 170 | add w25,w25,w28 // h+=Maj(a,b,c) |
| 171 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 172 | //add w25,w25,w17 // h+=Sigma0(a) |
| 173 | #ifndef __ARMEB__ |
| 174 | rev w6,w6 // 3 |
| 175 | #endif |
| 176 | ldp w7,w8,[x1],#2*4 |
| 177 | add w25,w25,w17 // h+=Sigma0(a) |
| 178 | ror w16,w21,#6 |
| 179 | add w24,w24,w28 // h+=K[i] |
| 180 | eor w9,w21,w21,ror#14 |
| 181 | and w17,w22,w21 |
| 182 | bic w28,w23,w21 |
| 183 | add w24,w24,w6 // h+=X[i] |
| 184 | orr w17,w17,w28 // Ch(e,f,g) |
| 185 | eor w28,w25,w26 // a^b, b^c in next round |
| 186 | eor w16,w16,w9,ror#11 // Sigma1(e) |
| 187 | ror w9,w25,#2 |
| 188 | add w24,w24,w17 // h+=Ch(e,f,g) |
| 189 | eor w17,w25,w25,ror#9 |
| 190 | add w24,w24,w16 // h+=Sigma1(e) |
| 191 | and w19,w19,w28 // (b^c)&=(a^b) |
| 192 | add w20,w20,w24 // d+=h |
| 193 | eor w19,w19,w26 // Maj(a,b,c) |
| 194 | eor w17,w9,w17,ror#13 // Sigma0(a) |
| 195 | add w24,w24,w19 // h+=Maj(a,b,c) |
| 196 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 197 | //add w24,w24,w17 // h+=Sigma0(a) |
| 198 | #ifndef __ARMEB__ |
| 199 | rev w7,w7 // 4 |
| 200 | #endif |
| 201 | add w24,w24,w17 // h+=Sigma0(a) |
| 202 | ror w16,w20,#6 |
| 203 | add w23,w23,w19 // h+=K[i] |
| 204 | eor w10,w20,w20,ror#14 |
| 205 | and w17,w21,w20 |
| 206 | bic w19,w22,w20 |
| 207 | add w23,w23,w7 // h+=X[i] |
| 208 | orr w17,w17,w19 // Ch(e,f,g) |
| 209 | eor w19,w24,w25 // a^b, b^c in next round |
| 210 | eor w16,w16,w10,ror#11 // Sigma1(e) |
| 211 | ror w10,w24,#2 |
| 212 | add w23,w23,w17 // h+=Ch(e,f,g) |
| 213 | eor w17,w24,w24,ror#9 |
| 214 | add w23,w23,w16 // h+=Sigma1(e) |
| 215 | and w28,w28,w19 // (b^c)&=(a^b) |
| 216 | add w27,w27,w23 // d+=h |
| 217 | eor w28,w28,w25 // Maj(a,b,c) |
| 218 | eor w17,w10,w17,ror#13 // Sigma0(a) |
| 219 | add w23,w23,w28 // h+=Maj(a,b,c) |
| 220 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 221 | //add w23,w23,w17 // h+=Sigma0(a) |
| 222 | #ifndef __ARMEB__ |
| 223 | rev w8,w8 // 5 |
| 224 | #endif |
| 225 | ldp w9,w10,[x1],#2*4 |
| 226 | add w23,w23,w17 // h+=Sigma0(a) |
| 227 | ror w16,w27,#6 |
| 228 | add w22,w22,w28 // h+=K[i] |
| 229 | eor w11,w27,w27,ror#14 |
| 230 | and w17,w20,w27 |
| 231 | bic w28,w21,w27 |
| 232 | add w22,w22,w8 // h+=X[i] |
| 233 | orr w17,w17,w28 // Ch(e,f,g) |
| 234 | eor w28,w23,w24 // a^b, b^c in next round |
| 235 | eor w16,w16,w11,ror#11 // Sigma1(e) |
| 236 | ror w11,w23,#2 |
| 237 | add w22,w22,w17 // h+=Ch(e,f,g) |
| 238 | eor w17,w23,w23,ror#9 |
| 239 | add w22,w22,w16 // h+=Sigma1(e) |
| 240 | and w19,w19,w28 // (b^c)&=(a^b) |
| 241 | add w26,w26,w22 // d+=h |
| 242 | eor w19,w19,w24 // Maj(a,b,c) |
| 243 | eor w17,w11,w17,ror#13 // Sigma0(a) |
| 244 | add w22,w22,w19 // h+=Maj(a,b,c) |
| 245 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 246 | //add w22,w22,w17 // h+=Sigma0(a) |
| 247 | #ifndef __ARMEB__ |
| 248 | rev w9,w9 // 6 |
| 249 | #endif |
| 250 | add w22,w22,w17 // h+=Sigma0(a) |
| 251 | ror w16,w26,#6 |
| 252 | add w21,w21,w19 // h+=K[i] |
| 253 | eor w12,w26,w26,ror#14 |
| 254 | and w17,w27,w26 |
| 255 | bic w19,w20,w26 |
| 256 | add w21,w21,w9 // h+=X[i] |
| 257 | orr w17,w17,w19 // Ch(e,f,g) |
| 258 | eor w19,w22,w23 // a^b, b^c in next round |
| 259 | eor w16,w16,w12,ror#11 // Sigma1(e) |
| 260 | ror w12,w22,#2 |
| 261 | add w21,w21,w17 // h+=Ch(e,f,g) |
| 262 | eor w17,w22,w22,ror#9 |
| 263 | add w21,w21,w16 // h+=Sigma1(e) |
| 264 | and w28,w28,w19 // (b^c)&=(a^b) |
| 265 | add w25,w25,w21 // d+=h |
| 266 | eor w28,w28,w23 // Maj(a,b,c) |
| 267 | eor w17,w12,w17,ror#13 // Sigma0(a) |
| 268 | add w21,w21,w28 // h+=Maj(a,b,c) |
| 269 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 270 | //add w21,w21,w17 // h+=Sigma0(a) |
| 271 | #ifndef __ARMEB__ |
| 272 | rev w10,w10 // 7 |
| 273 | #endif |
| 274 | ldp w11,w12,[x1],#2*4 |
| 275 | add w21,w21,w17 // h+=Sigma0(a) |
| 276 | ror w16,w25,#6 |
| 277 | add w20,w20,w28 // h+=K[i] |
| 278 | eor w13,w25,w25,ror#14 |
| 279 | and w17,w26,w25 |
| 280 | bic w28,w27,w25 |
| 281 | add w20,w20,w10 // h+=X[i] |
| 282 | orr w17,w17,w28 // Ch(e,f,g) |
| 283 | eor w28,w21,w22 // a^b, b^c in next round |
| 284 | eor w16,w16,w13,ror#11 // Sigma1(e) |
| 285 | ror w13,w21,#2 |
| 286 | add w20,w20,w17 // h+=Ch(e,f,g) |
| 287 | eor w17,w21,w21,ror#9 |
| 288 | add w20,w20,w16 // h+=Sigma1(e) |
| 289 | and w19,w19,w28 // (b^c)&=(a^b) |
| 290 | add w24,w24,w20 // d+=h |
| 291 | eor w19,w19,w22 // Maj(a,b,c) |
| 292 | eor w17,w13,w17,ror#13 // Sigma0(a) |
| 293 | add w20,w20,w19 // h+=Maj(a,b,c) |
| 294 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 295 | //add w20,w20,w17 // h+=Sigma0(a) |
| 296 | #ifndef __ARMEB__ |
| 297 | rev w11,w11 // 8 |
| 298 | #endif |
| 299 | add w20,w20,w17 // h+=Sigma0(a) |
| 300 | ror w16,w24,#6 |
| 301 | add w27,w27,w19 // h+=K[i] |
| 302 | eor w14,w24,w24,ror#14 |
| 303 | and w17,w25,w24 |
| 304 | bic w19,w26,w24 |
| 305 | add w27,w27,w11 // h+=X[i] |
| 306 | orr w17,w17,w19 // Ch(e,f,g) |
| 307 | eor w19,w20,w21 // a^b, b^c in next round |
| 308 | eor w16,w16,w14,ror#11 // Sigma1(e) |
| 309 | ror w14,w20,#2 |
| 310 | add w27,w27,w17 // h+=Ch(e,f,g) |
| 311 | eor w17,w20,w20,ror#9 |
| 312 | add w27,w27,w16 // h+=Sigma1(e) |
| 313 | and w28,w28,w19 // (b^c)&=(a^b) |
| 314 | add w23,w23,w27 // d+=h |
| 315 | eor w28,w28,w21 // Maj(a,b,c) |
| 316 | eor w17,w14,w17,ror#13 // Sigma0(a) |
| 317 | add w27,w27,w28 // h+=Maj(a,b,c) |
| 318 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 319 | //add w27,w27,w17 // h+=Sigma0(a) |
| 320 | #ifndef __ARMEB__ |
| 321 | rev w12,w12 // 9 |
| 322 | #endif |
| 323 | ldp w13,w14,[x1],#2*4 |
| 324 | add w27,w27,w17 // h+=Sigma0(a) |
| 325 | ror w16,w23,#6 |
| 326 | add w26,w26,w28 // h+=K[i] |
| 327 | eor w15,w23,w23,ror#14 |
| 328 | and w17,w24,w23 |
| 329 | bic w28,w25,w23 |
| 330 | add w26,w26,w12 // h+=X[i] |
| 331 | orr w17,w17,w28 // Ch(e,f,g) |
| 332 | eor w28,w27,w20 // a^b, b^c in next round |
| 333 | eor w16,w16,w15,ror#11 // Sigma1(e) |
| 334 | ror w15,w27,#2 |
| 335 | add w26,w26,w17 // h+=Ch(e,f,g) |
| 336 | eor w17,w27,w27,ror#9 |
| 337 | add w26,w26,w16 // h+=Sigma1(e) |
| 338 | and w19,w19,w28 // (b^c)&=(a^b) |
| 339 | add w22,w22,w26 // d+=h |
| 340 | eor w19,w19,w20 // Maj(a,b,c) |
| 341 | eor w17,w15,w17,ror#13 // Sigma0(a) |
| 342 | add w26,w26,w19 // h+=Maj(a,b,c) |
| 343 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 344 | //add w26,w26,w17 // h+=Sigma0(a) |
| 345 | #ifndef __ARMEB__ |
| 346 | rev w13,w13 // 10 |
| 347 | #endif |
| 348 | add w26,w26,w17 // h+=Sigma0(a) |
| 349 | ror w16,w22,#6 |
| 350 | add w25,w25,w19 // h+=K[i] |
| 351 | eor w0,w22,w22,ror#14 |
| 352 | and w17,w23,w22 |
| 353 | bic w19,w24,w22 |
| 354 | add w25,w25,w13 // h+=X[i] |
| 355 | orr w17,w17,w19 // Ch(e,f,g) |
| 356 | eor w19,w26,w27 // a^b, b^c in next round |
| 357 | eor w16,w16,w0,ror#11 // Sigma1(e) |
| 358 | ror w0,w26,#2 |
| 359 | add w25,w25,w17 // h+=Ch(e,f,g) |
| 360 | eor w17,w26,w26,ror#9 |
| 361 | add w25,w25,w16 // h+=Sigma1(e) |
| 362 | and w28,w28,w19 // (b^c)&=(a^b) |
| 363 | add w21,w21,w25 // d+=h |
| 364 | eor w28,w28,w27 // Maj(a,b,c) |
| 365 | eor w17,w0,w17,ror#13 // Sigma0(a) |
| 366 | add w25,w25,w28 // h+=Maj(a,b,c) |
| 367 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 368 | //add w25,w25,w17 // h+=Sigma0(a) |
| 369 | #ifndef __ARMEB__ |
| 370 | rev w14,w14 // 11 |
| 371 | #endif |
| 372 | ldp w15,w0,[x1],#2*4 |
| 373 | add w25,w25,w17 // h+=Sigma0(a) |
| 374 | str w6,[sp,#12] |
| 375 | ror w16,w21,#6 |
| 376 | add w24,w24,w28 // h+=K[i] |
| 377 | eor w6,w21,w21,ror#14 |
| 378 | and w17,w22,w21 |
| 379 | bic w28,w23,w21 |
| 380 | add w24,w24,w14 // h+=X[i] |
| 381 | orr w17,w17,w28 // Ch(e,f,g) |
| 382 | eor w28,w25,w26 // a^b, b^c in next round |
| 383 | eor w16,w16,w6,ror#11 // Sigma1(e) |
| 384 | ror w6,w25,#2 |
| 385 | add w24,w24,w17 // h+=Ch(e,f,g) |
| 386 | eor w17,w25,w25,ror#9 |
| 387 | add w24,w24,w16 // h+=Sigma1(e) |
| 388 | and w19,w19,w28 // (b^c)&=(a^b) |
| 389 | add w20,w20,w24 // d+=h |
| 390 | eor w19,w19,w26 // Maj(a,b,c) |
| 391 | eor w17,w6,w17,ror#13 // Sigma0(a) |
| 392 | add w24,w24,w19 // h+=Maj(a,b,c) |
| 393 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 394 | //add w24,w24,w17 // h+=Sigma0(a) |
| 395 | #ifndef __ARMEB__ |
| 396 | rev w15,w15 // 12 |
| 397 | #endif |
| 398 | add w24,w24,w17 // h+=Sigma0(a) |
| 399 | str w7,[sp,#0] |
| 400 | ror w16,w20,#6 |
| 401 | add w23,w23,w19 // h+=K[i] |
| 402 | eor w7,w20,w20,ror#14 |
| 403 | and w17,w21,w20 |
| 404 | bic w19,w22,w20 |
| 405 | add w23,w23,w15 // h+=X[i] |
| 406 | orr w17,w17,w19 // Ch(e,f,g) |
| 407 | eor w19,w24,w25 // a^b, b^c in next round |
| 408 | eor w16,w16,w7,ror#11 // Sigma1(e) |
| 409 | ror w7,w24,#2 |
| 410 | add w23,w23,w17 // h+=Ch(e,f,g) |
| 411 | eor w17,w24,w24,ror#9 |
| 412 | add w23,w23,w16 // h+=Sigma1(e) |
| 413 | and w28,w28,w19 // (b^c)&=(a^b) |
| 414 | add w27,w27,w23 // d+=h |
| 415 | eor w28,w28,w25 // Maj(a,b,c) |
| 416 | eor w17,w7,w17,ror#13 // Sigma0(a) |
| 417 | add w23,w23,w28 // h+=Maj(a,b,c) |
| 418 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 419 | //add w23,w23,w17 // h+=Sigma0(a) |
| 420 | #ifndef __ARMEB__ |
| 421 | rev w0,w0 // 13 |
| 422 | #endif |
| 423 | ldp w1,w2,[x1] |
| 424 | add w23,w23,w17 // h+=Sigma0(a) |
| 425 | str w8,[sp,#4] |
| 426 | ror w16,w27,#6 |
| 427 | add w22,w22,w28 // h+=K[i] |
| 428 | eor w8,w27,w27,ror#14 |
| 429 | and w17,w20,w27 |
| 430 | bic w28,w21,w27 |
| 431 | add w22,w22,w0 // h+=X[i] |
| 432 | orr w17,w17,w28 // Ch(e,f,g) |
| 433 | eor w28,w23,w24 // a^b, b^c in next round |
| 434 | eor w16,w16,w8,ror#11 // Sigma1(e) |
| 435 | ror w8,w23,#2 |
| 436 | add w22,w22,w17 // h+=Ch(e,f,g) |
| 437 | eor w17,w23,w23,ror#9 |
| 438 | add w22,w22,w16 // h+=Sigma1(e) |
| 439 | and w19,w19,w28 // (b^c)&=(a^b) |
| 440 | add w26,w26,w22 // d+=h |
| 441 | eor w19,w19,w24 // Maj(a,b,c) |
| 442 | eor w17,w8,w17,ror#13 // Sigma0(a) |
| 443 | add w22,w22,w19 // h+=Maj(a,b,c) |
| 444 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 445 | //add w22,w22,w17 // h+=Sigma0(a) |
| 446 | #ifndef __ARMEB__ |
| 447 | rev w1,w1 // 14 |
| 448 | #endif |
| 449 | ldr w6,[sp,#12] |
| 450 | add w22,w22,w17 // h+=Sigma0(a) |
| 451 | str w9,[sp,#8] |
| 452 | ror w16,w26,#6 |
| 453 | add w21,w21,w19 // h+=K[i] |
| 454 | eor w9,w26,w26,ror#14 |
| 455 | and w17,w27,w26 |
| 456 | bic w19,w20,w26 |
| 457 | add w21,w21,w1 // h+=X[i] |
| 458 | orr w17,w17,w19 // Ch(e,f,g) |
| 459 | eor w19,w22,w23 // a^b, b^c in next round |
| 460 | eor w16,w16,w9,ror#11 // Sigma1(e) |
| 461 | ror w9,w22,#2 |
| 462 | add w21,w21,w17 // h+=Ch(e,f,g) |
| 463 | eor w17,w22,w22,ror#9 |
| 464 | add w21,w21,w16 // h+=Sigma1(e) |
| 465 | and w28,w28,w19 // (b^c)&=(a^b) |
| 466 | add w25,w25,w21 // d+=h |
| 467 | eor w28,w28,w23 // Maj(a,b,c) |
| 468 | eor w17,w9,w17,ror#13 // Sigma0(a) |
| 469 | add w21,w21,w28 // h+=Maj(a,b,c) |
| 470 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 471 | //add w21,w21,w17 // h+=Sigma0(a) |
| 472 | #ifndef __ARMEB__ |
| 473 | rev w2,w2 // 15 |
| 474 | #endif |
| 475 | ldr w7,[sp,#0] |
| 476 | add w21,w21,w17 // h+=Sigma0(a) |
| 477 | str w10,[sp,#12] |
| 478 | ror w16,w25,#6 |
| 479 | add w20,w20,w28 // h+=K[i] |
| 480 | ror w9,w4,#7 |
| 481 | and w17,w26,w25 |
| 482 | ror w8,w1,#17 |
| 483 | bic w28,w27,w25 |
| 484 | ror w10,w21,#2 |
| 485 | add w20,w20,w2 // h+=X[i] |
| 486 | eor w16,w16,w25,ror#11 |
| 487 | eor w9,w9,w4,ror#18 |
| 488 | orr w17,w17,w28 // Ch(e,f,g) |
| 489 | eor w28,w21,w22 // a^b, b^c in next round |
| 490 | eor w16,w16,w25,ror#25 // Sigma1(e) |
| 491 | eor w10,w10,w21,ror#13 |
| 492 | add w20,w20,w17 // h+=Ch(e,f,g) |
| 493 | and w19,w19,w28 // (b^c)&=(a^b) |
| 494 | eor w8,w8,w1,ror#19 |
| 495 | eor w9,w9,w4,lsr#3 // sigma0(X[i+1]) |
| 496 | add w20,w20,w16 // h+=Sigma1(e) |
| 497 | eor w19,w19,w22 // Maj(a,b,c) |
| 498 | eor w17,w10,w21,ror#22 // Sigma0(a) |
| 499 | eor w8,w8,w1,lsr#10 // sigma1(X[i+14]) |
| 500 | add w3,w3,w12 |
| 501 | add w24,w24,w20 // d+=h |
| 502 | add w20,w20,w19 // h+=Maj(a,b,c) |
| 503 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 504 | add w3,w3,w9 |
| 505 | add w20,w20,w17 // h+=Sigma0(a) |
| 506 | add w3,w3,w8 |
| 507 | .Loop_16_xx: |
| 508 | ldr w8,[sp,#4] |
| 509 | str w11,[sp,#0] |
| 510 | ror w16,w24,#6 |
| 511 | add w27,w27,w19 // h+=K[i] |
| 512 | ror w10,w5,#7 |
| 513 | and w17,w25,w24 |
| 514 | ror w9,w2,#17 |
| 515 | bic w19,w26,w24 |
| 516 | ror w11,w20,#2 |
| 517 | add w27,w27,w3 // h+=X[i] |
| 518 | eor w16,w16,w24,ror#11 |
| 519 | eor w10,w10,w5,ror#18 |
| 520 | orr w17,w17,w19 // Ch(e,f,g) |
| 521 | eor w19,w20,w21 // a^b, b^c in next round |
| 522 | eor w16,w16,w24,ror#25 // Sigma1(e) |
| 523 | eor w11,w11,w20,ror#13 |
| 524 | add w27,w27,w17 // h+=Ch(e,f,g) |
| 525 | and w28,w28,w19 // (b^c)&=(a^b) |
| 526 | eor w9,w9,w2,ror#19 |
| 527 | eor w10,w10,w5,lsr#3 // sigma0(X[i+1]) |
| 528 | add w27,w27,w16 // h+=Sigma1(e) |
| 529 | eor w28,w28,w21 // Maj(a,b,c) |
| 530 | eor w17,w11,w20,ror#22 // Sigma0(a) |
| 531 | eor w9,w9,w2,lsr#10 // sigma1(X[i+14]) |
| 532 | add w4,w4,w13 |
| 533 | add w23,w23,w27 // d+=h |
| 534 | add w27,w27,w28 // h+=Maj(a,b,c) |
| 535 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 536 | add w4,w4,w10 |
| 537 | add w27,w27,w17 // h+=Sigma0(a) |
| 538 | add w4,w4,w9 |
| 539 | ldr w9,[sp,#8] |
| 540 | str w12,[sp,#4] |
| 541 | ror w16,w23,#6 |
| 542 | add w26,w26,w28 // h+=K[i] |
| 543 | ror w11,w6,#7 |
| 544 | and w17,w24,w23 |
| 545 | ror w10,w3,#17 |
| 546 | bic w28,w25,w23 |
| 547 | ror w12,w27,#2 |
| 548 | add w26,w26,w4 // h+=X[i] |
| 549 | eor w16,w16,w23,ror#11 |
| 550 | eor w11,w11,w6,ror#18 |
| 551 | orr w17,w17,w28 // Ch(e,f,g) |
| 552 | eor w28,w27,w20 // a^b, b^c in next round |
| 553 | eor w16,w16,w23,ror#25 // Sigma1(e) |
| 554 | eor w12,w12,w27,ror#13 |
| 555 | add w26,w26,w17 // h+=Ch(e,f,g) |
| 556 | and w19,w19,w28 // (b^c)&=(a^b) |
| 557 | eor w10,w10,w3,ror#19 |
| 558 | eor w11,w11,w6,lsr#3 // sigma0(X[i+1]) |
| 559 | add w26,w26,w16 // h+=Sigma1(e) |
| 560 | eor w19,w19,w20 // Maj(a,b,c) |
| 561 | eor w17,w12,w27,ror#22 // Sigma0(a) |
| 562 | eor w10,w10,w3,lsr#10 // sigma1(X[i+14]) |
| 563 | add w5,w5,w14 |
| 564 | add w22,w22,w26 // d+=h |
| 565 | add w26,w26,w19 // h+=Maj(a,b,c) |
| 566 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 567 | add w5,w5,w11 |
| 568 | add w26,w26,w17 // h+=Sigma0(a) |
| 569 | add w5,w5,w10 |
| 570 | ldr w10,[sp,#12] |
| 571 | str w13,[sp,#8] |
| 572 | ror w16,w22,#6 |
| 573 | add w25,w25,w19 // h+=K[i] |
| 574 | ror w12,w7,#7 |
| 575 | and w17,w23,w22 |
| 576 | ror w11,w4,#17 |
| 577 | bic w19,w24,w22 |
| 578 | ror w13,w26,#2 |
| 579 | add w25,w25,w5 // h+=X[i] |
| 580 | eor w16,w16,w22,ror#11 |
| 581 | eor w12,w12,w7,ror#18 |
| 582 | orr w17,w17,w19 // Ch(e,f,g) |
| 583 | eor w19,w26,w27 // a^b, b^c in next round |
| 584 | eor w16,w16,w22,ror#25 // Sigma1(e) |
| 585 | eor w13,w13,w26,ror#13 |
| 586 | add w25,w25,w17 // h+=Ch(e,f,g) |
| 587 | and w28,w28,w19 // (b^c)&=(a^b) |
| 588 | eor w11,w11,w4,ror#19 |
| 589 | eor w12,w12,w7,lsr#3 // sigma0(X[i+1]) |
| 590 | add w25,w25,w16 // h+=Sigma1(e) |
| 591 | eor w28,w28,w27 // Maj(a,b,c) |
| 592 | eor w17,w13,w26,ror#22 // Sigma0(a) |
| 593 | eor w11,w11,w4,lsr#10 // sigma1(X[i+14]) |
| 594 | add w6,w6,w15 |
| 595 | add w21,w21,w25 // d+=h |
| 596 | add w25,w25,w28 // h+=Maj(a,b,c) |
| 597 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 598 | add w6,w6,w12 |
| 599 | add w25,w25,w17 // h+=Sigma0(a) |
| 600 | add w6,w6,w11 |
| 601 | ldr w11,[sp,#0] |
| 602 | str w14,[sp,#12] |
| 603 | ror w16,w21,#6 |
| 604 | add w24,w24,w28 // h+=K[i] |
| 605 | ror w13,w8,#7 |
| 606 | and w17,w22,w21 |
| 607 | ror w12,w5,#17 |
| 608 | bic w28,w23,w21 |
| 609 | ror w14,w25,#2 |
| 610 | add w24,w24,w6 // h+=X[i] |
| 611 | eor w16,w16,w21,ror#11 |
| 612 | eor w13,w13,w8,ror#18 |
| 613 | orr w17,w17,w28 // Ch(e,f,g) |
| 614 | eor w28,w25,w26 // a^b, b^c in next round |
| 615 | eor w16,w16,w21,ror#25 // Sigma1(e) |
| 616 | eor w14,w14,w25,ror#13 |
| 617 | add w24,w24,w17 // h+=Ch(e,f,g) |
| 618 | and w19,w19,w28 // (b^c)&=(a^b) |
| 619 | eor w12,w12,w5,ror#19 |
| 620 | eor w13,w13,w8,lsr#3 // sigma0(X[i+1]) |
| 621 | add w24,w24,w16 // h+=Sigma1(e) |
| 622 | eor w19,w19,w26 // Maj(a,b,c) |
| 623 | eor w17,w14,w25,ror#22 // Sigma0(a) |
| 624 | eor w12,w12,w5,lsr#10 // sigma1(X[i+14]) |
| 625 | add w7,w7,w0 |
| 626 | add w20,w20,w24 // d+=h |
| 627 | add w24,w24,w19 // h+=Maj(a,b,c) |
| 628 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 629 | add w7,w7,w13 |
| 630 | add w24,w24,w17 // h+=Sigma0(a) |
| 631 | add w7,w7,w12 |
| 632 | ldr w12,[sp,#4] |
| 633 | str w15,[sp,#0] |
| 634 | ror w16,w20,#6 |
| 635 | add w23,w23,w19 // h+=K[i] |
| 636 | ror w14,w9,#7 |
| 637 | and w17,w21,w20 |
| 638 | ror w13,w6,#17 |
| 639 | bic w19,w22,w20 |
| 640 | ror w15,w24,#2 |
| 641 | add w23,w23,w7 // h+=X[i] |
| 642 | eor w16,w16,w20,ror#11 |
| 643 | eor w14,w14,w9,ror#18 |
| 644 | orr w17,w17,w19 // Ch(e,f,g) |
| 645 | eor w19,w24,w25 // a^b, b^c in next round |
| 646 | eor w16,w16,w20,ror#25 // Sigma1(e) |
| 647 | eor w15,w15,w24,ror#13 |
| 648 | add w23,w23,w17 // h+=Ch(e,f,g) |
| 649 | and w28,w28,w19 // (b^c)&=(a^b) |
| 650 | eor w13,w13,w6,ror#19 |
| 651 | eor w14,w14,w9,lsr#3 // sigma0(X[i+1]) |
| 652 | add w23,w23,w16 // h+=Sigma1(e) |
| 653 | eor w28,w28,w25 // Maj(a,b,c) |
| 654 | eor w17,w15,w24,ror#22 // Sigma0(a) |
| 655 | eor w13,w13,w6,lsr#10 // sigma1(X[i+14]) |
| 656 | add w8,w8,w1 |
| 657 | add w27,w27,w23 // d+=h |
| 658 | add w23,w23,w28 // h+=Maj(a,b,c) |
| 659 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 660 | add w8,w8,w14 |
| 661 | add w23,w23,w17 // h+=Sigma0(a) |
| 662 | add w8,w8,w13 |
| 663 | ldr w13,[sp,#8] |
| 664 | str w0,[sp,#4] |
| 665 | ror w16,w27,#6 |
| 666 | add w22,w22,w28 // h+=K[i] |
| 667 | ror w15,w10,#7 |
| 668 | and w17,w20,w27 |
| 669 | ror w14,w7,#17 |
| 670 | bic w28,w21,w27 |
| 671 | ror w0,w23,#2 |
| 672 | add w22,w22,w8 // h+=X[i] |
| 673 | eor w16,w16,w27,ror#11 |
| 674 | eor w15,w15,w10,ror#18 |
| 675 | orr w17,w17,w28 // Ch(e,f,g) |
| 676 | eor w28,w23,w24 // a^b, b^c in next round |
| 677 | eor w16,w16,w27,ror#25 // Sigma1(e) |
| 678 | eor w0,w0,w23,ror#13 |
| 679 | add w22,w22,w17 // h+=Ch(e,f,g) |
| 680 | and w19,w19,w28 // (b^c)&=(a^b) |
| 681 | eor w14,w14,w7,ror#19 |
| 682 | eor w15,w15,w10,lsr#3 // sigma0(X[i+1]) |
| 683 | add w22,w22,w16 // h+=Sigma1(e) |
| 684 | eor w19,w19,w24 // Maj(a,b,c) |
| 685 | eor w17,w0,w23,ror#22 // Sigma0(a) |
| 686 | eor w14,w14,w7,lsr#10 // sigma1(X[i+14]) |
| 687 | add w9,w9,w2 |
| 688 | add w26,w26,w22 // d+=h |
| 689 | add w22,w22,w19 // h+=Maj(a,b,c) |
| 690 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 691 | add w9,w9,w15 |
| 692 | add w22,w22,w17 // h+=Sigma0(a) |
| 693 | add w9,w9,w14 |
| 694 | ldr w14,[sp,#12] |
| 695 | str w1,[sp,#8] |
| 696 | ror w16,w26,#6 |
| 697 | add w21,w21,w19 // h+=K[i] |
| 698 | ror w0,w11,#7 |
| 699 | and w17,w27,w26 |
| 700 | ror w15,w8,#17 |
| 701 | bic w19,w20,w26 |
| 702 | ror w1,w22,#2 |
| 703 | add w21,w21,w9 // h+=X[i] |
| 704 | eor w16,w16,w26,ror#11 |
| 705 | eor w0,w0,w11,ror#18 |
| 706 | orr w17,w17,w19 // Ch(e,f,g) |
| 707 | eor w19,w22,w23 // a^b, b^c in next round |
| 708 | eor w16,w16,w26,ror#25 // Sigma1(e) |
| 709 | eor w1,w1,w22,ror#13 |
| 710 | add w21,w21,w17 // h+=Ch(e,f,g) |
| 711 | and w28,w28,w19 // (b^c)&=(a^b) |
| 712 | eor w15,w15,w8,ror#19 |
| 713 | eor w0,w0,w11,lsr#3 // sigma0(X[i+1]) |
| 714 | add w21,w21,w16 // h+=Sigma1(e) |
| 715 | eor w28,w28,w23 // Maj(a,b,c) |
| 716 | eor w17,w1,w22,ror#22 // Sigma0(a) |
| 717 | eor w15,w15,w8,lsr#10 // sigma1(X[i+14]) |
| 718 | add w10,w10,w3 |
| 719 | add w25,w25,w21 // d+=h |
| 720 | add w21,w21,w28 // h+=Maj(a,b,c) |
| 721 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 722 | add w10,w10,w0 |
| 723 | add w21,w21,w17 // h+=Sigma0(a) |
| 724 | add w10,w10,w15 |
| 725 | ldr w15,[sp,#0] |
| 726 | str w2,[sp,#12] |
| 727 | ror w16,w25,#6 |
| 728 | add w20,w20,w28 // h+=K[i] |
| 729 | ror w1,w12,#7 |
| 730 | and w17,w26,w25 |
| 731 | ror w0,w9,#17 |
| 732 | bic w28,w27,w25 |
| 733 | ror w2,w21,#2 |
| 734 | add w20,w20,w10 // h+=X[i] |
| 735 | eor w16,w16,w25,ror#11 |
| 736 | eor w1,w1,w12,ror#18 |
| 737 | orr w17,w17,w28 // Ch(e,f,g) |
| 738 | eor w28,w21,w22 // a^b, b^c in next round |
| 739 | eor w16,w16,w25,ror#25 // Sigma1(e) |
| 740 | eor w2,w2,w21,ror#13 |
| 741 | add w20,w20,w17 // h+=Ch(e,f,g) |
| 742 | and w19,w19,w28 // (b^c)&=(a^b) |
| 743 | eor w0,w0,w9,ror#19 |
| 744 | eor w1,w1,w12,lsr#3 // sigma0(X[i+1]) |
| 745 | add w20,w20,w16 // h+=Sigma1(e) |
| 746 | eor w19,w19,w22 // Maj(a,b,c) |
| 747 | eor w17,w2,w21,ror#22 // Sigma0(a) |
| 748 | eor w0,w0,w9,lsr#10 // sigma1(X[i+14]) |
| 749 | add w11,w11,w4 |
| 750 | add w24,w24,w20 // d+=h |
| 751 | add w20,w20,w19 // h+=Maj(a,b,c) |
| 752 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 753 | add w11,w11,w1 |
| 754 | add w20,w20,w17 // h+=Sigma0(a) |
| 755 | add w11,w11,w0 |
| 756 | ldr w0,[sp,#4] |
| 757 | str w3,[sp,#0] |
| 758 | ror w16,w24,#6 |
| 759 | add w27,w27,w19 // h+=K[i] |
| 760 | ror w2,w13,#7 |
| 761 | and w17,w25,w24 |
| 762 | ror w1,w10,#17 |
| 763 | bic w19,w26,w24 |
| 764 | ror w3,w20,#2 |
| 765 | add w27,w27,w11 // h+=X[i] |
| 766 | eor w16,w16,w24,ror#11 |
| 767 | eor w2,w2,w13,ror#18 |
| 768 | orr w17,w17,w19 // Ch(e,f,g) |
| 769 | eor w19,w20,w21 // a^b, b^c in next round |
| 770 | eor w16,w16,w24,ror#25 // Sigma1(e) |
| 771 | eor w3,w3,w20,ror#13 |
| 772 | add w27,w27,w17 // h+=Ch(e,f,g) |
| 773 | and w28,w28,w19 // (b^c)&=(a^b) |
| 774 | eor w1,w1,w10,ror#19 |
| 775 | eor w2,w2,w13,lsr#3 // sigma0(X[i+1]) |
| 776 | add w27,w27,w16 // h+=Sigma1(e) |
| 777 | eor w28,w28,w21 // Maj(a,b,c) |
| 778 | eor w17,w3,w20,ror#22 // Sigma0(a) |
| 779 | eor w1,w1,w10,lsr#10 // sigma1(X[i+14]) |
| 780 | add w12,w12,w5 |
| 781 | add w23,w23,w27 // d+=h |
| 782 | add w27,w27,w28 // h+=Maj(a,b,c) |
| 783 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 784 | add w12,w12,w2 |
| 785 | add w27,w27,w17 // h+=Sigma0(a) |
| 786 | add w12,w12,w1 |
| 787 | ldr w1,[sp,#8] |
| 788 | str w4,[sp,#4] |
| 789 | ror w16,w23,#6 |
| 790 | add w26,w26,w28 // h+=K[i] |
| 791 | ror w3,w14,#7 |
| 792 | and w17,w24,w23 |
| 793 | ror w2,w11,#17 |
| 794 | bic w28,w25,w23 |
| 795 | ror w4,w27,#2 |
| 796 | add w26,w26,w12 // h+=X[i] |
| 797 | eor w16,w16,w23,ror#11 |
| 798 | eor w3,w3,w14,ror#18 |
| 799 | orr w17,w17,w28 // Ch(e,f,g) |
| 800 | eor w28,w27,w20 // a^b, b^c in next round |
| 801 | eor w16,w16,w23,ror#25 // Sigma1(e) |
| 802 | eor w4,w4,w27,ror#13 |
| 803 | add w26,w26,w17 // h+=Ch(e,f,g) |
| 804 | and w19,w19,w28 // (b^c)&=(a^b) |
| 805 | eor w2,w2,w11,ror#19 |
| 806 | eor w3,w3,w14,lsr#3 // sigma0(X[i+1]) |
| 807 | add w26,w26,w16 // h+=Sigma1(e) |
| 808 | eor w19,w19,w20 // Maj(a,b,c) |
| 809 | eor w17,w4,w27,ror#22 // Sigma0(a) |
| 810 | eor w2,w2,w11,lsr#10 // sigma1(X[i+14]) |
| 811 | add w13,w13,w6 |
| 812 | add w22,w22,w26 // d+=h |
| 813 | add w26,w26,w19 // h+=Maj(a,b,c) |
| 814 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 815 | add w13,w13,w3 |
| 816 | add w26,w26,w17 // h+=Sigma0(a) |
| 817 | add w13,w13,w2 |
| 818 | ldr w2,[sp,#12] |
| 819 | str w5,[sp,#8] |
| 820 | ror w16,w22,#6 |
| 821 | add w25,w25,w19 // h+=K[i] |
| 822 | ror w4,w15,#7 |
| 823 | and w17,w23,w22 |
| 824 | ror w3,w12,#17 |
| 825 | bic w19,w24,w22 |
| 826 | ror w5,w26,#2 |
| 827 | add w25,w25,w13 // h+=X[i] |
| 828 | eor w16,w16,w22,ror#11 |
| 829 | eor w4,w4,w15,ror#18 |
| 830 | orr w17,w17,w19 // Ch(e,f,g) |
| 831 | eor w19,w26,w27 // a^b, b^c in next round |
| 832 | eor w16,w16,w22,ror#25 // Sigma1(e) |
| 833 | eor w5,w5,w26,ror#13 |
| 834 | add w25,w25,w17 // h+=Ch(e,f,g) |
| 835 | and w28,w28,w19 // (b^c)&=(a^b) |
| 836 | eor w3,w3,w12,ror#19 |
| 837 | eor w4,w4,w15,lsr#3 // sigma0(X[i+1]) |
| 838 | add w25,w25,w16 // h+=Sigma1(e) |
| 839 | eor w28,w28,w27 // Maj(a,b,c) |
| 840 | eor w17,w5,w26,ror#22 // Sigma0(a) |
| 841 | eor w3,w3,w12,lsr#10 // sigma1(X[i+14]) |
| 842 | add w14,w14,w7 |
| 843 | add w21,w21,w25 // d+=h |
| 844 | add w25,w25,w28 // h+=Maj(a,b,c) |
| 845 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 846 | add w14,w14,w4 |
| 847 | add w25,w25,w17 // h+=Sigma0(a) |
| 848 | add w14,w14,w3 |
| 849 | ldr w3,[sp,#0] |
| 850 | str w6,[sp,#12] |
| 851 | ror w16,w21,#6 |
| 852 | add w24,w24,w28 // h+=K[i] |
| 853 | ror w5,w0,#7 |
| 854 | and w17,w22,w21 |
| 855 | ror w4,w13,#17 |
| 856 | bic w28,w23,w21 |
| 857 | ror w6,w25,#2 |
| 858 | add w24,w24,w14 // h+=X[i] |
| 859 | eor w16,w16,w21,ror#11 |
| 860 | eor w5,w5,w0,ror#18 |
| 861 | orr w17,w17,w28 // Ch(e,f,g) |
| 862 | eor w28,w25,w26 // a^b, b^c in next round |
| 863 | eor w16,w16,w21,ror#25 // Sigma1(e) |
| 864 | eor w6,w6,w25,ror#13 |
| 865 | add w24,w24,w17 // h+=Ch(e,f,g) |
| 866 | and w19,w19,w28 // (b^c)&=(a^b) |
| 867 | eor w4,w4,w13,ror#19 |
| 868 | eor w5,w5,w0,lsr#3 // sigma0(X[i+1]) |
| 869 | add w24,w24,w16 // h+=Sigma1(e) |
| 870 | eor w19,w19,w26 // Maj(a,b,c) |
| 871 | eor w17,w6,w25,ror#22 // Sigma0(a) |
| 872 | eor w4,w4,w13,lsr#10 // sigma1(X[i+14]) |
| 873 | add w15,w15,w8 |
| 874 | add w20,w20,w24 // d+=h |
| 875 | add w24,w24,w19 // h+=Maj(a,b,c) |
| 876 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 877 | add w15,w15,w5 |
| 878 | add w24,w24,w17 // h+=Sigma0(a) |
| 879 | add w15,w15,w4 |
| 880 | ldr w4,[sp,#4] |
| 881 | str w7,[sp,#0] |
| 882 | ror w16,w20,#6 |
| 883 | add w23,w23,w19 // h+=K[i] |
| 884 | ror w6,w1,#7 |
| 885 | and w17,w21,w20 |
| 886 | ror w5,w14,#17 |
| 887 | bic w19,w22,w20 |
| 888 | ror w7,w24,#2 |
| 889 | add w23,w23,w15 // h+=X[i] |
| 890 | eor w16,w16,w20,ror#11 |
| 891 | eor w6,w6,w1,ror#18 |
| 892 | orr w17,w17,w19 // Ch(e,f,g) |
| 893 | eor w19,w24,w25 // a^b, b^c in next round |
| 894 | eor w16,w16,w20,ror#25 // Sigma1(e) |
| 895 | eor w7,w7,w24,ror#13 |
| 896 | add w23,w23,w17 // h+=Ch(e,f,g) |
| 897 | and w28,w28,w19 // (b^c)&=(a^b) |
| 898 | eor w5,w5,w14,ror#19 |
| 899 | eor w6,w6,w1,lsr#3 // sigma0(X[i+1]) |
| 900 | add w23,w23,w16 // h+=Sigma1(e) |
| 901 | eor w28,w28,w25 // Maj(a,b,c) |
| 902 | eor w17,w7,w24,ror#22 // Sigma0(a) |
| 903 | eor w5,w5,w14,lsr#10 // sigma1(X[i+14]) |
| 904 | add w0,w0,w9 |
| 905 | add w27,w27,w23 // d+=h |
| 906 | add w23,w23,w28 // h+=Maj(a,b,c) |
| 907 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 908 | add w0,w0,w6 |
| 909 | add w23,w23,w17 // h+=Sigma0(a) |
| 910 | add w0,w0,w5 |
| 911 | ldr w5,[sp,#8] |
| 912 | str w8,[sp,#4] |
| 913 | ror w16,w27,#6 |
| 914 | add w22,w22,w28 // h+=K[i] |
| 915 | ror w7,w2,#7 |
| 916 | and w17,w20,w27 |
| 917 | ror w6,w15,#17 |
| 918 | bic w28,w21,w27 |
| 919 | ror w8,w23,#2 |
| 920 | add w22,w22,w0 // h+=X[i] |
| 921 | eor w16,w16,w27,ror#11 |
| 922 | eor w7,w7,w2,ror#18 |
| 923 | orr w17,w17,w28 // Ch(e,f,g) |
| 924 | eor w28,w23,w24 // a^b, b^c in next round |
| 925 | eor w16,w16,w27,ror#25 // Sigma1(e) |
| 926 | eor w8,w8,w23,ror#13 |
| 927 | add w22,w22,w17 // h+=Ch(e,f,g) |
| 928 | and w19,w19,w28 // (b^c)&=(a^b) |
| 929 | eor w6,w6,w15,ror#19 |
| 930 | eor w7,w7,w2,lsr#3 // sigma0(X[i+1]) |
| 931 | add w22,w22,w16 // h+=Sigma1(e) |
| 932 | eor w19,w19,w24 // Maj(a,b,c) |
| 933 | eor w17,w8,w23,ror#22 // Sigma0(a) |
| 934 | eor w6,w6,w15,lsr#10 // sigma1(X[i+14]) |
| 935 | add w1,w1,w10 |
| 936 | add w26,w26,w22 // d+=h |
| 937 | add w22,w22,w19 // h+=Maj(a,b,c) |
| 938 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 939 | add w1,w1,w7 |
| 940 | add w22,w22,w17 // h+=Sigma0(a) |
| 941 | add w1,w1,w6 |
| 942 | ldr w6,[sp,#12] |
| 943 | str w9,[sp,#8] |
| 944 | ror w16,w26,#6 |
| 945 | add w21,w21,w19 // h+=K[i] |
| 946 | ror w8,w3,#7 |
| 947 | and w17,w27,w26 |
| 948 | ror w7,w0,#17 |
| 949 | bic w19,w20,w26 |
| 950 | ror w9,w22,#2 |
| 951 | add w21,w21,w1 // h+=X[i] |
| 952 | eor w16,w16,w26,ror#11 |
| 953 | eor w8,w8,w3,ror#18 |
| 954 | orr w17,w17,w19 // Ch(e,f,g) |
| 955 | eor w19,w22,w23 // a^b, b^c in next round |
| 956 | eor w16,w16,w26,ror#25 // Sigma1(e) |
| 957 | eor w9,w9,w22,ror#13 |
| 958 | add w21,w21,w17 // h+=Ch(e,f,g) |
| 959 | and w28,w28,w19 // (b^c)&=(a^b) |
| 960 | eor w7,w7,w0,ror#19 |
| 961 | eor w8,w8,w3,lsr#3 // sigma0(X[i+1]) |
| 962 | add w21,w21,w16 // h+=Sigma1(e) |
| 963 | eor w28,w28,w23 // Maj(a,b,c) |
| 964 | eor w17,w9,w22,ror#22 // Sigma0(a) |
| 965 | eor w7,w7,w0,lsr#10 // sigma1(X[i+14]) |
| 966 | add w2,w2,w11 |
| 967 | add w25,w25,w21 // d+=h |
| 968 | add w21,w21,w28 // h+=Maj(a,b,c) |
| 969 | ldr w28,[x30],#4 // *K++, w19 in next round |
| 970 | add w2,w2,w8 |
| 971 | add w21,w21,w17 // h+=Sigma0(a) |
| 972 | add w2,w2,w7 |
| 973 | ldr w7,[sp,#0] |
| 974 | str w10,[sp,#12] |
| 975 | ror w16,w25,#6 |
| 976 | add w20,w20,w28 // h+=K[i] |
| 977 | ror w9,w4,#7 |
| 978 | and w17,w26,w25 |
| 979 | ror w8,w1,#17 |
| 980 | bic w28,w27,w25 |
| 981 | ror w10,w21,#2 |
| 982 | add w20,w20,w2 // h+=X[i] |
| 983 | eor w16,w16,w25,ror#11 |
| 984 | eor w9,w9,w4,ror#18 |
| 985 | orr w17,w17,w28 // Ch(e,f,g) |
| 986 | eor w28,w21,w22 // a^b, b^c in next round |
| 987 | eor w16,w16,w25,ror#25 // Sigma1(e) |
| 988 | eor w10,w10,w21,ror#13 |
| 989 | add w20,w20,w17 // h+=Ch(e,f,g) |
| 990 | and w19,w19,w28 // (b^c)&=(a^b) |
| 991 | eor w8,w8,w1,ror#19 |
| 992 | eor w9,w9,w4,lsr#3 // sigma0(X[i+1]) |
| 993 | add w20,w20,w16 // h+=Sigma1(e) |
| 994 | eor w19,w19,w22 // Maj(a,b,c) |
| 995 | eor w17,w10,w21,ror#22 // Sigma0(a) |
| 996 | eor w8,w8,w1,lsr#10 // sigma1(X[i+14]) |
| 997 | add w3,w3,w12 |
| 998 | add w24,w24,w20 // d+=h |
| 999 | add w20,w20,w19 // h+=Maj(a,b,c) |
| 1000 | ldr w19,[x30],#4 // *K++, w28 in next round |
| 1001 | add w3,w3,w9 |
| 1002 | add w20,w20,w17 // h+=Sigma0(a) |
| 1003 | add w3,w3,w8 |
| 1004 | cbnz w19,.Loop_16_xx |
| 1005 | |
| 1006 | ldp x0,x2,[x29,#96] |
| 1007 | ldr x1,[x29,#112] |
| 1008 | sub x30,x30,#260 // rewind |
| 1009 | |
| 1010 | ldp w3,w4,[x0] |
| 1011 | ldp w5,w6,[x0,#2*4] |
| 1012 | add x1,x1,#14*4 // advance input pointer |
| 1013 | ldp w7,w8,[x0,#4*4] |
| 1014 | add w20,w20,w3 |
| 1015 | ldp w9,w10,[x0,#6*4] |
| 1016 | add w21,w21,w4 |
| 1017 | add w22,w22,w5 |
| 1018 | add w23,w23,w6 |
| 1019 | stp w20,w21,[x0] |
| 1020 | add w24,w24,w7 |
| 1021 | add w25,w25,w8 |
| 1022 | stp w22,w23,[x0,#2*4] |
| 1023 | add w26,w26,w9 |
| 1024 | add w27,w27,w10 |
| 1025 | cmp x1,x2 |
| 1026 | stp w24,w25,[x0,#4*4] |
| 1027 | stp w26,w27,[x0,#6*4] |
| 1028 | b.ne .Loop |
| 1029 | |
| 1030 | ldp x19,x20,[x29,#16] |
| 1031 | add sp,sp,#4*4 |
| 1032 | ldp x21,x22,[x29,#32] |
| 1033 | ldp x23,x24,[x29,#48] |
| 1034 | ldp x25,x26,[x29,#64] |
| 1035 | ldp x27,x28,[x29,#80] |
| 1036 | ldp x29,x30,[sp],#128 |
| 1037 | ret |
| 1038 | .size sha256_block_data_order,.-sha256_block_data_order |
| 1039 | |
Robert Sloan | c9abfe4 | 2018-11-26 12:19:07 -0800 | [diff] [blame] | 1040 | .section .rodata |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1041 | .align 6 |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1042 | .type .LK256,%object |
| 1043 | .LK256: |
| 1044 | .long 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5 |
| 1045 | .long 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5 |
| 1046 | .long 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3 |
| 1047 | .long 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174 |
| 1048 | .long 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc |
| 1049 | .long 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da |
| 1050 | .long 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7 |
| 1051 | .long 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967 |
| 1052 | .long 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13 |
| 1053 | .long 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85 |
| 1054 | .long 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3 |
| 1055 | .long 0xd192e819,0xd6990624,0xf40e3585,0x106aa070 |
| 1056 | .long 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5 |
| 1057 | .long 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3 |
| 1058 | .long 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208 |
| 1059 | .long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 |
| 1060 | .long 0 //terminator |
| 1061 | .size .LK256,.-.LK256 |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1062 | .byte 83,72,65,50,53,54,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 |
| 1063 | .align 2 |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1064 | .align 2 |
Robert Sloan | c9abfe4 | 2018-11-26 12:19:07 -0800 | [diff] [blame] | 1065 | .text |
Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 1066 | #ifndef __KERNEL__ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1067 | .type sha256_block_armv8,%function |
| 1068 | .align 6 |
| 1069 | sha256_block_armv8: |
| 1070 | .Lv8_entry: |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1071 | stp x29,x30,[sp,#-16]! |
| 1072 | add x29,sp,#0 |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1073 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1074 | ld1 {v0.4s,v1.4s},[x0] |
Robert Sloan | c9abfe4 | 2018-11-26 12:19:07 -0800 | [diff] [blame] | 1075 | adrp x3,.LK256 |
| 1076 | add x3,x3,:lo12:.LK256 |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1077 | |
| 1078 | .Loop_hw: |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1079 | ld1 {v4.16b,v5.16b,v6.16b,v7.16b},[x1],#64 |
| 1080 | sub x2,x2,#1 |
| 1081 | ld1 {v16.4s},[x3],#16 |
| 1082 | rev32 v4.16b,v4.16b |
| 1083 | rev32 v5.16b,v5.16b |
| 1084 | rev32 v6.16b,v6.16b |
| 1085 | rev32 v7.16b,v7.16b |
| 1086 | orr v18.16b,v0.16b,v0.16b // offload |
| 1087 | orr v19.16b,v1.16b,v1.16b |
| 1088 | ld1 {v17.4s},[x3],#16 |
| 1089 | add v16.4s,v16.4s,v4.4s |
| 1090 | .inst 0x5e2828a4 //sha256su0 v4.16b,v5.16b |
| 1091 | orr v2.16b,v0.16b,v0.16b |
| 1092 | .inst 0x5e104020 //sha256h v0.16b,v1.16b,v16.4s |
| 1093 | .inst 0x5e105041 //sha256h2 v1.16b,v2.16b,v16.4s |
| 1094 | .inst 0x5e0760c4 //sha256su1 v4.16b,v6.16b,v7.16b |
| 1095 | ld1 {v16.4s},[x3],#16 |
| 1096 | add v17.4s,v17.4s,v5.4s |
| 1097 | .inst 0x5e2828c5 //sha256su0 v5.16b,v6.16b |
| 1098 | orr v2.16b,v0.16b,v0.16b |
| 1099 | .inst 0x5e114020 //sha256h v0.16b,v1.16b,v17.4s |
| 1100 | .inst 0x5e115041 //sha256h2 v1.16b,v2.16b,v17.4s |
| 1101 | .inst 0x5e0460e5 //sha256su1 v5.16b,v7.16b,v4.16b |
| 1102 | ld1 {v17.4s},[x3],#16 |
| 1103 | add v16.4s,v16.4s,v6.4s |
| 1104 | .inst 0x5e2828e6 //sha256su0 v6.16b,v7.16b |
| 1105 | orr v2.16b,v0.16b,v0.16b |
| 1106 | .inst 0x5e104020 //sha256h v0.16b,v1.16b,v16.4s |
| 1107 | .inst 0x5e105041 //sha256h2 v1.16b,v2.16b,v16.4s |
| 1108 | .inst 0x5e056086 //sha256su1 v6.16b,v4.16b,v5.16b |
| 1109 | ld1 {v16.4s},[x3],#16 |
| 1110 | add v17.4s,v17.4s,v7.4s |
| 1111 | .inst 0x5e282887 //sha256su0 v7.16b,v4.16b |
| 1112 | orr v2.16b,v0.16b,v0.16b |
| 1113 | .inst 0x5e114020 //sha256h v0.16b,v1.16b,v17.4s |
| 1114 | .inst 0x5e115041 //sha256h2 v1.16b,v2.16b,v17.4s |
| 1115 | .inst 0x5e0660a7 //sha256su1 v7.16b,v5.16b,v6.16b |
| 1116 | ld1 {v17.4s},[x3],#16 |
| 1117 | add v16.4s,v16.4s,v4.4s |
| 1118 | .inst 0x5e2828a4 //sha256su0 v4.16b,v5.16b |
| 1119 | orr v2.16b,v0.16b,v0.16b |
| 1120 | .inst 0x5e104020 //sha256h v0.16b,v1.16b,v16.4s |
| 1121 | .inst 0x5e105041 //sha256h2 v1.16b,v2.16b,v16.4s |
| 1122 | .inst 0x5e0760c4 //sha256su1 v4.16b,v6.16b,v7.16b |
| 1123 | ld1 {v16.4s},[x3],#16 |
| 1124 | add v17.4s,v17.4s,v5.4s |
| 1125 | .inst 0x5e2828c5 //sha256su0 v5.16b,v6.16b |
| 1126 | orr v2.16b,v0.16b,v0.16b |
| 1127 | .inst 0x5e114020 //sha256h v0.16b,v1.16b,v17.4s |
| 1128 | .inst 0x5e115041 //sha256h2 v1.16b,v2.16b,v17.4s |
| 1129 | .inst 0x5e0460e5 //sha256su1 v5.16b,v7.16b,v4.16b |
| 1130 | ld1 {v17.4s},[x3],#16 |
| 1131 | add v16.4s,v16.4s,v6.4s |
| 1132 | .inst 0x5e2828e6 //sha256su0 v6.16b,v7.16b |
| 1133 | orr v2.16b,v0.16b,v0.16b |
| 1134 | .inst 0x5e104020 //sha256h v0.16b,v1.16b,v16.4s |
| 1135 | .inst 0x5e105041 //sha256h2 v1.16b,v2.16b,v16.4s |
| 1136 | .inst 0x5e056086 //sha256su1 v6.16b,v4.16b,v5.16b |
| 1137 | ld1 {v16.4s},[x3],#16 |
| 1138 | add v17.4s,v17.4s,v7.4s |
| 1139 | .inst 0x5e282887 //sha256su0 v7.16b,v4.16b |
| 1140 | orr v2.16b,v0.16b,v0.16b |
| 1141 | .inst 0x5e114020 //sha256h v0.16b,v1.16b,v17.4s |
| 1142 | .inst 0x5e115041 //sha256h2 v1.16b,v2.16b,v17.4s |
| 1143 | .inst 0x5e0660a7 //sha256su1 v7.16b,v5.16b,v6.16b |
| 1144 | ld1 {v17.4s},[x3],#16 |
| 1145 | add v16.4s,v16.4s,v4.4s |
| 1146 | .inst 0x5e2828a4 //sha256su0 v4.16b,v5.16b |
| 1147 | orr v2.16b,v0.16b,v0.16b |
| 1148 | .inst 0x5e104020 //sha256h v0.16b,v1.16b,v16.4s |
| 1149 | .inst 0x5e105041 //sha256h2 v1.16b,v2.16b,v16.4s |
| 1150 | .inst 0x5e0760c4 //sha256su1 v4.16b,v6.16b,v7.16b |
| 1151 | ld1 {v16.4s},[x3],#16 |
| 1152 | add v17.4s,v17.4s,v5.4s |
| 1153 | .inst 0x5e2828c5 //sha256su0 v5.16b,v6.16b |
| 1154 | orr v2.16b,v0.16b,v0.16b |
| 1155 | .inst 0x5e114020 //sha256h v0.16b,v1.16b,v17.4s |
| 1156 | .inst 0x5e115041 //sha256h2 v1.16b,v2.16b,v17.4s |
| 1157 | .inst 0x5e0460e5 //sha256su1 v5.16b,v7.16b,v4.16b |
| 1158 | ld1 {v17.4s},[x3],#16 |
| 1159 | add v16.4s,v16.4s,v6.4s |
| 1160 | .inst 0x5e2828e6 //sha256su0 v6.16b,v7.16b |
| 1161 | orr v2.16b,v0.16b,v0.16b |
| 1162 | .inst 0x5e104020 //sha256h v0.16b,v1.16b,v16.4s |
| 1163 | .inst 0x5e105041 //sha256h2 v1.16b,v2.16b,v16.4s |
| 1164 | .inst 0x5e056086 //sha256su1 v6.16b,v4.16b,v5.16b |
| 1165 | ld1 {v16.4s},[x3],#16 |
| 1166 | add v17.4s,v17.4s,v7.4s |
| 1167 | .inst 0x5e282887 //sha256su0 v7.16b,v4.16b |
| 1168 | orr v2.16b,v0.16b,v0.16b |
| 1169 | .inst 0x5e114020 //sha256h v0.16b,v1.16b,v17.4s |
| 1170 | .inst 0x5e115041 //sha256h2 v1.16b,v2.16b,v17.4s |
| 1171 | .inst 0x5e0660a7 //sha256su1 v7.16b,v5.16b,v6.16b |
| 1172 | ld1 {v17.4s},[x3],#16 |
| 1173 | add v16.4s,v16.4s,v4.4s |
| 1174 | orr v2.16b,v0.16b,v0.16b |
| 1175 | .inst 0x5e104020 //sha256h v0.16b,v1.16b,v16.4s |
| 1176 | .inst 0x5e105041 //sha256h2 v1.16b,v2.16b,v16.4s |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1177 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1178 | ld1 {v16.4s},[x3],#16 |
| 1179 | add v17.4s,v17.4s,v5.4s |
| 1180 | orr v2.16b,v0.16b,v0.16b |
| 1181 | .inst 0x5e114020 //sha256h v0.16b,v1.16b,v17.4s |
| 1182 | .inst 0x5e115041 //sha256h2 v1.16b,v2.16b,v17.4s |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1183 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1184 | ld1 {v17.4s},[x3] |
| 1185 | add v16.4s,v16.4s,v6.4s |
| 1186 | sub x3,x3,#64*4-16 // rewind |
| 1187 | orr v2.16b,v0.16b,v0.16b |
| 1188 | .inst 0x5e104020 //sha256h v0.16b,v1.16b,v16.4s |
| 1189 | .inst 0x5e105041 //sha256h2 v1.16b,v2.16b,v16.4s |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1190 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1191 | add v17.4s,v17.4s,v7.4s |
| 1192 | orr v2.16b,v0.16b,v0.16b |
| 1193 | .inst 0x5e114020 //sha256h v0.16b,v1.16b,v17.4s |
| 1194 | .inst 0x5e115041 //sha256h2 v1.16b,v2.16b,v17.4s |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1195 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1196 | add v0.4s,v0.4s,v18.4s |
| 1197 | add v1.4s,v1.4s,v19.4s |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1198 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1199 | cbnz x2,.Loop_hw |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1200 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1201 | st1 {v0.4s,v1.4s},[x0] |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1202 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1203 | ldr x29,[sp],#16 |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1204 | ret |
| 1205 | .size sha256_block_armv8,.-sha256_block_armv8 |
Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 1206 | #endif |
| 1207 | #ifndef __KERNEL__ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1208 | .comm OPENSSL_armcap_P,4,4 |
Robert Sloan | f068def | 2018-10-10 18:45:40 -0700 | [diff] [blame] | 1209 | .hidden OPENSSL_armcap_P |
David Benjamin | 4969cc9 | 2016-04-22 15:02:23 -0400 | [diff] [blame] | 1210 | #endif |
Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 1211 | #endif |
Robert Sloan | 726e9d1 | 2018-09-11 11:45:04 -0700 | [diff] [blame] | 1212 | #endif // !OPENSSL_NO_ASM |