5 # define WORD64(hi0,lo0,hi1,lo1) .word lo0,hi0, lo1,hi1
9 # define WORD64(hi0,lo0,hi1,lo1) .word hi0,lo0, hi1,lo1
17 WORD64(0x428a2f98,0xd728ae22, 0x71374491,0x23ef65cd)
18 WORD64(0xb5c0fbcf,0xec4d3b2f, 0xe9b5dba5,0x8189dbbc)
19 WORD64(0x3956c25b,0xf348b538, 0x59f111f1,0xb605d019)
20 WORD64(0x923f82a4,0xaf194f9b, 0xab1c5ed5,0xda6d8118)
21 WORD64(0xd807aa98,0xa3030242, 0x12835b01,0x45706fbe)
22 WORD64(0x243185be,0x4ee4b28c, 0x550c7dc3,0xd5ffb4e2)
23 WORD64(0x72be5d74,0xf27b896f, 0x80deb1fe,0x3b1696b1)
24 WORD64(0x9bdc06a7,0x25c71235, 0xc19bf174,0xcf692694)
25 WORD64(0xe49b69c1,0x9ef14ad2, 0xefbe4786,0x384f25e3)
26 WORD64(0x0fc19dc6,0x8b8cd5b5, 0x240ca1cc,0x77ac9c65)
27 WORD64(0x2de92c6f,0x592b0275, 0x4a7484aa,0x6ea6e483)
28 WORD64(0x5cb0a9dc,0xbd41fbd4, 0x76f988da,0x831153b5)
29 WORD64(0x983e5152,0xee66dfab, 0xa831c66d,0x2db43210)
30 WORD64(0xb00327c8,0x98fb213f, 0xbf597fc7,0xbeef0ee4)
31 WORD64(0xc6e00bf3,0x3da88fc2, 0xd5a79147,0x930aa725)
32 WORD64(0x06ca6351,0xe003826f, 0x14292967,0x0a0e6e70)
33 WORD64(0x27b70a85,0x46d22ffc, 0x2e1b2138,0x5c26c926)
34 WORD64(0x4d2c6dfc,0x5ac42aed, 0x53380d13,0x9d95b3df)
35 WORD64(0x650a7354,0x8baf63de, 0x766a0abb,0x3c77b2a8)
36 WORD64(0x81c2c92e,0x47edaee6, 0x92722c85,0x1482353b)
37 WORD64(0xa2bfe8a1,0x4cf10364, 0xa81a664b,0xbc423001)
38 WORD64(0xc24b8b70,0xd0f89791, 0xc76c51a3,0x0654be30)
39 WORD64(0xd192e819,0xd6ef5218, 0xd6990624,0x5565a910)
40 WORD64(0xf40e3585,0x5771202a, 0x106aa070,0x32bbd1b8)
41 WORD64(0x19a4c116,0xb8d2d0c8, 0x1e376c08,0x5141ab53)
42 WORD64(0x2748774c,0xdf8eeb99, 0x34b0bcb5,0xe19b48a8)
43 WORD64(0x391c0cb3,0xc5c95a63, 0x4ed8aa4a,0xe3418acb)
44 WORD64(0x5b9cca4f,0x7763e373, 0x682e6ff3,0xd6b2b8a3)
45 WORD64(0x748f82ee,0x5defb2fc, 0x78a5636f,0x43172f60)
46 WORD64(0x84c87814,0xa1f0ab72, 0x8cc70208,0x1a6439ec)
47 WORD64(0x90befffa,0x23631e28, 0xa4506ceb,0xde82bde9)
48 WORD64(0xbef9a3f7,0xb2c67915, 0xc67178f2,0xe372532b)
49 WORD64(0xca273ece,0xea26619c, 0xd186b8c7,0x21c0c207)
50 WORD64(0xeada7dd6,0xcde0eb1e, 0xf57d4f7f,0xee6ed178)
51 WORD64(0x06f067aa,0x72176fba, 0x0a637dc5,0xa2c898a6)
52 WORD64(0x113f9804,0xbef90dae, 0x1b710b35,0x131c471b)
53 WORD64(0x28db77f5,0x23047d84, 0x32caab7b,0x40c72493)
54 WORD64(0x3c9ebe0a,0x15c9bebc, 0x431d67c4,0x9c100d4c)
55 WORD64(0x4cc5d4be,0xcb3e42b6, 0x597f299c,0xfc657e2a)
56 WORD64(0x5fcb6fab,0x3ad6faec, 0x6c44198c,0x4a475817)
58 #if __ARM_MAX_ARCH__>=7
60 .word OPENSSL_armcap_P-sha512_block_data_order
66 .global sha512_block_data_order
67 .type sha512_block_data_order,%function
68 sha512_block_data_order:
69 sub r3,pc,#8 @ sha512_block_data_order
70 add r2,r1,r2,lsl#7 @ len to point at the end of inp
71 #if __ARM_MAX_ARCH__>=7
72 ldr r12,.LOPENSSL_armcap
73 ldr r12,[r3,r12] @ OPENSSL_armcap_P
78 sub r14,r3,#672 @ K512
135 @ Sigma1(x) (ROTR((x),14) ^ ROTR((x),18) ^ ROTR((x),41))
136 @ LO lo>>14^hi<<18 ^ lo>>18^hi<<14 ^ hi>>9^lo<<23
137 @ HI hi>>14^lo<<18 ^ hi>>18^lo<<14 ^ lo>>9^hi<<23
143 ldr r11,[sp,#56+0] @ h.lo
144 eor r10,r10,r7,lsl#18
145 ldr r12,[sp,#56+4] @ h.hi
147 eor r10,r10,r8,lsr#18
149 eor r10,r10,r7,lsl#14
153 eor r10,r10,r8,lsl#23 @ Sigma1(e)
155 ldr r9,[sp,#40+0] @ f.lo
156 adc r4,r4,r10 @ T += Sigma1(e)
157 ldr r10,[sp,#40+4] @ f.hi
159 ldr r11,[sp,#48+0] @ g.lo
160 adc r4,r4,r12 @ T += h
161 ldr r12,[sp,#48+4] @ g.hi
172 ldr r11,[r14,#LO] @ K[i].lo
173 eor r10,r10,r12 @ Ch(e,f,g)
174 ldr r12,[r14,#HI] @ K[i].hi
177 ldr r7,[sp,#24+0] @ d.lo
178 adc r4,r4,r10 @ T += Ch(e,f,g)
179 ldr r8,[sp,#24+4] @ d.hi
182 adc r4,r4,r12 @ T += K[i]
184 ldr r11,[sp,#8+0] @ b.lo
185 adc r8,r8,r4 @ d += T
188 ldr r12,[sp,#16+0] @ c.lo
190 @ Sigma0(x) (ROTR((x),28) ^ ROTR((x),34) ^ ROTR((x),39))
191 @ LO lo>>28^hi<<4 ^ hi>>2^lo<<30 ^ hi>>7^lo<<25
192 @ HI hi>>28^lo<<4 ^ lo>>2^hi<<30 ^ lo>>7^hi<<25
200 eor r10,r10,r6,lsl#30
204 eor r10,r10,r6,lsl#25 @ Sigma0(a)
207 adc r4,r4,r10 @ T += Sigma0(a)
209 ldr r10,[sp,#8+4] @ b.hi
211 ldr r11,[sp,#16+4] @ c.hi
215 orr r5,r5,r9 @ Maj(a,b,c).lo
218 orr r6,r6,r12 @ Maj(a,b,c).hi
220 adc r6,r6,r4 @ h += T
229 @ sigma0(x) (ROTR((x),1) ^ ROTR((x),8) ^ ((x)>>7))
230 @ LO lo>>1^hi<<31 ^ lo>>8^hi<<24 ^ lo>>7^hi<<25
231 @ HI hi>>1^lo<<31 ^ hi>>8^lo<<24 ^ hi>>7
246 @ sigma1(x) (ROTR((x),19) ^ ROTR((x),61) ^ ((x)>>6))
247 @ LO lo>>19^hi<<13 ^ hi>>29^lo<<3 ^ lo>>6^hi<<26
248 @ HI hi>>19^lo<<13 ^ lo>>29^hi<<3 ^ hi>>6
252 eor r10,r10,r11,lsl#13
254 eor r10,r10,r11,lsr#29
256 eor r10,r10,r12,lsl#3
258 eor r10,r10,r12,lsr#6
272 @ Sigma1(x) (ROTR((x),14) ^ ROTR((x),18) ^ ROTR((x),41))
273 @ LO lo>>14^hi<<18 ^ lo>>18^hi<<14 ^ hi>>9^lo<<23
274 @ HI hi>>14^lo<<18 ^ hi>>18^lo<<14 ^ lo>>9^hi<<23
280 ldr r11,[sp,#56+0] @ h.lo
281 eor r10,r10,r7,lsl#18
282 ldr r12,[sp,#56+4] @ h.hi
284 eor r10,r10,r8,lsr#18
286 eor r10,r10,r7,lsl#14
290 eor r10,r10,r8,lsl#23 @ Sigma1(e)
292 ldr r9,[sp,#40+0] @ f.lo
293 adc r4,r4,r10 @ T += Sigma1(e)
294 ldr r10,[sp,#40+4] @ f.hi
296 ldr r11,[sp,#48+0] @ g.lo
297 adc r4,r4,r12 @ T += h
298 ldr r12,[sp,#48+4] @ g.hi
309 ldr r11,[r14,#LO] @ K[i].lo
310 eor r10,r10,r12 @ Ch(e,f,g)
311 ldr r12,[r14,#HI] @ K[i].hi
314 ldr r7,[sp,#24+0] @ d.lo
315 adc r4,r4,r10 @ T += Ch(e,f,g)
316 ldr r8,[sp,#24+4] @ d.hi
319 adc r4,r4,r12 @ T += K[i]
321 ldr r11,[sp,#8+0] @ b.lo
322 adc r8,r8,r4 @ d += T
325 ldr r12,[sp,#16+0] @ c.lo
327 @ Sigma0(x) (ROTR((x),28) ^ ROTR((x),34) ^ ROTR((x),39))
328 @ LO lo>>28^hi<<4 ^ hi>>2^lo<<30 ^ hi>>7^lo<<25
329 @ HI hi>>28^lo<<4 ^ lo>>2^hi<<30 ^ lo>>7^hi<<25
337 eor r10,r10,r6,lsl#30
341 eor r10,r10,r6,lsl#25 @ Sigma0(a)
344 adc r4,r4,r10 @ T += Sigma0(a)
346 ldr r10,[sp,#8+4] @ b.hi
348 ldr r11,[sp,#16+4] @ c.hi
352 orr r5,r5,r9 @ Maj(a,b,c).lo
355 orr r6,r6,r12 @ Maj(a,b,c).hi
357 adc r6,r6,r4 @ h += T
361 ldreq r10,[sp,#184+4]
435 add sp,sp,#8*9 @ destroy frame
437 ldmia sp!,{r4-r12,pc}
439 ldmia sp!,{r4-r12,lr}
441 moveq pc,lr @ be binary compatible with V4, yet
442 .word 0xe12fff1e @ interoperable with Thumb ISA:-)
444 #if __ARM_MAX_ARCH__>=7
450 dmb @ errata #451034 on early Cortex A8
451 vstmdb sp!,{d8-d15} @ ABI specification says so
452 sub r3,r3,#672 @ K512
453 vldmia r0,{d16-d23} @ load context
455 vshr.u64 d24,d20,#14 @ 0
457 vld1.64 {d0},[r1]! @ handles unaligned
461 vadd.i64 d16,d30 @ h+=Maj from the past
464 vld1.64 {d28},[r3,:64]! @ K[i++]
469 #if 0<16 && defined(__ARMEL__)
473 vbsl d29,d21,d22 @ Ch(e,f,g)
475 veor d26,d25 @ Sigma1(e)
487 vbsl d30,d18,d17 @ Maj(a,b,c)
488 veor d23,d26 @ Sigma0(a)
492 vshr.u64 d24,d19,#14 @ 1
494 vld1.64 {d1},[r1]! @ handles unaligned
498 vadd.i64 d23,d30 @ h+=Maj from the past
501 vld1.64 {d28},[r3,:64]! @ K[i++]
506 #if 1<16 && defined(__ARMEL__)
510 vbsl d29,d20,d21 @ Ch(e,f,g)
512 veor d26,d25 @ Sigma1(e)
524 vbsl d30,d17,d16 @ Maj(a,b,c)
525 veor d22,d26 @ Sigma0(a)
529 vshr.u64 d24,d18,#14 @ 2
531 vld1.64 {d2},[r1]! @ handles unaligned
535 vadd.i64 d22,d30 @ h+=Maj from the past
538 vld1.64 {d28},[r3,:64]! @ K[i++]
543 #if 2<16 && defined(__ARMEL__)
547 vbsl d29,d19,d20 @ Ch(e,f,g)
549 veor d26,d25 @ Sigma1(e)
561 vbsl d30,d16,d23 @ Maj(a,b,c)
562 veor d21,d26 @ Sigma0(a)
566 vshr.u64 d24,d17,#14 @ 3
568 vld1.64 {d3},[r1]! @ handles unaligned
572 vadd.i64 d21,d30 @ h+=Maj from the past
575 vld1.64 {d28},[r3,:64]! @ K[i++]
580 #if 3<16 && defined(__ARMEL__)
584 vbsl d29,d18,d19 @ Ch(e,f,g)
586 veor d26,d25 @ Sigma1(e)
598 vbsl d30,d23,d22 @ Maj(a,b,c)
599 veor d20,d26 @ Sigma0(a)
603 vshr.u64 d24,d16,#14 @ 4
605 vld1.64 {d4},[r1]! @ handles unaligned
609 vadd.i64 d20,d30 @ h+=Maj from the past
612 vld1.64 {d28},[r3,:64]! @ K[i++]
617 #if 4<16 && defined(__ARMEL__)
621 vbsl d29,d17,d18 @ Ch(e,f,g)
623 veor d26,d25 @ Sigma1(e)
635 vbsl d30,d22,d21 @ Maj(a,b,c)
636 veor d19,d26 @ Sigma0(a)
640 vshr.u64 d24,d23,#14 @ 5
642 vld1.64 {d5},[r1]! @ handles unaligned
646 vadd.i64 d19,d30 @ h+=Maj from the past
649 vld1.64 {d28},[r3,:64]! @ K[i++]
654 #if 5<16 && defined(__ARMEL__)
658 vbsl d29,d16,d17 @ Ch(e,f,g)
660 veor d26,d25 @ Sigma1(e)
672 vbsl d30,d21,d20 @ Maj(a,b,c)
673 veor d18,d26 @ Sigma0(a)
677 vshr.u64 d24,d22,#14 @ 6
679 vld1.64 {d6},[r1]! @ handles unaligned
683 vadd.i64 d18,d30 @ h+=Maj from the past
686 vld1.64 {d28},[r3,:64]! @ K[i++]
691 #if 6<16 && defined(__ARMEL__)
695 vbsl d29,d23,d16 @ Ch(e,f,g)
697 veor d26,d25 @ Sigma1(e)
709 vbsl d30,d20,d19 @ Maj(a,b,c)
710 veor d17,d26 @ Sigma0(a)
714 vshr.u64 d24,d21,#14 @ 7
716 vld1.64 {d7},[r1]! @ handles unaligned
720 vadd.i64 d17,d30 @ h+=Maj from the past
723 vld1.64 {d28},[r3,:64]! @ K[i++]
728 #if 7<16 && defined(__ARMEL__)
732 vbsl d29,d22,d23 @ Ch(e,f,g)
734 veor d26,d25 @ Sigma1(e)
746 vbsl d30,d19,d18 @ Maj(a,b,c)
747 veor d16,d26 @ Sigma0(a)
751 vshr.u64 d24,d20,#14 @ 8
753 vld1.64 {d8},[r1]! @ handles unaligned
757 vadd.i64 d16,d30 @ h+=Maj from the past
760 vld1.64 {d28},[r3,:64]! @ K[i++]
765 #if 8<16 && defined(__ARMEL__)
769 vbsl d29,d21,d22 @ Ch(e,f,g)
771 veor d26,d25 @ Sigma1(e)
783 vbsl d30,d18,d17 @ Maj(a,b,c)
784 veor d23,d26 @ Sigma0(a)
788 vshr.u64 d24,d19,#14 @ 9
790 vld1.64 {d9},[r1]! @ handles unaligned
794 vadd.i64 d23,d30 @ h+=Maj from the past
797 vld1.64 {d28},[r3,:64]! @ K[i++]
802 #if 9<16 && defined(__ARMEL__)
806 vbsl d29,d20,d21 @ Ch(e,f,g)
808 veor d26,d25 @ Sigma1(e)
820 vbsl d30,d17,d16 @ Maj(a,b,c)
821 veor d22,d26 @ Sigma0(a)
825 vshr.u64 d24,d18,#14 @ 10
827 vld1.64 {d10},[r1]! @ handles unaligned
831 vadd.i64 d22,d30 @ h+=Maj from the past
834 vld1.64 {d28},[r3,:64]! @ K[i++]
839 #if 10<16 && defined(__ARMEL__)
843 vbsl d29,d19,d20 @ Ch(e,f,g)
845 veor d26,d25 @ Sigma1(e)
857 vbsl d30,d16,d23 @ Maj(a,b,c)
858 veor d21,d26 @ Sigma0(a)
862 vshr.u64 d24,d17,#14 @ 11
864 vld1.64 {d11},[r1]! @ handles unaligned
868 vadd.i64 d21,d30 @ h+=Maj from the past
871 vld1.64 {d28},[r3,:64]! @ K[i++]
876 #if 11<16 && defined(__ARMEL__)
880 vbsl d29,d18,d19 @ Ch(e,f,g)
882 veor d26,d25 @ Sigma1(e)
894 vbsl d30,d23,d22 @ Maj(a,b,c)
895 veor d20,d26 @ Sigma0(a)
899 vshr.u64 d24,d16,#14 @ 12
901 vld1.64 {d12},[r1]! @ handles unaligned
905 vadd.i64 d20,d30 @ h+=Maj from the past
908 vld1.64 {d28},[r3,:64]! @ K[i++]
913 #if 12<16 && defined(__ARMEL__)
917 vbsl d29,d17,d18 @ Ch(e,f,g)
919 veor d26,d25 @ Sigma1(e)
931 vbsl d30,d22,d21 @ Maj(a,b,c)
932 veor d19,d26 @ Sigma0(a)
936 vshr.u64 d24,d23,#14 @ 13
938 vld1.64 {d13},[r1]! @ handles unaligned
942 vadd.i64 d19,d30 @ h+=Maj from the past
945 vld1.64 {d28},[r3,:64]! @ K[i++]
950 #if 13<16 && defined(__ARMEL__)
954 vbsl d29,d16,d17 @ Ch(e,f,g)
956 veor d26,d25 @ Sigma1(e)
968 vbsl d30,d21,d20 @ Maj(a,b,c)
969 veor d18,d26 @ Sigma0(a)
973 vshr.u64 d24,d22,#14 @ 14
975 vld1.64 {d14},[r1]! @ handles unaligned
979 vadd.i64 d18,d30 @ h+=Maj from the past
982 vld1.64 {d28},[r3,:64]! @ K[i++]
987 #if 14<16 && defined(__ARMEL__)
991 vbsl d29,d23,d16 @ Ch(e,f,g)
993 veor d26,d25 @ Sigma1(e)
1005 vbsl d30,d20,d19 @ Maj(a,b,c)
1006 veor d17,d26 @ Sigma0(a)
1010 vshr.u64 d24,d21,#14 @ 15
1012 vld1.64 {d15},[r1]! @ handles unaligned
1014 vshr.u64 d25,d21,#18
1016 vadd.i64 d17,d30 @ h+=Maj from the past
1018 vshr.u64 d26,d21,#41
1019 vld1.64 {d28},[r3,:64]! @ K[i++]
1024 #if 15<16 && defined(__ARMEL__)
1028 vbsl d29,d22,d23 @ Ch(e,f,g)
1029 vshr.u64 d24,d17,#28
1030 veor d26,d25 @ Sigma1(e)
1031 vadd.i64 d27,d29,d16
1032 vshr.u64 d25,d17,#34
1035 vshr.u64 d26,d17,#39
1042 vbsl d30,d19,d18 @ Maj(a,b,c)
1043 veor d16,d26 @ Sigma0(a)
1052 vadd.i64 d16,d30 @ h+=Maj from the past
1055 vext.8 q14,q0,q1,#8 @ X[i+1]
1059 veor q15,q13 @ sigma1(X[i+14])
1065 vext.8 q14,q4,q5,#8 @ X[i+9]
1067 vshr.u64 d24,d20,#14 @ from NEON_00_15
1069 vshr.u64 d25,d20,#18 @ from NEON_00_15
1070 veor q15,q13 @ sigma0(X[i+1])
1071 vshr.u64 d26,d20,#41 @ from NEON_00_15
1073 vld1.64 {d28},[r3,:64]! @ K[i++]
1078 #if 16<16 && defined(__ARMEL__)
1082 vbsl d29,d21,d22 @ Ch(e,f,g)
1083 vshr.u64 d24,d16,#28
1084 veor d26,d25 @ Sigma1(e)
1085 vadd.i64 d27,d29,d23
1086 vshr.u64 d25,d16,#34
1089 vshr.u64 d26,d16,#39
1096 vbsl d30,d18,d17 @ Maj(a,b,c)
1097 veor d23,d26 @ Sigma0(a)
1101 vshr.u64 d24,d19,#14 @ 17
1103 vld1.64 {d1},[r1]! @ handles unaligned
1105 vshr.u64 d25,d19,#18
1107 vadd.i64 d23,d30 @ h+=Maj from the past
1109 vshr.u64 d26,d19,#41
1110 vld1.64 {d28},[r3,:64]! @ K[i++]
1115 #if 17<16 && defined(__ARMEL__)
1119 vbsl d29,d20,d21 @ Ch(e,f,g)
1120 vshr.u64 d24,d23,#28
1121 veor d26,d25 @ Sigma1(e)
1122 vadd.i64 d27,d29,d22
1123 vshr.u64 d25,d23,#34
1126 vshr.u64 d26,d23,#39
1133 vbsl d30,d17,d16 @ Maj(a,b,c)
1134 veor d22,d26 @ Sigma0(a)
1140 vadd.i64 d22,d30 @ h+=Maj from the past
1143 vext.8 q14,q1,q2,#8 @ X[i+1]
1147 veor q15,q13 @ sigma1(X[i+14])
1153 vext.8 q14,q5,q6,#8 @ X[i+9]
1155 vshr.u64 d24,d18,#14 @ from NEON_00_15
1157 vshr.u64 d25,d18,#18 @ from NEON_00_15
1158 veor q15,q13 @ sigma0(X[i+1])
1159 vshr.u64 d26,d18,#41 @ from NEON_00_15
1161 vld1.64 {d28},[r3,:64]! @ K[i++]
1166 #if 18<16 && defined(__ARMEL__)
1170 vbsl d29,d19,d20 @ Ch(e,f,g)
1171 vshr.u64 d24,d22,#28
1172 veor d26,d25 @ Sigma1(e)
1173 vadd.i64 d27,d29,d21
1174 vshr.u64 d25,d22,#34
1177 vshr.u64 d26,d22,#39
1184 vbsl d30,d16,d23 @ Maj(a,b,c)
1185 veor d21,d26 @ Sigma0(a)
1189 vshr.u64 d24,d17,#14 @ 19
1191 vld1.64 {d3},[r1]! @ handles unaligned
1193 vshr.u64 d25,d17,#18
1195 vadd.i64 d21,d30 @ h+=Maj from the past
1197 vshr.u64 d26,d17,#41
1198 vld1.64 {d28},[r3,:64]! @ K[i++]
1203 #if 19<16 && defined(__ARMEL__)
1207 vbsl d29,d18,d19 @ Ch(e,f,g)
1208 vshr.u64 d24,d21,#28
1209 veor d26,d25 @ Sigma1(e)
1210 vadd.i64 d27,d29,d20
1211 vshr.u64 d25,d21,#34
1214 vshr.u64 d26,d21,#39
1221 vbsl d30,d23,d22 @ Maj(a,b,c)
1222 veor d20,d26 @ Sigma0(a)
1228 vadd.i64 d20,d30 @ h+=Maj from the past
1231 vext.8 q14,q2,q3,#8 @ X[i+1]
1235 veor q15,q13 @ sigma1(X[i+14])
1241 vext.8 q14,q6,q7,#8 @ X[i+9]
1243 vshr.u64 d24,d16,#14 @ from NEON_00_15
1245 vshr.u64 d25,d16,#18 @ from NEON_00_15
1246 veor q15,q13 @ sigma0(X[i+1])
1247 vshr.u64 d26,d16,#41 @ from NEON_00_15
1249 vld1.64 {d28},[r3,:64]! @ K[i++]
1254 #if 20<16 && defined(__ARMEL__)
1258 vbsl d29,d17,d18 @ Ch(e,f,g)
1259 vshr.u64 d24,d20,#28
1260 veor d26,d25 @ Sigma1(e)
1261 vadd.i64 d27,d29,d19
1262 vshr.u64 d25,d20,#34
1265 vshr.u64 d26,d20,#39
1272 vbsl d30,d22,d21 @ Maj(a,b,c)
1273 veor d19,d26 @ Sigma0(a)
1277 vshr.u64 d24,d23,#14 @ 21
1279 vld1.64 {d5},[r1]! @ handles unaligned
1281 vshr.u64 d25,d23,#18
1283 vadd.i64 d19,d30 @ h+=Maj from the past
1285 vshr.u64 d26,d23,#41
1286 vld1.64 {d28},[r3,:64]! @ K[i++]
1291 #if 21<16 && defined(__ARMEL__)
1295 vbsl d29,d16,d17 @ Ch(e,f,g)
1296 vshr.u64 d24,d19,#28
1297 veor d26,d25 @ Sigma1(e)
1298 vadd.i64 d27,d29,d18
1299 vshr.u64 d25,d19,#34
1302 vshr.u64 d26,d19,#39
1309 vbsl d30,d21,d20 @ Maj(a,b,c)
1310 veor d18,d26 @ Sigma0(a)
1316 vadd.i64 d18,d30 @ h+=Maj from the past
1319 vext.8 q14,q3,q4,#8 @ X[i+1]
1323 veor q15,q13 @ sigma1(X[i+14])
1329 vext.8 q14,q7,q0,#8 @ X[i+9]
1331 vshr.u64 d24,d22,#14 @ from NEON_00_15
1333 vshr.u64 d25,d22,#18 @ from NEON_00_15
1334 veor q15,q13 @ sigma0(X[i+1])
1335 vshr.u64 d26,d22,#41 @ from NEON_00_15
1337 vld1.64 {d28},[r3,:64]! @ K[i++]
1342 #if 22<16 && defined(__ARMEL__)
1346 vbsl d29,d23,d16 @ Ch(e,f,g)
1347 vshr.u64 d24,d18,#28
1348 veor d26,d25 @ Sigma1(e)
1349 vadd.i64 d27,d29,d17
1350 vshr.u64 d25,d18,#34
1353 vshr.u64 d26,d18,#39
1360 vbsl d30,d20,d19 @ Maj(a,b,c)
1361 veor d17,d26 @ Sigma0(a)
1365 vshr.u64 d24,d21,#14 @ 23
1367 vld1.64 {d7},[r1]! @ handles unaligned
1369 vshr.u64 d25,d21,#18
1371 vadd.i64 d17,d30 @ h+=Maj from the past
1373 vshr.u64 d26,d21,#41
1374 vld1.64 {d28},[r3,:64]! @ K[i++]
1379 #if 23<16 && defined(__ARMEL__)
1383 vbsl d29,d22,d23 @ Ch(e,f,g)
1384 vshr.u64 d24,d17,#28
1385 veor d26,d25 @ Sigma1(e)
1386 vadd.i64 d27,d29,d16
1387 vshr.u64 d25,d17,#34
1390 vshr.u64 d26,d17,#39
1397 vbsl d30,d19,d18 @ Maj(a,b,c)
1398 veor d16,d26 @ Sigma0(a)
1404 vadd.i64 d16,d30 @ h+=Maj from the past
1407 vext.8 q14,q4,q5,#8 @ X[i+1]
1411 veor q15,q13 @ sigma1(X[i+14])
1417 vext.8 q14,q0,q1,#8 @ X[i+9]
1419 vshr.u64 d24,d20,#14 @ from NEON_00_15
1421 vshr.u64 d25,d20,#18 @ from NEON_00_15
1422 veor q15,q13 @ sigma0(X[i+1])
1423 vshr.u64 d26,d20,#41 @ from NEON_00_15
1425 vld1.64 {d28},[r3,:64]! @ K[i++]
1430 #if 24<16 && defined(__ARMEL__)
1434 vbsl d29,d21,d22 @ Ch(e,f,g)
1435 vshr.u64 d24,d16,#28
1436 veor d26,d25 @ Sigma1(e)
1437 vadd.i64 d27,d29,d23
1438 vshr.u64 d25,d16,#34
1441 vshr.u64 d26,d16,#39
1448 vbsl d30,d18,d17 @ Maj(a,b,c)
1449 veor d23,d26 @ Sigma0(a)
1453 vshr.u64 d24,d19,#14 @ 25
1455 vld1.64 {d9},[r1]! @ handles unaligned
1457 vshr.u64 d25,d19,#18
1459 vadd.i64 d23,d30 @ h+=Maj from the past
1461 vshr.u64 d26,d19,#41
1462 vld1.64 {d28},[r3,:64]! @ K[i++]
1467 #if 25<16 && defined(__ARMEL__)
1471 vbsl d29,d20,d21 @ Ch(e,f,g)
1472 vshr.u64 d24,d23,#28
1473 veor d26,d25 @ Sigma1(e)
1474 vadd.i64 d27,d29,d22
1475 vshr.u64 d25,d23,#34
1478 vshr.u64 d26,d23,#39
1485 vbsl d30,d17,d16 @ Maj(a,b,c)
1486 veor d22,d26 @ Sigma0(a)
1492 vadd.i64 d22,d30 @ h+=Maj from the past
1495 vext.8 q14,q5,q6,#8 @ X[i+1]
1499 veor q15,q13 @ sigma1(X[i+14])
1505 vext.8 q14,q1,q2,#8 @ X[i+9]
1507 vshr.u64 d24,d18,#14 @ from NEON_00_15
1509 vshr.u64 d25,d18,#18 @ from NEON_00_15
1510 veor q15,q13 @ sigma0(X[i+1])
1511 vshr.u64 d26,d18,#41 @ from NEON_00_15
1513 vld1.64 {d28},[r3,:64]! @ K[i++]
1518 #if 26<16 && defined(__ARMEL__)
1522 vbsl d29,d19,d20 @ Ch(e,f,g)
1523 vshr.u64 d24,d22,#28
1524 veor d26,d25 @ Sigma1(e)
1525 vadd.i64 d27,d29,d21
1526 vshr.u64 d25,d22,#34
1529 vshr.u64 d26,d22,#39
1536 vbsl d30,d16,d23 @ Maj(a,b,c)
1537 veor d21,d26 @ Sigma0(a)
1541 vshr.u64 d24,d17,#14 @ 27
1543 vld1.64 {d11},[r1]! @ handles unaligned
1545 vshr.u64 d25,d17,#18
1547 vadd.i64 d21,d30 @ h+=Maj from the past
1549 vshr.u64 d26,d17,#41
1550 vld1.64 {d28},[r3,:64]! @ K[i++]
1555 #if 27<16 && defined(__ARMEL__)
1559 vbsl d29,d18,d19 @ Ch(e,f,g)
1560 vshr.u64 d24,d21,#28
1561 veor d26,d25 @ Sigma1(e)
1562 vadd.i64 d27,d29,d20
1563 vshr.u64 d25,d21,#34
1566 vshr.u64 d26,d21,#39
1573 vbsl d30,d23,d22 @ Maj(a,b,c)
1574 veor d20,d26 @ Sigma0(a)
1580 vadd.i64 d20,d30 @ h+=Maj from the past
1583 vext.8 q14,q6,q7,#8 @ X[i+1]
1587 veor q15,q13 @ sigma1(X[i+14])
1593 vext.8 q14,q2,q3,#8 @ X[i+9]
1595 vshr.u64 d24,d16,#14 @ from NEON_00_15
1597 vshr.u64 d25,d16,#18 @ from NEON_00_15
1598 veor q15,q13 @ sigma0(X[i+1])
1599 vshr.u64 d26,d16,#41 @ from NEON_00_15
1601 vld1.64 {d28},[r3,:64]! @ K[i++]
1606 #if 28<16 && defined(__ARMEL__)
1610 vbsl d29,d17,d18 @ Ch(e,f,g)
1611 vshr.u64 d24,d20,#28
1612 veor d26,d25 @ Sigma1(e)
1613 vadd.i64 d27,d29,d19
1614 vshr.u64 d25,d20,#34
1617 vshr.u64 d26,d20,#39
1624 vbsl d30,d22,d21 @ Maj(a,b,c)
1625 veor d19,d26 @ Sigma0(a)
1629 vshr.u64 d24,d23,#14 @ 29
1631 vld1.64 {d13},[r1]! @ handles unaligned
1633 vshr.u64 d25,d23,#18
1635 vadd.i64 d19,d30 @ h+=Maj from the past
1637 vshr.u64 d26,d23,#41
1638 vld1.64 {d28},[r3,:64]! @ K[i++]
1643 #if 29<16 && defined(__ARMEL__)
1647 vbsl d29,d16,d17 @ Ch(e,f,g)
1648 vshr.u64 d24,d19,#28
1649 veor d26,d25 @ Sigma1(e)
1650 vadd.i64 d27,d29,d18
1651 vshr.u64 d25,d19,#34
1654 vshr.u64 d26,d19,#39
1661 vbsl d30,d21,d20 @ Maj(a,b,c)
1662 veor d18,d26 @ Sigma0(a)
1668 vadd.i64 d18,d30 @ h+=Maj from the past
1671 vext.8 q14,q7,q0,#8 @ X[i+1]
1675 veor q15,q13 @ sigma1(X[i+14])
1681 vext.8 q14,q3,q4,#8 @ X[i+9]
1683 vshr.u64 d24,d22,#14 @ from NEON_00_15
1685 vshr.u64 d25,d22,#18 @ from NEON_00_15
1686 veor q15,q13 @ sigma0(X[i+1])
1687 vshr.u64 d26,d22,#41 @ from NEON_00_15
1689 vld1.64 {d28},[r3,:64]! @ K[i++]
1694 #if 30<16 && defined(__ARMEL__)
1698 vbsl d29,d23,d16 @ Ch(e,f,g)
1699 vshr.u64 d24,d18,#28
1700 veor d26,d25 @ Sigma1(e)
1701 vadd.i64 d27,d29,d17
1702 vshr.u64 d25,d18,#34
1705 vshr.u64 d26,d18,#39
1712 vbsl d30,d20,d19 @ Maj(a,b,c)
1713 veor d17,d26 @ Sigma0(a)
1717 vshr.u64 d24,d21,#14 @ 31
1719 vld1.64 {d15},[r1]! @ handles unaligned
1721 vshr.u64 d25,d21,#18
1723 vadd.i64 d17,d30 @ h+=Maj from the past
1725 vshr.u64 d26,d21,#41
1726 vld1.64 {d28},[r3,:64]! @ K[i++]
1731 #if 31<16 && defined(__ARMEL__)
1735 vbsl d29,d22,d23 @ Ch(e,f,g)
1736 vshr.u64 d24,d17,#28
1737 veor d26,d25 @ Sigma1(e)
1738 vadd.i64 d27,d29,d16
1739 vshr.u64 d25,d17,#34
1742 vshr.u64 d26,d17,#39
1749 vbsl d30,d19,d18 @ Maj(a,b,c)
1750 veor d16,d26 @ Sigma0(a)
1756 vadd.i64 d16,d30 @ h+=Maj from the past
1757 vldmia r0,{d24-d31} @ load context to temp
1758 vadd.i64 q8,q12 @ vectorized accumulate
1762 vstmia r0,{d16-d23} @ save context
1764 sub r3,#640 @ rewind K512
1767 vldmia sp!,{d8-d15} @ epilogue
1768 bx lr @ .word 0xe12fff1e
1770 .size sha512_block_data_order,.-sha512_block_data_order
1771 .asciz "SHA512 block transform for ARMv4/NEON, CRYPTOGAMS by <appro@openssl.org>"
1773 #if __ARM_MAX_ARCH__>=7
1774 .comm OPENSSL_armcap_P,4,4
1775 .hidden OPENSSL_armcap_P