circom/c/buildasm/old/buildfieldasm.js
c/buildasm/old/buildfieldasm.jsRaw
1const tester = require("../c/buildasm/buildzqfieldtester2.js");
2
3const bigInt = require("big-integer");
4
5const __P__ = new bigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617");
6
7
8describe("basic cases", function () {
9 this.timeout(100000);
10 it("should do basic tests", async () => {
11 await tester(__P__, [
12 ["add", 0, 0],
13 ["add", 0, 1],
14 ["add", 1, 0],
15 ["add", 1, 1],
16 ["add", 2, 1],
17 ["add", 2, 10],
18 ["add", -1, -1],
19 ["add", -20, -10],
20 ["add", "10604728079509999371218483608188593244163417117449316147628604036713980815027", "10604728079509999371218483608188593244163417117449316147628604036713980815027"],
21
22 ["mul", 0, 0],
23 ["mul", 0, 1],
24 ["mul", 1, 0],
25 ["mul", 1, 1],
26 ["mul", 2, 1],
27 ["mul", 2, 10],
28 ["mul", -1, -1],
29 ["mul", -20, -10],
30 ["mul", "10604728079509999371218483608188593244163417117449316147628604036713980815027", "10604728079509999371218483608188593244163417117449316147628604036713980815027"],
31 ]);
32 });
33});