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