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