Debian Codegraph @

crypto_nG/merged25519/arm64-maa4-intmul/fe25519_mul.S

raw
1 #include "crypto_asm_property.h"
2 #include "crypto_asm_hidden.h"
3 // linker define fe25519_mul
4
5 /* Assembly for field multiplication */
6
7 .p2align 4
8 ASM_HIDDEN _CRYPTO_SHARED_NAMESPACE(fe25519_mul)
9 .globl _CRYPTO_SHARED_NAMESPACE(fe25519_mul)
10 ASM_HIDDEN CRYPTO_SHARED_NAMESPACE(fe25519_mul)
11 .globl CRYPTO_SHARED_NAMESPACE(fe25519_mul)
12
13 _CRYPTO_SHARED_NAMESPACE(fe25519_mul):
14 CRYPTO_SHARED_NAMESPACE(fe25519_mul):
15
16 ldp x3, x4, [x1, #0]
17 ldp x17, x18, [x2, #16]
18 ldp x7, x16, [x2, #0]
19 ldp x5, x6, [x1, #16]
20
21 mul x8, x3, x7
22 umulh x9, x3, x7
23 mul x1, x4, x7
24 adds x9, x9, x1
25 umulh x10, x4, x7
26 mul x1, x5, x7
27 adcs x10, x10, x1
28 umulh x11, x5, x7
29 mul x1, x6, x7
30 adcs x11, x11, x1
31 umulh x12, x6, x7
32 adc x12, x12, xzr
33
34 mul x2, x3, x16
35 umulh x7, x3, x16
36 mul x1, x4, x16
37 adds x7, x7, x1
38 umulh x15, x4, x16
39 mul x1, x5, x16
40 adcs x15, x15, x1
41 umulh x14, x5, x16
42 mul x1, x6, x16
43 adcs x14, x14, x1
44 umulh x13, x6, x16
45 adc x13, x13, xzr
46 adds x9, x9, x2
47 adcs x10, x10, x7
48 adcs x11, x11, x15
49 adcs x12, x12, x14
50 adc x13, x13, xzr
51
52 mul x2, x3, x17
53 umulh x7, x3, x17
54 mul x1, x4, x17
55 adds x7, x7, x1
56 umulh x16, x4, x17
57 mul x1, x5, x17
58 adcs x16, x16, x1
59 umulh x15, x5, x17
60 mul x1, x6, x17
61 adcs x15, x15, x1
62 umulh x14, x6, x17
63 adc x14, x14, xzr
64 adds x10, x10, x2
65 adcs x11, x11, x7
66 adcs x12, x12, x16
67 adcs x13, x13, x15
68 adc x14, x14, xzr
69
70 mul x2, x3, x18
71 umulh x7, x3, x18
72 mul x1, x4, x18
73 adds x7, x7, x1
74 umulh x16, x4, x18
75 mul x1, x5, x18
76 adcs x16, x16, x1
77 umulh x17, x5, x18
78 mul x1, x6, x18
79 adcs x17, x17, x1
80 umulh x15, x6, x18
81 adc x15, x15, xzr
82 adds x11, x11, x2
83 adcs x12, x12, x7
84 adcs x13, x13, x16
85 adcs x14, x14, x17
86 adc x15, x15, xzr
87
88 mov x18, #38
89 mul x1, x12, x18
90 umulh x4, x12, x18
91 adds x8, x8, x1
92 mul x1, x13, x18
93 umulh x5, x13, x18
94 adcs x9, x9, x1
95 mul x1, x14, x18
96 umulh x6, x14, x18
97 adcs x10, x10, x1
98 mul x1, x15, x18
99 umulh x7, x15, x18
100 adcs x11, x11, x1
101 cset x16, cs
102 adds x11, x11, x6
103 adc x7, x7, x16
104
105 cmn x11, x11
106 adc x7, x7, x7
107 mov x18, #19
108 mul x7, x7, x18
109
110 bic x11, x11, #0x8000000000000000
111 adds x8, x8, x7
112 adcs x9, x9, x4
113 adcs x10, x10, x5
114 adc x11, x11, xzr
115
116 stp x8, x9, [x0, #0]
117 stp x10, x11, [x0, #16]
118
119 ret
120 .section .note.GNU-stack,"",@progbits