arnaucube
arnaucube/circomPublic Self-hosted repository
circom/ports/c/buildasm/fr.asm.ejs
ports/c/buildasm/fr.asm.ejsRaw
 1
 2
 3        global <%=name%>_copy
 4        global <%=name%>_copyn
 5        global <%=name%>_add
 6        global <%=name%>_sub
 7        global <%=name%>_neg
 8        global <%=name%>_mul
 9        global <%=name%>_square
10        global <%=name%>_band
11        global <%=name%>_bor
12        global <%=name%>_bxor
13        global <%=name%>_bnot
14        global <%=name%>_eq
15        global <%=name%>_neq
16        global <%=name%>_lt
17        global <%=name%>_gt
18        global <%=name%>_leq
19        global <%=name%>_geq
20        global <%=name%>_land
21        global <%=name%>_lor
22        global <%=name%>_lnot
23        global <%=name%>_toNormal
24        global <%=name%>_toLongNormal
25        global <%=name%>_toMontgomery
26        global <%=name%>_toInt
27        global <%=name%>_isTrue
28        global <%=name%>_q
29        extern <%=name%>_fail
30        DEFAULT REL
31
32        section .text
33<%- include('utils.asm.ejs'); %>
34<%- include('copy.asm.ejs'); %>
35<%- include('montgomery.asm.ejs'); %>
36<%- include('add.asm.ejs'); %>
37<%- include('sub.asm.ejs'); %>
38<%- include('neg.asm.ejs'); %>
39<%- include('mul.asm.ejs'); %>
40<%- include('binops.asm.ejs'); %>
41<%- include('cmpops.asm.ejs'); %>
42<%- include('logicalops.asm.ejs'); %>
43
44        section .data
45<%=name%>_q:
46        dd      0
47        dd      0x80000000
48q       dq      <%= constantElement(q) %>
49half    dq      <%= constantElement(q.shiftRight(1)) %>
50R2      dq      <%= constantElement(bigInt.one.shiftLeft(n64*64*2).mod(q)) %>
51R3      dq      <%= constantElement(bigInt.one.shiftLeft(n64*64*3).mod(q)) %>
52lboMask dq      0x<%= bigInt("10000000000000000",16).shiftRight(n64*64 - q.bitLength()).minus(bigInt.one).toString(16) %>
53