@@ -13,8 +13,8 @@ import {
1313 getSignatureShareRoundOne ,
1414 getSignatureShareRoundTwo ,
1515 getSignatureShareRoundThree ,
16- verifyBitGoMessageRoundOne ,
17- verifyBitGoMessageRoundTwo ,
16+ verifyPeerMessageRoundOne ,
17+ verifyPeerMessageRoundTwo ,
1818} from '../../../../../../src/bitgo/tss/eddsa/eddsaMPCv2' ;
1919import { decodeWithCodec } from '../../../../../../src/bitgo/utils/codecs' ;
2020import { generateGPGKeyPair } from '../../../../../../src/bitgo/utils/opengpgUtils' ;
@@ -96,7 +96,7 @@ describe('EdDSA MPS DSG helper functions', async () => {
9696 assert . ok ( parsed . data . msg1 . signature , 'msg1.signature should be set' ) ;
9797 } ) ;
9898
99- it ( 'verifyBitGoMessageRoundOne should verify a valid BitGo round-1 message' , async ( ) => {
99+ it ( 'verifyPeerMessageRoundOne should verify a valid BitGo round-1 message' , async ( ) => {
100100 const messageBuffer = Buffer . from ( signableHex , 'hex' ) ;
101101 const bitgoDsg = new EddsaMPSDsg . DSG ( MPCv2PartiesEnum . BITGO ) ;
102102 bitgoDsg . initDsg ( bitgoKeyShare , messageBuffer , derivationPath , MPCv2PartiesEnum . USER ) ;
@@ -108,13 +108,13 @@ describe('EdDSA MPS DSG helper functions', async () => {
108108 data : { msg1 : bitgoSignedMsg1 } ,
109109 } ;
110110
111- const result = await verifyBitGoMessageRoundOne ( round1Output , bitgoGpgPubKey ) ;
111+ const result = await verifyPeerMessageRoundOne ( round1Output , bitgoGpgPubKey ) ;
112112
113113 assert . strictEqual ( result . from , MPCv2PartiesEnum . BITGO ) ;
114114 assert . ok ( result . payload . length > 0 , 'payload should be non-empty' ) ;
115115 } ) ;
116116
117- it ( 'verifyBitGoMessageRoundOne should throw on a tampered message' , async ( ) => {
117+ it ( 'verifyPeerMessageRoundOne should throw on a tampered message' , async ( ) => {
118118 const round1Output : EddsaMPCv2SignatureShareRound1Output = {
119119 type : 'round1Output' ,
120120 data : {
@@ -125,7 +125,7 @@ describe('EdDSA MPS DSG helper functions', async () => {
125125 } ,
126126 } ;
127127
128- await assert . rejects ( verifyBitGoMessageRoundOne ( round1Output , bitgoGpgPubKey ) , 'should throw on invalid signature' ) ;
128+ await assert . rejects ( verifyPeerMessageRoundOne ( round1Output , bitgoGpgPubKey ) , 'should throw on invalid signature' ) ;
129129 } ) ;
130130
131131 // ── Round 2 ─────────────────────────────────────────────────────────────────
@@ -141,7 +141,7 @@ describe('EdDSA MPS DSG helper functions', async () => {
141141 const bitgoMsg1 = bitgoDsg . getFirstMessage ( ) ;
142142
143143 const bitgoSignedMsg1 = await MPSComms . detachSignMpsMessage ( Buffer . from ( bitgoMsg1 . payload ) , bitgoGpgPrivKey ) ;
144- const bitgoDeserializedMsg1 = await verifyBitGoMessageRoundOne (
144+ const bitgoDeserializedMsg1 = await verifyPeerMessageRoundOne (
145145 { type : 'round1Output' , data : { msg1 : bitgoSignedMsg1 } } ,
146146 bitgoGpgPubKey
147147 ) ;
@@ -173,7 +173,7 @@ describe('EdDSA MPS DSG helper functions', async () => {
173173 const bitgoMsg1 = bitgoDsg . getFirstMessage ( ) ;
174174
175175 const bitgoSignedMsg1 = await MPSComms . detachSignMpsMessage ( Buffer . from ( bitgoMsg1 . payload ) , bitgoGpgPrivKey ) ;
176- const bitgoDeserializedMsg1 = await verifyBitGoMessageRoundOne (
176+ const bitgoDeserializedMsg1 = await verifyPeerMessageRoundOne (
177177 { type : 'round1Output' , data : { msg1 : bitgoSignedMsg1 } } ,
178178 bitgoGpgPubKey
179179 ) ;
@@ -198,7 +198,7 @@ describe('EdDSA MPS DSG helper functions', async () => {
198198 assert . ok ( parsed . data . msg2 . signature , 'msg2.signature should be set' ) ;
199199 } ) ;
200200
201- it ( 'verifyBitGoMessageRoundTwo should verify a valid BitGo round-2 message' , async ( ) => {
201+ it ( 'verifyPeerMessageRoundTwo should verify a valid BitGo round-2 message' , async ( ) => {
202202 const messageBuffer = Buffer . from ( signableHex , 'hex' ) ;
203203 const userDsg = new EddsaMPSDsg . DSG ( MPCv2PartiesEnum . USER ) ;
204204 userDsg . initDsg ( userKeyShare , messageBuffer , derivationPath , MPCv2PartiesEnum . BITGO ) ;
@@ -216,13 +216,13 @@ describe('EdDSA MPS DSG helper functions', async () => {
216216 data : { msg2 : bitgoSignedMsg2 } ,
217217 } ;
218218
219- const result = await verifyBitGoMessageRoundTwo ( round2Output , bitgoGpgPubKey ) ;
219+ const result = await verifyPeerMessageRoundTwo ( round2Output , bitgoGpgPubKey ) ;
220220
221221 assert . strictEqual ( result . from , MPCv2PartiesEnum . BITGO ) ;
222222 assert . ok ( result . payload . length > 0 , 'payload should be non-empty' ) ;
223223 } ) ;
224224
225- it ( 'verifyBitGoMessageRoundTwo should throw on a tampered message' , async ( ) => {
225+ it ( 'verifyPeerMessageRoundTwo should throw on a tampered message' , async ( ) => {
226226 const round2Output : EddsaMPCv2SignatureShareRound2Output = {
227227 type : 'round2Output' ,
228228 data : {
@@ -233,7 +233,7 @@ describe('EdDSA MPS DSG helper functions', async () => {
233233 } ,
234234 } ;
235235
236- await assert . rejects ( verifyBitGoMessageRoundTwo ( round2Output , bitgoGpgPubKey ) , 'should throw on invalid signature' ) ;
236+ await assert . rejects ( verifyPeerMessageRoundTwo ( round2Output , bitgoGpgPubKey ) , 'should throw on invalid signature' ) ;
237237 } ) ;
238238
239239 // ── Round 3 ─────────────────────────────────────────────────────────────────
@@ -250,15 +250,15 @@ describe('EdDSA MPS DSG helper functions', async () => {
250250
251251 // Advance to round 2
252252 const bitgoSignedMsg1 = await MPSComms . detachSignMpsMessage ( Buffer . from ( bitgoMsg1 . payload ) , bitgoGpgPrivKey ) ;
253- const bitgoDeserializedMsg1 = await verifyBitGoMessageRoundOne (
253+ const bitgoDeserializedMsg1 = await verifyPeerMessageRoundOne (
254254 { type : 'round1Output' , data : { msg1 : bitgoSignedMsg1 } } ,
255255 bitgoGpgPubKey
256256 ) ;
257257 const [ userMsg2 ] = userDsg . handleIncomingMessages ( [ userMsg1 , bitgoDeserializedMsg1 ] ) ;
258258
259259 const [ bitgoMsg2 ] = bitgoDsg . handleIncomingMessages ( [ bitgoMsg1 , userMsg1 ] ) ;
260260 const bitgoSignedMsg2 = await MPSComms . detachSignMpsMessage ( Buffer . from ( bitgoMsg2 . payload ) , bitgoGpgPrivKey ) ;
261- const bitgoDeserializedMsg2 = await verifyBitGoMessageRoundTwo (
261+ const bitgoDeserializedMsg2 = await verifyPeerMessageRoundTwo (
262262 { type : 'round2Output' , data : { msg2 : bitgoSignedMsg2 } } ,
263263 bitgoGpgPubKey
264264 ) ;
@@ -290,15 +290,15 @@ describe('EdDSA MPS DSG helper functions', async () => {
290290 const bitgoMsg1 = bitgoDsg . getFirstMessage ( ) ;
291291
292292 const bitgoSignedMsg1 = await MPSComms . detachSignMpsMessage ( Buffer . from ( bitgoMsg1 . payload ) , bitgoGpgPrivKey ) ;
293- const bitgoDeserializedMsg1 = await verifyBitGoMessageRoundOne (
293+ const bitgoDeserializedMsg1 = await verifyPeerMessageRoundOne (
294294 { type : 'round1Output' , data : { msg1 : bitgoSignedMsg1 } } ,
295295 bitgoGpgPubKey
296296 ) ;
297297 const [ backupMsg2 ] = backupDsg . handleIncomingMessages ( [ backupMsg1 , bitgoDeserializedMsg1 ] ) ;
298298
299299 const [ bitgoMsg2 ] = bitgoDsg . handleIncomingMessages ( [ bitgoMsg1 , backupMsg1 ] ) ;
300300 const bitgoSignedMsg2 = await MPSComms . detachSignMpsMessage ( Buffer . from ( bitgoMsg2 . payload ) , bitgoGpgPrivKey ) ;
301- const bitgoDeserializedMsg2 = await verifyBitGoMessageRoundTwo (
301+ const bitgoDeserializedMsg2 = await verifyPeerMessageRoundTwo (
302302 { type : 'round2Output' , data : { msg2 : bitgoSignedMsg2 } } ,
303303 bitgoGpgPubKey
304304 ) ;
0 commit comments