Skip to content

Commit bcd2b30

Browse files
kwxmzliu41
andauthored
Conformance tests for BLS12_381 multiScalarMul operations (2) (#7369)
* Conformance tests for BLS12_381 multiScalarMul operations (2) * Forgot the tests... * Revert "Keep track of currency/token lengths in builtin Value (#7349)" (#7370) * Conformance tests for BLS12_381 multiScalarMul operations (2) * Forgot the tests... --------- Co-authored-by: Ziyang Liu <[email protected]>
1 parent 9000633 commit bcd2b30

File tree

123 files changed

+1997
-53
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+1997
-53
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Multi-scalar multiplication is the same as ordinary scalar multiplication for inputs of size 1.
2+
(program 1.0.0
3+
[(builtin bls12_381_G1_equal)
4+
[(builtin bls12_381_G1_multiScalarMul)
5+
(con (list integer) [-7843724524521392138901923801823923123123454352157])
6+
(con (list bls12_381_G1_element) [0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5])
7+
]
8+
[(builtin bls12_381_G1_scalarMul)
9+
(con integer -7843724524521392138901923801823923123123454352157)
10+
(con bls12_381_G1_element 0x950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5)
11+
]
12+
]
13+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
({cpu: 424034831
2+
| mem: 1437})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(program 1.0.0 (con bool True))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
-- Multi-scalar multiplication is itertated multiply-and-add.
2+
-- msm [n1,n2,n3,n4,n5,n6] [p1,p2,p3,p4,p5,p6] = n1*p1+(n2*p2+(n3*p3+(n4*p4+(n5*p5+n6*p6))))
3+
(program 1.0.0
4+
[(builtin bls12_381_G1_equal)
5+
[(builtin bls12_381_G1_multiScalarMul)
6+
(con (list integer)
7+
[ -7843724524521392138901923801823923123123454352157
8+
, 34527457238
9+
, 941957124591735785278457826354751745783452348102412301239547134528453782352345235423452345234523452345234512341423412341234
10+
, -7
11+
, 78438238
12+
, 123
13+
]
14+
)
15+
(con (list bls12_381_G1_element)
16+
[ 0xab5d1d67b495361c3297c721cf3c9dc510fc5055bdf92fefc1e67d91a00a765520150428eb4c2fb01902d41d5ca62d85
17+
, 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
18+
, 0xb1cdc04561c6bd93294fc05a3a27170ffdca767965cdd7f2ba6065d6805e9c3afbb64e68604ddce26401566a74b35fb4
19+
, 0x8b9120083e12fe72d41e1488078a84a6629c2d90e00c238152b4cba64c20994196a1f4de9132f44597b566c80f17d64a
20+
, 0x84a8c4b64514db1bedfab0baa53fbed998672626b4c715652583a504df9c44ad3fe106cb421694cc86b2f2371eacd28a
21+
, 0x8b9120083e12fe72d41e1488078a84a6629c2d90e00c238152b4cba64c20994196a1f4de9132f44597b566c80f17d64a
22+
]
23+
)
24+
]
25+
[(builtin bls12_381_G1_add)
26+
[(builtin bls12_381_G1_scalarMul)
27+
(con integer -7843724524521392138901923801823923123123454352157)
28+
(con bls12_381_G1_element 0xab5d1d67b495361c3297c721cf3c9dc510fc5055bdf92fefc1e67d91a00a765520150428eb4c2fb01902d41d5ca62d85)
29+
]
30+
[(builtin bls12_381_G1_add)
31+
[(builtin bls12_381_G1_scalarMul)
32+
(con integer 34527457238)
33+
(con bls12_381_G1_element 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
34+
]
35+
[(builtin bls12_381_G1_add)
36+
[(builtin bls12_381_G1_scalarMul)
37+
(con integer 941957124591735785278457826354751745783452348102412301239547134528453782352345235423452345234523452345234512341423412341234)
38+
(con bls12_381_G1_element 0xb1cdc04561c6bd93294fc05a3a27170ffdca767965cdd7f2ba6065d6805e9c3afbb64e68604ddce26401566a74b35fb4)
39+
]
40+
[(builtin bls12_381_G1_add)
41+
[(builtin bls12_381_G1_scalarMul)
42+
(con integer -7)
43+
(con bls12_381_G1_element 0x8b9120083e12fe72d41e1488078a84a6629c2d90e00c238152b4cba64c20994196a1f4de9132f44597b566c80f17d64a)
44+
]
45+
[(builtin bls12_381_G1_add)
46+
[(builtin bls12_381_G1_scalarMul)
47+
(con integer 78438238)
48+
(con bls12_381_G1_element 0x84a8c4b64514db1bedfab0baa53fbed998672626b4c715652583a504df9c44ad3fe106cb421694cc86b2f2371eacd28a)
49+
]
50+
[(builtin bls12_381_G1_scalarMul)
51+
(con integer 123)
52+
(con bls12_381_G1_element 0x8b9120083e12fe72d41e1488078a84a6629c2d90e00c238152b4cba64c20994196a1f4de9132f44597b566c80f17d64a)
53+
]
54+
]
55+
]
56+
]
57+
]
58+
]
59+
]
60+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
({cpu: 937187429
2+
| mem: 5617})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(program 1.0.0 (con bool True))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
-- Multi-scalar multiplication is itertated multiply-and-add.
2+
-- msm [n1,n2,n3,n4,n5,n6] [p1,p2,p3,p4,p5,p6] = n1*p1+(n2*p2+(n3*p3+(n4*p4+(n5*p5+n6*p6))))
3+
-- No infinite points in the input.
4+
(program 1.0.0
5+
[(builtin bls12_381_G1_equal)
6+
[(builtin bls12_381_G1_multiScalarMul)
7+
(con (list integer)
8+
[ -7843724524521392138901923801823923123123454352157
9+
, 34527457238
10+
, 941957124591735785278457826354751745783452348102412301239547134528453782352345235423452345234523452345234512341423412341234
11+
, -7
12+
, 78438238
13+
, 123
14+
]
15+
)
16+
(con (list bls12_381_G1_element)
17+
[ 0x89a1f2d2c350af95381b09f307e467ef4629aa3acd1c8eb6143d0a07bc072aa6c69635bcb3c83aab43a68e07f024f7b4
18+
, 0xb9d49de64b4f0743f603e44697bea32d6b8065fa64efc77b435bcd3adea5af55a958e33034fe2cd13c99280f2987537a
19+
, 0x93fd9bd18c19665db678479fb28a7aadce222986e894196bafd85d487d43a4bba22b66891d753f61e075c503b64f4166
20+
, 0x85613b4871d8b2e0353c135c0b94f50a9966c424f6a8ee9d12c646392a22c51498317a50acd891589b358113acea4e62
21+
, 0x8056aaf9b83cb4b3355ef95703832a03bcb9a6007bb1264908d4f27bc497aff4cacaed01c3e14c68914fb35327713bc5
22+
, 0x876d7c92a343dcb531b4c0f6b8f69f68a669deceb2a157f3fc3275133dcd3f663da0750f6edcd7b8fa89a2572c44950d
23+
]
24+
)
25+
]
26+
[(builtin bls12_381_G1_add)
27+
[(builtin bls12_381_G1_scalarMul)
28+
(con integer -7843724524521392138901923801823923123123454352157)
29+
(con bls12_381_G1_element 0x89a1f2d2c350af95381b09f307e467ef4629aa3acd1c8eb6143d0a07bc072aa6c69635bcb3c83aab43a68e07f024f7b4)
30+
]
31+
[(builtin bls12_381_G1_add)
32+
[(builtin bls12_381_G1_scalarMul)
33+
(con integer 34527457238)
34+
(con bls12_381_G1_element 0xb9d49de64b4f0743f603e44697bea32d6b8065fa64efc77b435bcd3adea5af55a958e33034fe2cd13c99280f2987537a)
35+
]
36+
[(builtin bls12_381_G1_add)
37+
[(builtin bls12_381_G1_scalarMul)
38+
(con integer 941957124591735785278457826354751745783452348102412301239547134528453782352345235423452345234523452345234512341423412341234)
39+
(con bls12_381_G1_element 0x93fd9bd18c19665db678479fb28a7aadce222986e894196bafd85d487d43a4bba22b66891d753f61e075c503b64f4166)
40+
]
41+
[(builtin bls12_381_G1_add)
42+
[(builtin bls12_381_G1_scalarMul)
43+
(con integer -7)
44+
(con bls12_381_G1_element 0x85613b4871d8b2e0353c135c0b94f50a9966c424f6a8ee9d12c646392a22c51498317a50acd891589b358113acea4e62)
45+
]
46+
[(builtin bls12_381_G1_add)
47+
[(builtin bls12_381_G1_scalarMul)
48+
(con integer 78438238)
49+
(con bls12_381_G1_element 0x8056aaf9b83cb4b3355ef95703832a03bcb9a6007bb1264908d4f27bc497aff4cacaed01c3e14c68914fb35327713bc5)
50+
]
51+
[(builtin bls12_381_G1_scalarMul)
52+
(con integer 123)
53+
(con bls12_381_G1_element 0x876d7c92a343dcb531b4c0f6b8f69f68a669deceb2a157f3fc3275133dcd3f663da0750f6edcd7b8fa89a2572c44950d)
54+
]
55+
]
56+
]
57+
]
58+
]
59+
]
60+
]
61+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
({cpu: 937187429
2+
| mem: 5617})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(program 1.0.0 (con bool True))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
-- Multi-scalar multiplication is itertated multiply-and-add.
2+
-- msm [n1,n2,n3,n4,n5,n6] [p1,p2,p3,p4,p5,p6] = ((((n1*p1+n2*p2)+n3*p3)+n4*p4)+n5*p5)+n6*p6
3+
(program 1.0.0
4+
[(builtin bls12_381_G1_equal)
5+
[(builtin bls12_381_G1_multiScalarMul)
6+
(con (list integer)
7+
[ -7843724524521392138901923801823923123123454352157
8+
, 34527457238
9+
, 941957124591735785278457826354751745783452348102412301239547134528453782352345235423452345234523452345234512341423412341234
10+
, -7
11+
, 78438238
12+
, 123
13+
]
14+
)
15+
(con (list bls12_381_G1_element)
16+
[ 0xab5d1d67b495361c3297c721cf3c9dc510fc5055bdf92fefc1e67d91a00a765520150428eb4c2fb01902d41d5ca62d85
17+
, 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
18+
, 0xb1cdc04561c6bd93294fc05a3a27170ffdca767965cdd7f2ba6065d6805e9c3afbb64e68604ddce26401566a74b35fb4
19+
, 0x8b9120083e12fe72d41e1488078a84a6629c2d90e00c238152b4cba64c20994196a1f4de9132f44597b566c80f17d64a
20+
, 0x84a8c4b64514db1bedfab0baa53fbed998672626b4c715652583a504df9c44ad3fe106cb421694cc86b2f2371eacd28a
21+
, 0x8b9120083e12fe72d41e1488078a84a6629c2d90e00c238152b4cba64c20994196a1f4de9132f44597b566c80f17d64a
22+
]
23+
)
24+
]
25+
[(builtin bls12_381_G1_add)
26+
[(builtin bls12_381_G1_add)
27+
[(builtin bls12_381_G1_add)
28+
[(builtin bls12_381_G1_add)
29+
[(builtin bls12_381_G1_add)
30+
[(builtin bls12_381_G1_scalarMul)
31+
(con integer -7843724524521392138901923801823923123123454352157)
32+
(con bls12_381_G1_element 0xab5d1d67b495361c3297c721cf3c9dc510fc5055bdf92fefc1e67d91a00a765520150428eb4c2fb01902d41d5ca62d85)
33+
]
34+
[(builtin bls12_381_G1_scalarMul)
35+
(con integer 34527457238)
36+
(con bls12_381_G1_element 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
37+
]
38+
]
39+
[(builtin bls12_381_G1_scalarMul)
40+
(con integer 941957124591735785278457826354751745783452348102412301239547134528453782352345235423452345234523452345234512341423412341234)
41+
(con bls12_381_G1_element 0xb1cdc04561c6bd93294fc05a3a27170ffdca767965cdd7f2ba6065d6805e9c3afbb64e68604ddce26401566a74b35fb4)
42+
]
43+
]
44+
[(builtin bls12_381_G1_scalarMul)
45+
(con integer -7)
46+
(con bls12_381_G1_element 0x8b9120083e12fe72d41e1488078a84a6629c2d90e00c238152b4cba64c20994196a1f4de9132f44597b566c80f17d64a)
47+
]
48+
]
49+
[(builtin bls12_381_G1_scalarMul)
50+
(con integer 78438238)
51+
(con bls12_381_G1_element 0x84a8c4b64514db1bedfab0baa53fbed998672626b4c715652583a504df9c44ad3fe106cb421694cc86b2f2371eacd28a)
52+
]
53+
]
54+
[(builtin bls12_381_G1_scalarMul)
55+
(con integer 123)
56+
(con bls12_381_G1_element 0x8b9120083e12fe72d41e1488078a84a6629c2d90e00c238152b4cba64c20994196a1f4de9132f44597b566c80f17d64a)
57+
]
58+
]
59+
]
60+
)

0 commit comments

Comments
 (0)