1 1.1 christos #include "arm_asm.h" 2 1.2 christos #include "arm_arch.h" 3 1.2 christos 4 1.2 christos .section .rodata 5 1.1 christos 6 1.1 christos .align 8 // strategic alignment and padding that allows to use 7 1.1 christos // address value as loop termination condition... 8 1.1 christos .quad 0,0,0,0,0,0,0,0 9 1.1 christos .type iotas,%object 10 1.1 christos iotas: 11 1.1 christos .quad 0x0000000000000001 12 1.1 christos .quad 0x0000000000008082 13 1.1 christos .quad 0x800000000000808a 14 1.1 christos .quad 0x8000000080008000 15 1.1 christos .quad 0x000000000000808b 16 1.1 christos .quad 0x0000000080000001 17 1.1 christos .quad 0x8000000080008081 18 1.1 christos .quad 0x8000000000008009 19 1.1 christos .quad 0x000000000000008a 20 1.1 christos .quad 0x0000000000000088 21 1.1 christos .quad 0x0000000080008009 22 1.1 christos .quad 0x000000008000000a 23 1.1 christos .quad 0x000000008000808b 24 1.1 christos .quad 0x800000000000008b 25 1.1 christos .quad 0x8000000000008089 26 1.1 christos .quad 0x8000000000008003 27 1.1 christos .quad 0x8000000000008002 28 1.1 christos .quad 0x8000000000000080 29 1.1 christos .quad 0x000000000000800a 30 1.1 christos .quad 0x800000008000000a 31 1.1 christos .quad 0x8000000080008081 32 1.1 christos .quad 0x8000000000008080 33 1.1 christos .quad 0x0000000080000001 34 1.1 christos .quad 0x8000000080008008 35 1.1 christos .size iotas,.-iotas 36 1.2 christos .text 37 1.2 christos 38 1.1 christos .type KeccakF1600_int,%function 39 1.1 christos .align 5 40 1.1 christos KeccakF1600_int: 41 1.2 christos AARCH64_SIGN_LINK_REGISTER 42 1.2 christos adrp x28,iotas 43 1.2 christos add x28,x28,#:lo12:iotas 44 1.1 christos stp x28,x30,[sp,#16] // 32 bytes on top are mine 45 1.1 christos b .Loop 46 1.1 christos .align 4 47 1.1 christos .Loop: 48 1.1 christos ////////////////////////////////////////// Theta 49 1.1 christos eor x26,x0,x5 50 1.1 christos stp x4,x9,[sp,#0] // offload pair... 51 1.1 christos eor x27,x1,x6 52 1.1 christos eor x28,x2,x7 53 1.1 christos eor x30,x3,x8 54 1.1 christos eor x4,x4,x9 55 1.1 christos eor x26,x26,x10 56 1.1 christos eor x27,x27,x11 57 1.1 christos eor x28,x28,x12 58 1.1 christos eor x30,x30,x13 59 1.1 christos eor x4,x4,x14 60 1.1 christos eor x26,x26,x15 61 1.1 christos eor x27,x27,x16 62 1.1 christos eor x28,x28,x17 63 1.1 christos eor x30,x30,x25 64 1.1 christos eor x4,x4,x19 65 1.1 christos eor x26,x26,x20 66 1.1 christos eor x28,x28,x22 67 1.1 christos eor x27,x27,x21 68 1.1 christos eor x30,x30,x23 69 1.1 christos eor x4,x4,x24 70 1.1 christos 71 1.1 christos eor x9,x26,x28,ror#63 72 1.1 christos 73 1.1 christos eor x1,x1,x9 74 1.1 christos eor x6,x6,x9 75 1.1 christos eor x11,x11,x9 76 1.1 christos eor x16,x16,x9 77 1.1 christos eor x21,x21,x9 78 1.1 christos 79 1.1 christos eor x9,x27,x30,ror#63 80 1.1 christos eor x28,x28,x4,ror#63 81 1.1 christos eor x30,x30,x26,ror#63 82 1.1 christos eor x4,x4,x27,ror#63 83 1.1 christos 84 1.1 christos eor x27, x2,x9 // mov x27,x2 85 1.1 christos eor x7,x7,x9 86 1.1 christos eor x12,x12,x9 87 1.1 christos eor x17,x17,x9 88 1.1 christos eor x22,x22,x9 89 1.1 christos 90 1.1 christos eor x0,x0,x4 91 1.1 christos eor x5,x5,x4 92 1.1 christos eor x10,x10,x4 93 1.1 christos eor x15,x15,x4 94 1.1 christos eor x20,x20,x4 95 1.1 christos ldp x4,x9,[sp,#0] // re-load offloaded data 96 1.1 christos eor x26, x3,x28 // mov x26,x3 97 1.1 christos eor x8,x8,x28 98 1.1 christos eor x13,x13,x28 99 1.1 christos eor x25,x25,x28 100 1.1 christos eor x23,x23,x28 101 1.1 christos 102 1.1 christos eor x28, x4,x30 // mov x28,x4 103 1.1 christos eor x9,x9,x30 104 1.1 christos eor x14,x14,x30 105 1.1 christos eor x19,x19,x30 106 1.1 christos eor x24,x24,x30 107 1.1 christos 108 1.1 christos ////////////////////////////////////////// Rho+Pi 109 1.1 christos mov x30,x1 110 1.1 christos ror x1,x6,#64-44 111 1.1 christos //mov x27,x2 112 1.1 christos ror x2,x12,#64-43 113 1.1 christos //mov x26,x3 114 1.1 christos ror x3,x25,#64-21 115 1.1 christos //mov x28,x4 116 1.1 christos ror x4,x24,#64-14 117 1.1 christos 118 1.1 christos ror x6,x9,#64-20 119 1.1 christos ror x12,x13,#64-25 120 1.1 christos ror x25,x17,#64-15 121 1.1 christos ror x24,x21,#64-2 122 1.1 christos 123 1.1 christos ror x9,x22,#64-61 124 1.1 christos ror x13,x19,#64-8 125 1.1 christos ror x17,x11,#64-10 126 1.1 christos ror x21,x8,#64-55 127 1.1 christos 128 1.1 christos ror x22,x14,#64-39 129 1.1 christos ror x19,x23,#64-56 130 1.1 christos ror x11,x7,#64-6 131 1.1 christos ror x8,x16,#64-45 132 1.1 christos 133 1.1 christos ror x14,x20,#64-18 134 1.1 christos ror x23,x15,#64-41 135 1.1 christos ror x7,x10,#64-3 136 1.1 christos ror x16,x5,#64-36 137 1.1 christos 138 1.1 christos ror x5,x26,#64-28 139 1.1 christos ror x10,x30,#64-1 140 1.1 christos ror x15,x28,#64-27 141 1.1 christos ror x20,x27,#64-62 142 1.1 christos 143 1.1 christos ////////////////////////////////////////// Chi+Iota 144 1.1 christos bic x26,x2,x1 145 1.1 christos bic x27,x3,x2 146 1.1 christos bic x28,x0,x4 147 1.1 christos bic x30,x1,x0 148 1.1 christos eor x0,x0,x26 149 1.1 christos bic x26,x4,x3 150 1.1 christos eor x1,x1,x27 151 1.1 christos ldr x27,[sp,#16] 152 1.1 christos eor x3,x3,x28 153 1.1 christos eor x4,x4,x30 154 1.1 christos eor x2,x2,x26 155 1.1 christos ldr x30,[x27],#8 // Iota[i++] 156 1.1 christos 157 1.1 christos bic x26,x7,x6 158 1.1 christos tst x27,#255 // are we done? 159 1.1 christos str x27,[sp,#16] 160 1.1 christos bic x27,x8,x7 161 1.1 christos bic x28,x5,x9 162 1.1 christos eor x0,x0,x30 // A[0][0] ^= Iota 163 1.1 christos bic x30,x6,x5 164 1.1 christos eor x5,x5,x26 165 1.1 christos bic x26,x9,x8 166 1.1 christos eor x6,x6,x27 167 1.1 christos eor x8,x8,x28 168 1.1 christos eor x9,x9,x30 169 1.1 christos eor x7,x7,x26 170 1.1 christos 171 1.1 christos bic x26,x12,x11 172 1.1 christos bic x27,x13,x12 173 1.1 christos bic x28,x10,x14 174 1.1 christos bic x30,x11,x10 175 1.1 christos eor x10,x10,x26 176 1.1 christos bic x26,x14,x13 177 1.1 christos eor x11,x11,x27 178 1.1 christos eor x13,x13,x28 179 1.1 christos eor x14,x14,x30 180 1.1 christos eor x12,x12,x26 181 1.1 christos 182 1.1 christos bic x26,x17,x16 183 1.1 christos bic x27,x25,x17 184 1.1 christos bic x28,x15,x19 185 1.1 christos bic x30,x16,x15 186 1.1 christos eor x15,x15,x26 187 1.1 christos bic x26,x19,x25 188 1.1 christos eor x16,x16,x27 189 1.1 christos eor x25,x25,x28 190 1.1 christos eor x19,x19,x30 191 1.1 christos eor x17,x17,x26 192 1.1 christos 193 1.1 christos bic x26,x22,x21 194 1.1 christos bic x27,x23,x22 195 1.1 christos bic x28,x20,x24 196 1.1 christos bic x30,x21,x20 197 1.1 christos eor x20,x20,x26 198 1.1 christos bic x26,x24,x23 199 1.1 christos eor x21,x21,x27 200 1.1 christos eor x23,x23,x28 201 1.1 christos eor x24,x24,x30 202 1.1 christos eor x22,x22,x26 203 1.1 christos 204 1.1 christos bne .Loop 205 1.1 christos 206 1.1 christos ldr x30,[sp,#24] 207 1.2 christos AARCH64_VALIDATE_LINK_REGISTER 208 1.1 christos ret 209 1.1 christos .size KeccakF1600_int,.-KeccakF1600_int 210 1.1 christos 211 1.1 christos .type KeccakF1600,%function 212 1.1 christos .align 5 213 1.1 christos KeccakF1600: 214 1.2 christos AARCH64_SIGN_LINK_REGISTER 215 1.1 christos stp x29,x30,[sp,#-128]! 216 1.1 christos add x29,sp,#0 217 1.1 christos stp x19,x20,[sp,#16] 218 1.1 christos stp x21,x22,[sp,#32] 219 1.1 christos stp x23,x24,[sp,#48] 220 1.1 christos stp x25,x26,[sp,#64] 221 1.1 christos stp x27,x28,[sp,#80] 222 1.1 christos sub sp,sp,#48 223 1.1 christos 224 1.1 christos str x0,[sp,#32] // offload argument 225 1.1 christos mov x26,x0 226 1.1 christos ldp x0,x1,[x0,#16*0] 227 1.1 christos ldp x2,x3,[x26,#16*1] 228 1.1 christos ldp x4,x5,[x26,#16*2] 229 1.1 christos ldp x6,x7,[x26,#16*3] 230 1.1 christos ldp x8,x9,[x26,#16*4] 231 1.1 christos ldp x10,x11,[x26,#16*5] 232 1.1 christos ldp x12,x13,[x26,#16*6] 233 1.1 christos ldp x14,x15,[x26,#16*7] 234 1.1 christos ldp x16,x17,[x26,#16*8] 235 1.1 christos ldp x25,x19,[x26,#16*9] 236 1.1 christos ldp x20,x21,[x26,#16*10] 237 1.1 christos ldp x22,x23,[x26,#16*11] 238 1.1 christos ldr x24,[x26,#16*12] 239 1.1 christos 240 1.1 christos bl KeccakF1600_int 241 1.1 christos 242 1.1 christos ldr x26,[sp,#32] 243 1.1 christos stp x0,x1,[x26,#16*0] 244 1.1 christos stp x2,x3,[x26,#16*1] 245 1.1 christos stp x4,x5,[x26,#16*2] 246 1.1 christos stp x6,x7,[x26,#16*3] 247 1.1 christos stp x8,x9,[x26,#16*4] 248 1.1 christos stp x10,x11,[x26,#16*5] 249 1.1 christos stp x12,x13,[x26,#16*6] 250 1.1 christos stp x14,x15,[x26,#16*7] 251 1.1 christos stp x16,x17,[x26,#16*8] 252 1.1 christos stp x25,x19,[x26,#16*9] 253 1.1 christos stp x20,x21,[x26,#16*10] 254 1.1 christos stp x22,x23,[x26,#16*11] 255 1.1 christos str x24,[x26,#16*12] 256 1.1 christos 257 1.1 christos ldp x19,x20,[x29,#16] 258 1.1 christos add sp,sp,#48 259 1.1 christos ldp x21,x22,[x29,#32] 260 1.1 christos ldp x23,x24,[x29,#48] 261 1.1 christos ldp x25,x26,[x29,#64] 262 1.1 christos ldp x27,x28,[x29,#80] 263 1.1 christos ldp x29,x30,[sp],#128 264 1.2 christos AARCH64_VALIDATE_LINK_REGISTER 265 1.1 christos ret 266 1.1 christos .size KeccakF1600,.-KeccakF1600 267 1.1 christos 268 1.1 christos .globl SHA3_absorb 269 1.1 christos .type SHA3_absorb,%function 270 1.1 christos .align 5 271 1.1 christos SHA3_absorb: 272 1.2 christos AARCH64_SIGN_LINK_REGISTER 273 1.1 christos stp x29,x30,[sp,#-128]! 274 1.1 christos add x29,sp,#0 275 1.1 christos stp x19,x20,[sp,#16] 276 1.1 christos stp x21,x22,[sp,#32] 277 1.1 christos stp x23,x24,[sp,#48] 278 1.1 christos stp x25,x26,[sp,#64] 279 1.1 christos stp x27,x28,[sp,#80] 280 1.1 christos sub sp,sp,#64 281 1.1 christos 282 1.1 christos stp x0,x1,[sp,#32] // offload arguments 283 1.1 christos stp x2,x3,[sp,#48] 284 1.1 christos 285 1.1 christos mov x26,x0 // uint64_t A[5][5] 286 1.1 christos mov x27,x1 // const void *inp 287 1.1 christos mov x28,x2 // size_t len 288 1.1 christos mov x30,x3 // size_t bsz 289 1.1 christos ldp x0,x1,[x26,#16*0] 290 1.1 christos ldp x2,x3,[x26,#16*1] 291 1.1 christos ldp x4,x5,[x26,#16*2] 292 1.1 christos ldp x6,x7,[x26,#16*3] 293 1.1 christos ldp x8,x9,[x26,#16*4] 294 1.1 christos ldp x10,x11,[x26,#16*5] 295 1.1 christos ldp x12,x13,[x26,#16*6] 296 1.1 christos ldp x14,x15,[x26,#16*7] 297 1.1 christos ldp x16,x17,[x26,#16*8] 298 1.1 christos ldp x25,x19,[x26,#16*9] 299 1.1 christos ldp x20,x21,[x26,#16*10] 300 1.1 christos ldp x22,x23,[x26,#16*11] 301 1.1 christos ldr x24,[x26,#16*12] 302 1.1 christos b .Loop_absorb 303 1.1 christos 304 1.1 christos .align 4 305 1.1 christos .Loop_absorb: 306 1.1 christos subs x26,x28,x30 // len - bsz 307 1.1 christos blo .Labsorbed 308 1.1 christos 309 1.1 christos str x26,[sp,#48] // save len - bsz 310 1.1 christos ldr x26,[x27],#8 // *inp++ 311 1.1 christos #ifdef __AARCH64EB__ 312 1.1 christos rev x26,x26 313 1.1 christos #endif 314 1.1 christos eor x0,x0,x26 315 1.1 christos cmp x30,#8*(0+2) 316 1.1 christos blo .Lprocess_block 317 1.1 christos ldr x26,[x27],#8 // *inp++ 318 1.1 christos #ifdef __AARCH64EB__ 319 1.1 christos rev x26,x26 320 1.1 christos #endif 321 1.1 christos eor x1,x1,x26 322 1.1 christos beq .Lprocess_block 323 1.1 christos ldr x26,[x27],#8 // *inp++ 324 1.1 christos #ifdef __AARCH64EB__ 325 1.1 christos rev x26,x26 326 1.1 christos #endif 327 1.1 christos eor x2,x2,x26 328 1.1 christos cmp x30,#8*(2+2) 329 1.1 christos blo .Lprocess_block 330 1.1 christos ldr x26,[x27],#8 // *inp++ 331 1.1 christos #ifdef __AARCH64EB__ 332 1.1 christos rev x26,x26 333 1.1 christos #endif 334 1.1 christos eor x3,x3,x26 335 1.1 christos beq .Lprocess_block 336 1.1 christos ldr x26,[x27],#8 // *inp++ 337 1.1 christos #ifdef __AARCH64EB__ 338 1.1 christos rev x26,x26 339 1.1 christos #endif 340 1.1 christos eor x4,x4,x26 341 1.1 christos cmp x30,#8*(4+2) 342 1.1 christos blo .Lprocess_block 343 1.1 christos ldr x26,[x27],#8 // *inp++ 344 1.1 christos #ifdef __AARCH64EB__ 345 1.1 christos rev x26,x26 346 1.1 christos #endif 347 1.1 christos eor x5,x5,x26 348 1.1 christos beq .Lprocess_block 349 1.1 christos ldr x26,[x27],#8 // *inp++ 350 1.1 christos #ifdef __AARCH64EB__ 351 1.1 christos rev x26,x26 352 1.1 christos #endif 353 1.1 christos eor x6,x6,x26 354 1.1 christos cmp x30,#8*(6+2) 355 1.1 christos blo .Lprocess_block 356 1.1 christos ldr x26,[x27],#8 // *inp++ 357 1.1 christos #ifdef __AARCH64EB__ 358 1.1 christos rev x26,x26 359 1.1 christos #endif 360 1.1 christos eor x7,x7,x26 361 1.1 christos beq .Lprocess_block 362 1.1 christos ldr x26,[x27],#8 // *inp++ 363 1.1 christos #ifdef __AARCH64EB__ 364 1.1 christos rev x26,x26 365 1.1 christos #endif 366 1.1 christos eor x8,x8,x26 367 1.1 christos cmp x30,#8*(8+2) 368 1.1 christos blo .Lprocess_block 369 1.1 christos ldr x26,[x27],#8 // *inp++ 370 1.1 christos #ifdef __AARCH64EB__ 371 1.1 christos rev x26,x26 372 1.1 christos #endif 373 1.1 christos eor x9,x9,x26 374 1.1 christos beq .Lprocess_block 375 1.1 christos ldr x26,[x27],#8 // *inp++ 376 1.1 christos #ifdef __AARCH64EB__ 377 1.1 christos rev x26,x26 378 1.1 christos #endif 379 1.1 christos eor x10,x10,x26 380 1.1 christos cmp x30,#8*(10+2) 381 1.1 christos blo .Lprocess_block 382 1.1 christos ldr x26,[x27],#8 // *inp++ 383 1.1 christos #ifdef __AARCH64EB__ 384 1.1 christos rev x26,x26 385 1.1 christos #endif 386 1.1 christos eor x11,x11,x26 387 1.1 christos beq .Lprocess_block 388 1.1 christos ldr x26,[x27],#8 // *inp++ 389 1.1 christos #ifdef __AARCH64EB__ 390 1.1 christos rev x26,x26 391 1.1 christos #endif 392 1.1 christos eor x12,x12,x26 393 1.1 christos cmp x30,#8*(12+2) 394 1.1 christos blo .Lprocess_block 395 1.1 christos ldr x26,[x27],#8 // *inp++ 396 1.1 christos #ifdef __AARCH64EB__ 397 1.1 christos rev x26,x26 398 1.1 christos #endif 399 1.1 christos eor x13,x13,x26 400 1.1 christos beq .Lprocess_block 401 1.1 christos ldr x26,[x27],#8 // *inp++ 402 1.1 christos #ifdef __AARCH64EB__ 403 1.1 christos rev x26,x26 404 1.1 christos #endif 405 1.1 christos eor x14,x14,x26 406 1.1 christos cmp x30,#8*(14+2) 407 1.1 christos blo .Lprocess_block 408 1.1 christos ldr x26,[x27],#8 // *inp++ 409 1.1 christos #ifdef __AARCH64EB__ 410 1.1 christos rev x26,x26 411 1.1 christos #endif 412 1.1 christos eor x15,x15,x26 413 1.1 christos beq .Lprocess_block 414 1.1 christos ldr x26,[x27],#8 // *inp++ 415 1.1 christos #ifdef __AARCH64EB__ 416 1.1 christos rev x26,x26 417 1.1 christos #endif 418 1.1 christos eor x16,x16,x26 419 1.1 christos cmp x30,#8*(16+2) 420 1.1 christos blo .Lprocess_block 421 1.1 christos ldr x26,[x27],#8 // *inp++ 422 1.1 christos #ifdef __AARCH64EB__ 423 1.1 christos rev x26,x26 424 1.1 christos #endif 425 1.1 christos eor x17,x17,x26 426 1.1 christos beq .Lprocess_block 427 1.1 christos ldr x26,[x27],#8 // *inp++ 428 1.1 christos #ifdef __AARCH64EB__ 429 1.1 christos rev x26,x26 430 1.1 christos #endif 431 1.1 christos eor x25,x25,x26 432 1.1 christos cmp x30,#8*(18+2) 433 1.1 christos blo .Lprocess_block 434 1.1 christos ldr x26,[x27],#8 // *inp++ 435 1.1 christos #ifdef __AARCH64EB__ 436 1.1 christos rev x26,x26 437 1.1 christos #endif 438 1.1 christos eor x19,x19,x26 439 1.1 christos beq .Lprocess_block 440 1.1 christos ldr x26,[x27],#8 // *inp++ 441 1.1 christos #ifdef __AARCH64EB__ 442 1.1 christos rev x26,x26 443 1.1 christos #endif 444 1.1 christos eor x20,x20,x26 445 1.1 christos cmp x30,#8*(20+2) 446 1.1 christos blo .Lprocess_block 447 1.1 christos ldr x26,[x27],#8 // *inp++ 448 1.1 christos #ifdef __AARCH64EB__ 449 1.1 christos rev x26,x26 450 1.1 christos #endif 451 1.1 christos eor x21,x21,x26 452 1.1 christos beq .Lprocess_block 453 1.1 christos ldr x26,[x27],#8 // *inp++ 454 1.1 christos #ifdef __AARCH64EB__ 455 1.1 christos rev x26,x26 456 1.1 christos #endif 457 1.1 christos eor x22,x22,x26 458 1.1 christos cmp x30,#8*(22+2) 459 1.1 christos blo .Lprocess_block 460 1.1 christos ldr x26,[x27],#8 // *inp++ 461 1.1 christos #ifdef __AARCH64EB__ 462 1.1 christos rev x26,x26 463 1.1 christos #endif 464 1.1 christos eor x23,x23,x26 465 1.1 christos beq .Lprocess_block 466 1.1 christos ldr x26,[x27],#8 // *inp++ 467 1.1 christos #ifdef __AARCH64EB__ 468 1.1 christos rev x26,x26 469 1.1 christos #endif 470 1.1 christos eor x24,x24,x26 471 1.1 christos 472 1.1 christos .Lprocess_block: 473 1.1 christos str x27,[sp,#40] // save inp 474 1.1 christos 475 1.1 christos bl KeccakF1600_int 476 1.1 christos 477 1.1 christos ldr x27,[sp,#40] // restore arguments 478 1.1 christos ldp x28,x30,[sp,#48] 479 1.1 christos b .Loop_absorb 480 1.1 christos 481 1.1 christos .align 4 482 1.1 christos .Labsorbed: 483 1.1 christos ldr x27,[sp,#32] 484 1.1 christos stp x0,x1,[x27,#16*0] 485 1.1 christos stp x2,x3,[x27,#16*1] 486 1.1 christos stp x4,x5,[x27,#16*2] 487 1.1 christos stp x6,x7,[x27,#16*3] 488 1.1 christos stp x8,x9,[x27,#16*4] 489 1.1 christos stp x10,x11,[x27,#16*5] 490 1.1 christos stp x12,x13,[x27,#16*6] 491 1.1 christos stp x14,x15,[x27,#16*7] 492 1.1 christos stp x16,x17,[x27,#16*8] 493 1.1 christos stp x25,x19,[x27,#16*9] 494 1.1 christos stp x20,x21,[x27,#16*10] 495 1.1 christos stp x22,x23,[x27,#16*11] 496 1.1 christos str x24,[x27,#16*12] 497 1.1 christos 498 1.1 christos mov x0,x28 // return value 499 1.1 christos ldp x19,x20,[x29,#16] 500 1.1 christos add sp,sp,#64 501 1.1 christos ldp x21,x22,[x29,#32] 502 1.1 christos ldp x23,x24,[x29,#48] 503 1.1 christos ldp x25,x26,[x29,#64] 504 1.1 christos ldp x27,x28,[x29,#80] 505 1.1 christos ldp x29,x30,[sp],#128 506 1.2 christos AARCH64_VALIDATE_LINK_REGISTER 507 1.1 christos ret 508 1.1 christos .size SHA3_absorb,.-SHA3_absorb 509 1.1 christos .globl SHA3_squeeze 510 1.1 christos .type SHA3_squeeze,%function 511 1.1 christos .align 5 512 1.1 christos SHA3_squeeze: 513 1.2 christos AARCH64_SIGN_LINK_REGISTER 514 1.1 christos stp x29,x30,[sp,#-48]! 515 1.1 christos add x29,sp,#0 516 1.1 christos stp x19,x20,[sp,#16] 517 1.1 christos stp x21,x22,[sp,#32] 518 1.1 christos 519 1.1 christos mov x19,x0 // put aside arguments 520 1.1 christos mov x20,x1 521 1.1 christos mov x21,x2 522 1.1 christos mov x22,x3 523 1.2 christos cmp w4, #0 // w4 = 'next' argument 524 1.2 christos bne .Lnext_block 525 1.1 christos 526 1.1 christos .Loop_squeeze: 527 1.1 christos ldr x4,[x0],#8 528 1.1 christos cmp x21,#8 529 1.1 christos blo .Lsqueeze_tail 530 1.1 christos #ifdef __AARCH64EB__ 531 1.1 christos rev x4,x4 532 1.1 christos #endif 533 1.1 christos str x4,[x20],#8 534 1.1 christos subs x21,x21,#8 535 1.1 christos beq .Lsqueeze_done 536 1.1 christos 537 1.1 christos subs x3,x3,#8 538 1.1 christos bhi .Loop_squeeze 539 1.2 christos .Lnext_block: 540 1.1 christos mov x0,x19 541 1.1 christos bl KeccakF1600 542 1.1 christos mov x0,x19 543 1.1 christos mov x3,x22 544 1.1 christos b .Loop_squeeze 545 1.1 christos 546 1.1 christos .align 4 547 1.1 christos .Lsqueeze_tail: 548 1.1 christos strb w4,[x20],#1 549 1.1 christos lsr x4,x4,#8 550 1.1 christos subs x21,x21,#1 551 1.1 christos beq .Lsqueeze_done 552 1.1 christos strb w4,[x20],#1 553 1.1 christos lsr x4,x4,#8 554 1.1 christos subs x21,x21,#1 555 1.1 christos beq .Lsqueeze_done 556 1.1 christos strb w4,[x20],#1 557 1.1 christos lsr x4,x4,#8 558 1.1 christos subs x21,x21,#1 559 1.1 christos beq .Lsqueeze_done 560 1.1 christos strb w4,[x20],#1 561 1.1 christos lsr x4,x4,#8 562 1.1 christos subs x21,x21,#1 563 1.1 christos beq .Lsqueeze_done 564 1.1 christos strb w4,[x20],#1 565 1.1 christos lsr x4,x4,#8 566 1.1 christos subs x21,x21,#1 567 1.1 christos beq .Lsqueeze_done 568 1.1 christos strb w4,[x20],#1 569 1.1 christos lsr x4,x4,#8 570 1.1 christos subs x21,x21,#1 571 1.1 christos beq .Lsqueeze_done 572 1.1 christos strb w4,[x20],#1 573 1.1 christos 574 1.1 christos .Lsqueeze_done: 575 1.1 christos ldp x19,x20,[sp,#16] 576 1.1 christos ldp x21,x22,[sp,#32] 577 1.1 christos ldp x29,x30,[sp],#48 578 1.2 christos AARCH64_VALIDATE_LINK_REGISTER 579 1.1 christos ret 580 1.1 christos .size SHA3_squeeze,.-SHA3_squeeze 581 1.1 christos .type KeccakF1600_ce,%function 582 1.1 christos .align 5 583 1.1 christos KeccakF1600_ce: 584 1.1 christos mov x9,#24 585 1.2 christos adrp x10,iotas 586 1.2 christos add x10,x10,#:lo12:iotas 587 1.1 christos b .Loop_ce 588 1.1 christos .align 4 589 1.1 christos .Loop_ce: 590 1.1 christos ////////////////////////////////////////////////// Theta 591 1.1 christos .inst 0xce0f2a99 //eor3 v25.16b,v20.16b,v15.16b,v10.16b 592 1.1 christos .inst 0xce102eba //eor3 v26.16b,v21.16b,v16.16b,v11.16b 593 1.1 christos .inst 0xce1132db //eor3 v27.16b,v22.16b,v17.16b,v12.16b 594 1.1 christos .inst 0xce1236fc //eor3 v28.16b,v23.16b,v18.16b,v13.16b 595 1.1 christos .inst 0xce133b1d //eor3 v29.16b,v24.16b,v19.16b,v14.16b 596 1.1 christos .inst 0xce050339 //eor3 v25.16b,v25.16b, v5.16b,v0.16b 597 1.1 christos .inst 0xce06075a //eor3 v26.16b,v26.16b, v6.16b,v1.16b 598 1.1 christos .inst 0xce070b7b //eor3 v27.16b,v27.16b, v7.16b,v2.16b 599 1.1 christos .inst 0xce080f9c //eor3 v28.16b,v28.16b, v8.16b,v3.16b 600 1.1 christos .inst 0xce0913bd //eor3 v29.16b,v29.16b, v9.16b,v4.16b 601 1.1 christos 602 1.1 christos .inst 0xce7b8f3e //rax1 v30.16b,v25.16b,v27.16b // D[1] 603 1.1 christos .inst 0xce7c8f5f //rax1 v31.16b,v26.16b,v28.16b // D[2] 604 1.1 christos .inst 0xce7d8f7b //rax1 v27.16b,v27.16b,v29.16b // D[3] 605 1.1 christos .inst 0xce798f9c //rax1 v28.16b,v28.16b,v25.16b // D[4] 606 1.1 christos .inst 0xce7a8fbd //rax1 v29.16b,v29.16b,v26.16b // D[0] 607 1.1 christos 608 1.1 christos ////////////////////////////////////////////////// Theta+Rho+Pi 609 1.1 christos .inst 0xce9efc39 //xar v25.16b, v1.16b,v30.16b,#64-1 // C[0]=A[2][0] 610 1.1 christos 611 1.1 christos .inst 0xce9e50c1 //xar v1.16b,v6.16b,v30.16b,#64-44 612 1.1 christos .inst 0xce9cb126 //xar v6.16b,v9.16b,v28.16b,#64-20 613 1.1 christos .inst 0xce9f0ec9 //xar v9.16b,v22.16b,v31.16b,#64-61 614 1.1 christos .inst 0xce9c65d6 //xar v22.16b,v14.16b,v28.16b,#64-39 615 1.1 christos .inst 0xce9dba8e //xar v14.16b,v20.16b,v29.16b,#64-18 616 1.1 christos 617 1.1 christos .inst 0xce9f085a //xar v26.16b, v2.16b,v31.16b,#64-62 // C[1]=A[4][0] 618 1.1 christos 619 1.1 christos .inst 0xce9f5582 //xar v2.16b,v12.16b,v31.16b,#64-43 620 1.1 christos .inst 0xce9b9dac //xar v12.16b,v13.16b,v27.16b,#64-25 621 1.1 christos .inst 0xce9ce26d //xar v13.16b,v19.16b,v28.16b,#64-8 622 1.1 christos .inst 0xce9b22f3 //xar v19.16b,v23.16b,v27.16b,#64-56 623 1.1 christos .inst 0xce9d5df7 //xar v23.16b,v15.16b,v29.16b,#64-41 624 1.1 christos 625 1.1 christos .inst 0xce9c948f //xar v15.16b,v4.16b,v28.16b,#64-27 626 1.1 christos 627 1.1 christos .inst 0xce9ccb1c //xar v28.16b, v24.16b,v28.16b,#64-14 // D[4]=A[0][4] 628 1.1 christos .inst 0xce9efab8 //xar v24.16b,v21.16b,v30.16b,#64-2 629 1.1 christos .inst 0xce9b2508 //xar v8.16b,v8.16b,v27.16b,#64-55 // A[1][3]=A[4][1] 630 1.1 christos .inst 0xce9e4e04 //xar v4.16b,v16.16b,v30.16b,#64-45 // A[0][4]=A[1][3] 631 1.1 christos .inst 0xce9d70b0 //xar v16.16b,v5.16b,v29.16b,#64-36 632 1.1 christos 633 1.1 christos .inst 0xce9b9065 //xar v5.16b,v3.16b,v27.16b,#64-28 634 1.1 christos 635 1.1 christos eor v0.16b,v0.16b,v29.16b 636 1.1 christos 637 1.1 christos .inst 0xce9bae5b //xar v27.16b, v18.16b,v27.16b,#64-21 // D[3]=A[0][3] 638 1.1 christos .inst 0xce9fc623 //xar v3.16b,v17.16b,v31.16b,#64-15 // A[0][3]=A[3][3] 639 1.1 christos .inst 0xce9ed97e //xar v30.16b, v11.16b,v30.16b,#64-10 // D[1]=A[3][2] 640 1.1 christos .inst 0xce9fe8ff //xar v31.16b, v7.16b,v31.16b,#64-6 // D[2]=A[2][1] 641 1.1 christos .inst 0xce9df55d //xar v29.16b, v10.16b,v29.16b,#64-3 // D[0]=A[1][2] 642 1.1 christos 643 1.1 christos ////////////////////////////////////////////////// Chi+Iota 644 1.1 christos .inst 0xce362354 //bcax v20.16b,v26.16b, v22.16b,v8.16b // A[1][3]=A[4][1] 645 1.1 christos .inst 0xce375915 //bcax v21.16b,v8.16b,v23.16b,v22.16b // A[1][3]=A[4][1] 646 1.1 christos .inst 0xce385ed6 //bcax v22.16b,v22.16b,v24.16b,v23.16b 647 1.1 christos .inst 0xce3a62f7 //bcax v23.16b,v23.16b,v26.16b, v24.16b 648 1.1 christos .inst 0xce286b18 //bcax v24.16b,v24.16b,v8.16b,v26.16b // A[1][3]=A[4][1] 649 1.1 christos 650 1.1 christos ld1r {v26.2d},[x10],#8 651 1.1 christos 652 1.1 christos .inst 0xce330fd1 //bcax v17.16b,v30.16b, v19.16b,v3.16b // A[0][3]=A[3][3] 653 1.1 christos .inst 0xce2f4c72 //bcax v18.16b,v3.16b,v15.16b,v19.16b // A[0][3]=A[3][3] 654 1.1 christos .inst 0xce303e73 //bcax v19.16b,v19.16b,v16.16b,v15.16b 655 1.1 christos .inst 0xce3e41ef //bcax v15.16b,v15.16b,v30.16b, v16.16b 656 1.1 christos .inst 0xce237a10 //bcax v16.16b,v16.16b,v3.16b,v30.16b // A[0][3]=A[3][3] 657 1.1 christos 658 1.1 christos .inst 0xce2c7f2a //bcax v10.16b,v25.16b, v12.16b,v31.16b 659 1.1 christos .inst 0xce2d33eb //bcax v11.16b,v31.16b, v13.16b,v12.16b 660 1.1 christos .inst 0xce2e358c //bcax v12.16b,v12.16b,v14.16b,v13.16b 661 1.1 christos .inst 0xce3939ad //bcax v13.16b,v13.16b,v25.16b, v14.16b 662 1.1 christos .inst 0xce3f65ce //bcax v14.16b,v14.16b,v31.16b, v25.16b 663 1.1 christos 664 1.1 christos .inst 0xce2913a7 //bcax v7.16b,v29.16b, v9.16b,v4.16b // A[0][4]=A[1][3] 665 1.1 christos .inst 0xce252488 //bcax v8.16b,v4.16b,v5.16b,v9.16b // A[0][4]=A[1][3] 666 1.1 christos .inst 0xce261529 //bcax v9.16b,v9.16b,v6.16b,v5.16b 667 1.1 christos .inst 0xce3d18a5 //bcax v5.16b,v5.16b,v29.16b, v6.16b 668 1.1 christos .inst 0xce2474c6 //bcax v6.16b,v6.16b,v4.16b,v29.16b // A[0][4]=A[1][3] 669 1.1 christos 670 1.1 christos .inst 0xce207363 //bcax v3.16b,v27.16b, v0.16b,v28.16b 671 1.1 christos .inst 0xce210384 //bcax v4.16b,v28.16b, v1.16b,v0.16b 672 1.1 christos .inst 0xce220400 //bcax v0.16b,v0.16b,v2.16b,v1.16b 673 1.1 christos .inst 0xce3b0821 //bcax v1.16b,v1.16b,v27.16b, v2.16b 674 1.1 christos .inst 0xce3c6c42 //bcax v2.16b,v2.16b,v28.16b, v27.16b 675 1.1 christos 676 1.1 christos eor v0.16b,v0.16b,v26.16b 677 1.1 christos 678 1.1 christos subs x9,x9,#1 679 1.1 christos bne .Loop_ce 680 1.1 christos 681 1.1 christos ret 682 1.1 christos .size KeccakF1600_ce,.-KeccakF1600_ce 683 1.1 christos 684 1.1 christos .type KeccakF1600_cext,%function 685 1.1 christos .align 5 686 1.1 christos KeccakF1600_cext: 687 1.2 christos AARCH64_SIGN_LINK_REGISTER 688 1.1 christos stp x29,x30,[sp,#-80]! 689 1.1 christos add x29,sp,#0 690 1.1 christos stp d8,d9,[sp,#16] // per ABI requirement 691 1.1 christos stp d10,d11,[sp,#32] 692 1.1 christos stp d12,d13,[sp,#48] 693 1.1 christos stp d14,d15,[sp,#64] 694 1.1 christos ldp d0,d1,[x0,#8*0] 695 1.1 christos ldp d2,d3,[x0,#8*2] 696 1.1 christos ldp d4,d5,[x0,#8*4] 697 1.1 christos ldp d6,d7,[x0,#8*6] 698 1.1 christos ldp d8,d9,[x0,#8*8] 699 1.1 christos ldp d10,d11,[x0,#8*10] 700 1.1 christos ldp d12,d13,[x0,#8*12] 701 1.1 christos ldp d14,d15,[x0,#8*14] 702 1.1 christos ldp d16,d17,[x0,#8*16] 703 1.1 christos ldp d18,d19,[x0,#8*18] 704 1.1 christos ldp d20,d21,[x0,#8*20] 705 1.1 christos ldp d22,d23,[x0,#8*22] 706 1.1 christos ldr d24,[x0,#8*24] 707 1.1 christos bl KeccakF1600_ce 708 1.1 christos ldr x30,[sp,#8] 709 1.1 christos stp d0,d1,[x0,#8*0] 710 1.1 christos stp d2,d3,[x0,#8*2] 711 1.1 christos stp d4,d5,[x0,#8*4] 712 1.1 christos stp d6,d7,[x0,#8*6] 713 1.1 christos stp d8,d9,[x0,#8*8] 714 1.1 christos stp d10,d11,[x0,#8*10] 715 1.1 christos stp d12,d13,[x0,#8*12] 716 1.1 christos stp d14,d15,[x0,#8*14] 717 1.1 christos stp d16,d17,[x0,#8*16] 718 1.1 christos stp d18,d19,[x0,#8*18] 719 1.1 christos stp d20,d21,[x0,#8*20] 720 1.1 christos stp d22,d23,[x0,#8*22] 721 1.1 christos str d24,[x0,#8*24] 722 1.1 christos 723 1.1 christos ldp d8,d9,[sp,#16] 724 1.1 christos ldp d10,d11,[sp,#32] 725 1.1 christos ldp d12,d13,[sp,#48] 726 1.1 christos ldp d14,d15,[sp,#64] 727 1.1 christos ldr x29,[sp],#80 728 1.2 christos AARCH64_VALIDATE_LINK_REGISTER 729 1.1 christos ret 730 1.1 christos .size KeccakF1600_cext,.-KeccakF1600_cext 731 1.1 christos .globl SHA3_absorb_cext 732 1.1 christos .type SHA3_absorb_cext,%function 733 1.1 christos .align 5 734 1.1 christos SHA3_absorb_cext: 735 1.2 christos AARCH64_SIGN_LINK_REGISTER 736 1.1 christos stp x29,x30,[sp,#-80]! 737 1.1 christos add x29,sp,#0 738 1.1 christos stp d8,d9,[sp,#16] // per ABI requirement 739 1.1 christos stp d10,d11,[sp,#32] 740 1.1 christos stp d12,d13,[sp,#48] 741 1.1 christos stp d14,d15,[sp,#64] 742 1.1 christos ldp d0,d1,[x0,#8*0] 743 1.1 christos ldp d2,d3,[x0,#8*2] 744 1.1 christos ldp d4,d5,[x0,#8*4] 745 1.1 christos ldp d6,d7,[x0,#8*6] 746 1.1 christos ldp d8,d9,[x0,#8*8] 747 1.1 christos ldp d10,d11,[x0,#8*10] 748 1.1 christos ldp d12,d13,[x0,#8*12] 749 1.1 christos ldp d14,d15,[x0,#8*14] 750 1.1 christos ldp d16,d17,[x0,#8*16] 751 1.1 christos ldp d18,d19,[x0,#8*18] 752 1.1 christos ldp d20,d21,[x0,#8*20] 753 1.1 christos ldp d22,d23,[x0,#8*22] 754 1.1 christos ldr d24,[x0,#8*24] 755 1.1 christos b .Loop_absorb_ce 756 1.1 christos 757 1.1 christos .align 4 758 1.1 christos .Loop_absorb_ce: 759 1.1 christos subs x2,x2,x3 // len - bsz 760 1.1 christos blo .Labsorbed_ce 761 1.1 christos ldr d31,[x1],#8 // *inp++ 762 1.1 christos #ifdef __AARCH64EB__ 763 1.1 christos rev64 v31.16b,v31.16b 764 1.1 christos #endif 765 1.1 christos eor v0.16b,v0.16b,v31.16b 766 1.1 christos cmp x3,#8*(0+2) 767 1.1 christos blo .Lprocess_block_ce 768 1.1 christos ldr d31,[x1],#8 // *inp++ 769 1.1 christos #ifdef __AARCH64EB__ 770 1.1 christos rev64 v31.16b,v31.16b 771 1.1 christos #endif 772 1.1 christos eor v1.16b,v1.16b,v31.16b 773 1.1 christos beq .Lprocess_block_ce 774 1.1 christos ldr d31,[x1],#8 // *inp++ 775 1.1 christos #ifdef __AARCH64EB__ 776 1.1 christos rev64 v31.16b,v31.16b 777 1.1 christos #endif 778 1.1 christos eor v2.16b,v2.16b,v31.16b 779 1.1 christos cmp x3,#8*(2+2) 780 1.1 christos blo .Lprocess_block_ce 781 1.1 christos ldr d31,[x1],#8 // *inp++ 782 1.1 christos #ifdef __AARCH64EB__ 783 1.1 christos rev64 v31.16b,v31.16b 784 1.1 christos #endif 785 1.1 christos eor v3.16b,v3.16b,v31.16b 786 1.1 christos beq .Lprocess_block_ce 787 1.1 christos ldr d31,[x1],#8 // *inp++ 788 1.1 christos #ifdef __AARCH64EB__ 789 1.1 christos rev64 v31.16b,v31.16b 790 1.1 christos #endif 791 1.1 christos eor v4.16b,v4.16b,v31.16b 792 1.1 christos cmp x3,#8*(4+2) 793 1.1 christos blo .Lprocess_block_ce 794 1.1 christos ldr d31,[x1],#8 // *inp++ 795 1.1 christos #ifdef __AARCH64EB__ 796 1.1 christos rev64 v31.16b,v31.16b 797 1.1 christos #endif 798 1.1 christos eor v5.16b,v5.16b,v31.16b 799 1.1 christos beq .Lprocess_block_ce 800 1.1 christos ldr d31,[x1],#8 // *inp++ 801 1.1 christos #ifdef __AARCH64EB__ 802 1.1 christos rev64 v31.16b,v31.16b 803 1.1 christos #endif 804 1.1 christos eor v6.16b,v6.16b,v31.16b 805 1.1 christos cmp x3,#8*(6+2) 806 1.1 christos blo .Lprocess_block_ce 807 1.1 christos ldr d31,[x1],#8 // *inp++ 808 1.1 christos #ifdef __AARCH64EB__ 809 1.1 christos rev64 v31.16b,v31.16b 810 1.1 christos #endif 811 1.1 christos eor v7.16b,v7.16b,v31.16b 812 1.1 christos beq .Lprocess_block_ce 813 1.1 christos ldr d31,[x1],#8 // *inp++ 814 1.1 christos #ifdef __AARCH64EB__ 815 1.1 christos rev64 v31.16b,v31.16b 816 1.1 christos #endif 817 1.1 christos eor v8.16b,v8.16b,v31.16b 818 1.1 christos cmp x3,#8*(8+2) 819 1.1 christos blo .Lprocess_block_ce 820 1.1 christos ldr d31,[x1],#8 // *inp++ 821 1.1 christos #ifdef __AARCH64EB__ 822 1.1 christos rev64 v31.16b,v31.16b 823 1.1 christos #endif 824 1.1 christos eor v9.16b,v9.16b,v31.16b 825 1.1 christos beq .Lprocess_block_ce 826 1.1 christos ldr d31,[x1],#8 // *inp++ 827 1.1 christos #ifdef __AARCH64EB__ 828 1.1 christos rev64 v31.16b,v31.16b 829 1.1 christos #endif 830 1.1 christos eor v10.16b,v10.16b,v31.16b 831 1.1 christos cmp x3,#8*(10+2) 832 1.1 christos blo .Lprocess_block_ce 833 1.1 christos ldr d31,[x1],#8 // *inp++ 834 1.1 christos #ifdef __AARCH64EB__ 835 1.1 christos rev64 v31.16b,v31.16b 836 1.1 christos #endif 837 1.1 christos eor v11.16b,v11.16b,v31.16b 838 1.1 christos beq .Lprocess_block_ce 839 1.1 christos ldr d31,[x1],#8 // *inp++ 840 1.1 christos #ifdef __AARCH64EB__ 841 1.1 christos rev64 v31.16b,v31.16b 842 1.1 christos #endif 843 1.1 christos eor v12.16b,v12.16b,v31.16b 844 1.1 christos cmp x3,#8*(12+2) 845 1.1 christos blo .Lprocess_block_ce 846 1.1 christos ldr d31,[x1],#8 // *inp++ 847 1.1 christos #ifdef __AARCH64EB__ 848 1.1 christos rev64 v31.16b,v31.16b 849 1.1 christos #endif 850 1.1 christos eor v13.16b,v13.16b,v31.16b 851 1.1 christos beq .Lprocess_block_ce 852 1.1 christos ldr d31,[x1],#8 // *inp++ 853 1.1 christos #ifdef __AARCH64EB__ 854 1.1 christos rev64 v31.16b,v31.16b 855 1.1 christos #endif 856 1.1 christos eor v14.16b,v14.16b,v31.16b 857 1.1 christos cmp x3,#8*(14+2) 858 1.1 christos blo .Lprocess_block_ce 859 1.1 christos ldr d31,[x1],#8 // *inp++ 860 1.1 christos #ifdef __AARCH64EB__ 861 1.1 christos rev64 v31.16b,v31.16b 862 1.1 christos #endif 863 1.1 christos eor v15.16b,v15.16b,v31.16b 864 1.1 christos beq .Lprocess_block_ce 865 1.1 christos ldr d31,[x1],#8 // *inp++ 866 1.1 christos #ifdef __AARCH64EB__ 867 1.1 christos rev64 v31.16b,v31.16b 868 1.1 christos #endif 869 1.1 christos eor v16.16b,v16.16b,v31.16b 870 1.1 christos cmp x3,#8*(16+2) 871 1.1 christos blo .Lprocess_block_ce 872 1.1 christos ldr d31,[x1],#8 // *inp++ 873 1.1 christos #ifdef __AARCH64EB__ 874 1.1 christos rev64 v31.16b,v31.16b 875 1.1 christos #endif 876 1.1 christos eor v17.16b,v17.16b,v31.16b 877 1.1 christos beq .Lprocess_block_ce 878 1.1 christos ldr d31,[x1],#8 // *inp++ 879 1.1 christos #ifdef __AARCH64EB__ 880 1.1 christos rev64 v31.16b,v31.16b 881 1.1 christos #endif 882 1.1 christos eor v18.16b,v18.16b,v31.16b 883 1.1 christos cmp x3,#8*(18+2) 884 1.1 christos blo .Lprocess_block_ce 885 1.1 christos ldr d31,[x1],#8 // *inp++ 886 1.1 christos #ifdef __AARCH64EB__ 887 1.1 christos rev64 v31.16b,v31.16b 888 1.1 christos #endif 889 1.1 christos eor v19.16b,v19.16b,v31.16b 890 1.1 christos beq .Lprocess_block_ce 891 1.1 christos ldr d31,[x1],#8 // *inp++ 892 1.1 christos #ifdef __AARCH64EB__ 893 1.1 christos rev64 v31.16b,v31.16b 894 1.1 christos #endif 895 1.1 christos eor v20.16b,v20.16b,v31.16b 896 1.1 christos cmp x3,#8*(20+2) 897 1.1 christos blo .Lprocess_block_ce 898 1.1 christos ldr d31,[x1],#8 // *inp++ 899 1.1 christos #ifdef __AARCH64EB__ 900 1.1 christos rev64 v31.16b,v31.16b 901 1.1 christos #endif 902 1.1 christos eor v21.16b,v21.16b,v31.16b 903 1.1 christos beq .Lprocess_block_ce 904 1.1 christos ldr d31,[x1],#8 // *inp++ 905 1.1 christos #ifdef __AARCH64EB__ 906 1.1 christos rev64 v31.16b,v31.16b 907 1.1 christos #endif 908 1.1 christos eor v22.16b,v22.16b,v31.16b 909 1.1 christos cmp x3,#8*(22+2) 910 1.1 christos blo .Lprocess_block_ce 911 1.1 christos ldr d31,[x1],#8 // *inp++ 912 1.1 christos #ifdef __AARCH64EB__ 913 1.1 christos rev64 v31.16b,v31.16b 914 1.1 christos #endif 915 1.1 christos eor v23.16b,v23.16b,v31.16b 916 1.1 christos beq .Lprocess_block_ce 917 1.1 christos ldr d31,[x1],#8 // *inp++ 918 1.1 christos #ifdef __AARCH64EB__ 919 1.1 christos rev64 v31.16b,v31.16b 920 1.1 christos #endif 921 1.1 christos eor v24.16b,v24.16b,v31.16b 922 1.1 christos 923 1.1 christos .Lprocess_block_ce: 924 1.1 christos 925 1.1 christos bl KeccakF1600_ce 926 1.1 christos 927 1.1 christos b .Loop_absorb_ce 928 1.1 christos 929 1.1 christos .align 4 930 1.1 christos .Labsorbed_ce: 931 1.1 christos stp d0,d1,[x0,#8*0] 932 1.1 christos stp d2,d3,[x0,#8*2] 933 1.1 christos stp d4,d5,[x0,#8*4] 934 1.1 christos stp d6,d7,[x0,#8*6] 935 1.1 christos stp d8,d9,[x0,#8*8] 936 1.1 christos stp d10,d11,[x0,#8*10] 937 1.1 christos stp d12,d13,[x0,#8*12] 938 1.1 christos stp d14,d15,[x0,#8*14] 939 1.1 christos stp d16,d17,[x0,#8*16] 940 1.1 christos stp d18,d19,[x0,#8*18] 941 1.1 christos stp d20,d21,[x0,#8*20] 942 1.1 christos stp d22,d23,[x0,#8*22] 943 1.1 christos str d24,[x0,#8*24] 944 1.1 christos add x0,x2,x3 // return value 945 1.1 christos 946 1.1 christos ldp d8,d9,[sp,#16] 947 1.1 christos ldp d10,d11,[sp,#32] 948 1.1 christos ldp d12,d13,[sp,#48] 949 1.1 christos ldp d14,d15,[sp,#64] 950 1.1 christos ldp x29,x30,[sp],#80 951 1.2 christos AARCH64_VALIDATE_LINK_REGISTER 952 1.1 christos ret 953 1.1 christos .size SHA3_absorb_cext,.-SHA3_absorb_cext 954 1.1 christos .globl SHA3_squeeze_cext 955 1.1 christos .type SHA3_squeeze_cext,%function 956 1.1 christos .align 5 957 1.1 christos SHA3_squeeze_cext: 958 1.2 christos AARCH64_SIGN_LINK_REGISTER 959 1.1 christos stp x29,x30,[sp,#-16]! 960 1.1 christos add x29,sp,#0 961 1.1 christos mov x9,x0 962 1.1 christos mov x10,x3 963 1.1 christos 964 1.1 christos .Loop_squeeze_ce: 965 1.1 christos ldr x4,[x9],#8 966 1.1 christos cmp x2,#8 967 1.1 christos blo .Lsqueeze_tail_ce 968 1.1 christos #ifdef __AARCH64EB__ 969 1.1 christos rev x4,x4 970 1.1 christos #endif 971 1.1 christos str x4,[x1],#8 972 1.1 christos beq .Lsqueeze_done_ce 973 1.1 christos 974 1.1 christos sub x2,x2,#8 975 1.1 christos subs x10,x10,#8 976 1.1 christos bhi .Loop_squeeze_ce 977 1.1 christos 978 1.1 christos bl KeccakF1600_cext 979 1.1 christos ldr x30,[sp,#8] 980 1.1 christos mov x9,x0 981 1.1 christos mov x10,x3 982 1.1 christos b .Loop_squeeze_ce 983 1.1 christos 984 1.1 christos .align 4 985 1.1 christos .Lsqueeze_tail_ce: 986 1.1 christos strb w4,[x1],#1 987 1.1 christos lsr x4,x4,#8 988 1.1 christos subs x2,x2,#1 989 1.1 christos beq .Lsqueeze_done_ce 990 1.1 christos strb w4,[x1],#1 991 1.1 christos lsr x4,x4,#8 992 1.1 christos subs x2,x2,#1 993 1.1 christos beq .Lsqueeze_done_ce 994 1.1 christos strb w4,[x1],#1 995 1.1 christos lsr x4,x4,#8 996 1.1 christos subs x2,x2,#1 997 1.1 christos beq .Lsqueeze_done_ce 998 1.1 christos strb w4,[x1],#1 999 1.1 christos lsr x4,x4,#8 1000 1.1 christos subs x2,x2,#1 1001 1.1 christos beq .Lsqueeze_done_ce 1002 1.1 christos strb w4,[x1],#1 1003 1.1 christos lsr x4,x4,#8 1004 1.1 christos subs x2,x2,#1 1005 1.1 christos beq .Lsqueeze_done_ce 1006 1.1 christos strb w4,[x1],#1 1007 1.1 christos lsr x4,x4,#8 1008 1.1 christos subs x2,x2,#1 1009 1.1 christos beq .Lsqueeze_done_ce 1010 1.1 christos strb w4,[x1],#1 1011 1.1 christos 1012 1.1 christos .Lsqueeze_done_ce: 1013 1.1 christos ldr x29,[sp],#16 1014 1.2 christos AARCH64_VALIDATE_LINK_REGISTER 1015 1.1 christos ret 1016 1.1 christos .size SHA3_squeeze_cext,.-SHA3_squeeze_cext 1017 1.1 christos .byte 75,101,99,99,97,107,45,49,54,48,48,32,97,98,115,111,114,98,32,97,110,100,32,115,113,117,101,101,122,101,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 1018 1.1 christos .align 2 1019