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%>_band
8 global <%=name%>_bor
9 global <%=name%>_bxor
10 global <%=name%>_eq
11 global <%=name%>_neq
12 global <%=name%>_lt
13 global <%=name%>_gt
14 global <%=name%>_leq
15 global <%=name%>_geq
16 global <%=name%>_toNormal
17 global <%=name%>_toMontgomery
18 global <%=name%>_q
19 DEFAULT REL
20
21 section .text
22<%- include('utils.asm.ejs'); %>
23<%- include('copy.asm.ejs'); %>
24<%- include('montgomery.asm.ejs'); %>
25<%- include('add.asm.ejs'); %>
26<%- include('sub.asm.ejs'); %>
27<%- include('neg.asm.ejs'); %>
28<%- include('mul.asm.ejs'); %>
29<%- include('binops.asm.ejs'); %>
30<%- include('cmpops.asm.ejs'); %>
31
32 section .data
33<%=name%>_q:
34 dd 0
35 dd 0x80000000
36q dq <%= constantElement(q) %>
37half dq <%= constantElement(q.shiftRight(1)) %>
38R2 dq <%= constantElement(bigInt.one.shiftLeft(n64*64*2).mod(q)) %>
39R3 dq <%= constantElement(bigInt.one.shiftLeft(n64*64*3).mod(q)) %>
40lboMask dq 0x<%= bigInt("8000000000000000",16).shiftRight(n64*64 - q.bitLength()).minus(bigInt.one).toString(16) %>
41