@@ -21,7 +21,7 @@ describe("mps", function () {
2121
2222 it ( "performs round 0" , function ( ) {
2323 for ( let i = 0 ; i < 3 ; i ++ ) {
24- mps . round0_process (
24+ mps . dkg_round0_process (
2525 i ,
2626 keypairs [ i ] . privateKey ,
2727 otherIndices [ i ] . map ( ( i ) => keypairs [ i ] . publicKey ) ,
@@ -34,7 +34,7 @@ describe("mps", function () {
3434
3535 before ( "performs round 0" , function ( ) {
3636 results1 = [ 0 , 1 , 2 ] . map ( ( i ) =>
37- mps . round0_process (
37+ mps . dkg_round0_process (
3838 i ,
3939 keypairs [ i ] . privateKey ,
4040 otherIndices [ i ] . map ( ( i ) => keypairs [ i ] . publicKey ) ,
@@ -45,7 +45,7 @@ describe("mps", function () {
4545
4646 it ( "performs round 1" , function ( ) {
4747 for ( let i = 0 ; i < 3 ; i ++ ) {
48- mps . round1_process (
48+ mps . dkg_round1_process (
4949 otherIndices [ i ] . map ( ( i ) => results1 [ i ] . msg ) ,
5050 results1 [ i ] . state ,
5151 ) ;
@@ -56,7 +56,7 @@ describe("mps", function () {
5656
5757 before ( "performs round 1" , function ( ) {
5858 results2 = [ 0 , 1 , 2 ] . map ( ( i ) =>
59- mps . round1_process (
59+ mps . dkg_round1_process (
6060 otherIndices [ i ] . map ( ( i ) => results1 [ i ] . msg ) ,
6161 results1 [ i ] . state ,
6262 ) ,
@@ -65,7 +65,7 @@ describe("mps", function () {
6565
6666 it ( "performs round 2" , function ( ) {
6767 const results3 = [ 0 , 1 , 2 ] . map ( ( i ) =>
68- mps . round2_process (
68+ mps . dkg_round2_process (
6969 otherIndices [ i ] . map ( ( i ) => results2 [ i ] . msg ) ,
7070 results2 [ i ] . state ,
7171 ) ,
@@ -88,7 +88,7 @@ describe("mps", function () {
8888 describe ( "round0_process" , function ( ) {
8989 it ( "does not panic on bad party size" , function ( ) {
9090 shouldThrow ( ( ) =>
91- mps . round0_process (
91+ mps . dkg_round0_process (
9292 "255" ,
9393 Buffer . alloc ( 32 ) ,
9494 [ Buffer . alloc ( 32 ) , Buffer . alloc ( 32 ) ] ,
@@ -99,15 +99,15 @@ describe("mps", function () {
9999
100100 it ( "does not panic on bad encryption key" , function ( ) {
101101 shouldThrow ( ( ) =>
102- mps . round0_process (
102+ mps . dkg_round0_process (
103103 0 ,
104104 "encryption key" ,
105105 [ Buffer . alloc ( 32 ) , Buffer . alloc ( 32 ) ] ,
106106 crypto . randomBytes ( 32 ) ,
107107 ) ,
108108 ) ;
109109 shouldThrow ( ( ) =>
110- mps . round0_process (
110+ mps . dkg_round0_process (
111111 0 ,
112112 Buffer . alloc ( 0 ) ,
113113 [ Buffer . alloc ( 32 ) , Buffer . alloc ( 32 ) ] ,
@@ -118,17 +118,17 @@ describe("mps", function () {
118118
119119 it ( "does not panic on bad decryption keys" , function ( ) {
120120 shouldThrow ( ( ) =>
121- mps . round0_process ( 0 , Buffer . alloc ( 0 ) , "decryption keys" , crypto . randomBytes ( 32 ) ) ,
121+ mps . dkg_round0_process ( 0 , Buffer . alloc ( 0 ) , "decryption keys" , crypto . randomBytes ( 32 ) ) ,
122122 ) ;
123- shouldThrow ( ( ) => mps . round0_process ( 0 , Buffer . alloc ( 0 ) , [ ] , crypto . randomBytes ( 32 ) ) ) ;
123+ shouldThrow ( ( ) => mps . dkg_round0_process ( 0 , Buffer . alloc ( 0 ) , [ ] , crypto . randomBytes ( 32 ) ) ) ;
124124 shouldThrow ( ( ) =>
125- mps . round0_process ( 0 , Buffer . alloc ( 0 ) , [ "decryption key" ] , crypto . randomBytes ( 32 ) ) ,
125+ mps . dkg_round0_process ( 0 , Buffer . alloc ( 0 ) , [ "decryption key" ] , crypto . randomBytes ( 32 ) ) ,
126126 ) ;
127127 shouldThrow ( ( ) =>
128- mps . round0_process ( 0 , Buffer . alloc ( 0 ) , [ Buffer . alloc ( 0 ) ] , crypto . randomBytes ( 32 ) ) ,
128+ mps . dkg_round0_process ( 0 , Buffer . alloc ( 0 ) , [ Buffer . alloc ( 0 ) ] , crypto . randomBytes ( 32 ) ) ,
129129 ) ;
130130 shouldThrow ( ( ) =>
131- mps . round0_process (
131+ mps . dkg_round0_process (
132132 0 ,
133133 Buffer . alloc ( 0 ) ,
134134 [ Buffer . alloc ( 32 ) , Buffer . alloc ( 0 ) ] ,
@@ -139,10 +139,10 @@ describe("mps", function () {
139139
140140 it ( "does not panic on bad seed" , function ( ) {
141141 shouldThrow ( ( ) =>
142- mps . round0_process ( 0 , Buffer . alloc ( 0 ) , [ Buffer . alloc ( 32 ) , Buffer . alloc ( 32 ) ] , "seed" ) ,
142+ mps . dkg_round0_process ( 0 , Buffer . alloc ( 0 ) , [ Buffer . alloc ( 32 ) , Buffer . alloc ( 32 ) ] , "seed" ) ,
143143 ) ;
144144 shouldThrow ( ( ) =>
145- mps . round0_process (
145+ mps . dkg_round0_process (
146146 0 ,
147147 Buffer . alloc ( 0 ) ,
148148 [ Buffer . alloc ( 32 ) , Buffer . alloc ( 32 ) ] ,
@@ -154,32 +154,32 @@ describe("mps", function () {
154154
155155 describe ( "round1_process" , function ( ) {
156156 it ( "does not panic on bad messages" , function ( ) {
157- shouldThrow ( ( ) => mps . round1_process ( "messages" , Buffer . alloc ( 1224 ) ) ) ;
158- shouldThrow ( ( ) => mps . round1_process ( [ ] , Buffer . alloc ( 1224 ) ) ) ;
159- shouldThrow ( ( ) => mps . round1_process ( [ "message" ] , Buffer . alloc ( 1224 ) ) ) ;
160- shouldThrow ( ( ) => mps . round1_process ( [ Buffer . alloc ( 0 ) , Buffer . alloc ( 1224 ) ] ) ) ;
157+ shouldThrow ( ( ) => mps . dkg_round1_process ( "messages" , Buffer . alloc ( 1224 ) ) ) ;
158+ shouldThrow ( ( ) => mps . dkg_round1_process ( [ ] , Buffer . alloc ( 1224 ) ) ) ;
159+ shouldThrow ( ( ) => mps . dkg_round1_process ( [ "message" ] , Buffer . alloc ( 1224 ) ) ) ;
160+ shouldThrow ( ( ) => mps . dkg_round1_process ( [ Buffer . alloc ( 0 ) , Buffer . alloc ( 1224 ) ] ) ) ;
161161 } ) ;
162162
163163 it ( "does not panic on bad state" , function ( ) {
164- shouldThrow ( ( ) => mps . round1_process ( [ Buffer . alloc ( 65 ) , Buffer . alloc ( 65 ) ] , "state" ) ) ;
164+ shouldThrow ( ( ) => mps . dkg_round1_process ( [ Buffer . alloc ( 65 ) , Buffer . alloc ( 65 ) ] , "state" ) ) ;
165165 shouldThrow ( ( ) =>
166- mps . round1_process ( [ Buffer . alloc ( 65 ) , Buffer . alloc ( 65 ) ] , Buffer . alloc ( 0 ) ) ,
166+ mps . dkg_round1_process ( [ Buffer . alloc ( 65 ) , Buffer . alloc ( 65 ) ] , Buffer . alloc ( 0 ) ) ,
167167 ) ;
168168 } ) ;
169169 } ) ;
170170
171171 describe ( "round2_process" , function ( ) {
172172 it ( "does not panic on bad messages" , function ( ) {
173- shouldThrow ( ( ) => mps . round2_process ( "messages" , Buffer . alloc ( 1224 ) ) ) ;
174- shouldThrow ( ( ) => mps . round2_process ( [ ] , Buffer . alloc ( 1224 ) ) ) ;
175- shouldThrow ( ( ) => mps . round2_process ( [ "message" ] , Buffer . alloc ( 1224 ) ) ) ;
176- shouldThrow ( ( ) => mps . round2_process ( [ Buffer . alloc ( 0 ) , Buffer . alloc ( 1224 ) ] ) ) ;
173+ shouldThrow ( ( ) => mps . dkg_round2_process ( "messages" , Buffer . alloc ( 1224 ) ) ) ;
174+ shouldThrow ( ( ) => mps . dkg_round2_process ( [ ] , Buffer . alloc ( 1224 ) ) ) ;
175+ shouldThrow ( ( ) => mps . dkg_round2_process ( [ "message" ] , Buffer . alloc ( 1224 ) ) ) ;
176+ shouldThrow ( ( ) => mps . dkg_round2_process ( [ Buffer . alloc ( 0 ) , Buffer . alloc ( 1224 ) ] ) ) ;
177177 } ) ;
178178
179179 it ( "does not panic on bad state" , function ( ) {
180- shouldThrow ( ( ) => mps . round2_process ( [ Buffer . alloc ( 65 ) , Buffer . alloc ( 65 ) ] , "state" ) ) ;
180+ shouldThrow ( ( ) => mps . dkg_round2_process ( [ Buffer . alloc ( 65 ) , Buffer . alloc ( 65 ) ] , "state" ) ) ;
181181 shouldThrow ( ( ) =>
182- mps . round2_process ( [ Buffer . alloc ( 65 ) , Buffer . alloc ( 65 ) ] , Buffer . alloc ( 0 ) ) ,
182+ mps . dkg_round2_process ( [ Buffer . alloc ( 65 ) , Buffer . alloc ( 65 ) ] , Buffer . alloc ( 0 ) ) ,
183183 ) ;
184184 } ) ;
185185 } ) ;
0 commit comments