@@ -54,7 +54,7 @@ public async void Run()
5454 var ( Q , proofC , proofZ ) = _tokenGenerator . GenerateToken ( _privateKey , _publicKey . Q , _ecParameters , P ) ;
5555
5656 // 3. Randomise the token Q, by removing the mask r: W = (1/r)*Q = k*T. Also checks that proof (c,z) is correct.
57- var W = _initiator . RandomiseToken ( _ecParameters , _publicKey , P , Q , proofC , proofZ , r ) ;
57+ var W = _initiator . RandomiseToken ( _ecParameters , _publicKey . Q , P , Q , proofC , proofZ , r ) ;
5858
5959 // 4. Verify that the token (t,W) is correct.
6060 var isVerified = await _tokenVerifier . VerifyTokenAsync ( _privateKey , _ecParameters . Curve , t , W ) ;
@@ -77,7 +77,7 @@ public async void Run_FailWhenSeedIsReplayed()
7777 var ( Q , proofC , proofZ ) = _tokenGenerator . GenerateToken ( _privateKey , _publicKey . Q , _ecParameters , P ) ;
7878
7979 // 3. Randomise the token Q, by removing the mask r: W = (1/r)*Q = k*T. Also checks that proof (c,z) is correct.
80- var W = _initiator . RandomiseToken ( _ecParameters , _publicKey , P , Q , proofC , proofZ , r ) ;
80+ var W = _initiator . RandomiseToken ( _ecParameters , _publicKey . Q , P , Q , proofC , proofZ , r ) ;
8181
8282 // 4. Verify that the token (t,W) is correct.
8383 var isVerified = await _tokenVerifier . VerifyTokenAsync ( _privateKey , _ecParameters . Curve , t , W ) ;
@@ -107,7 +107,7 @@ public void Run_FailWhenKeysDontMatch()
107107 var ( Q , proofC , proofZ ) = _tokenGenerator . GenerateToken ( _wrongPrivateKey , _publicKey . Q , _ecParameters , P ) ;
108108
109109 // Verify the proof
110- var isValid = _initiator . VerifyProof ( _ecParameters , _publicKey , P , Q , proofC , proofZ ) ;
110+ var isValid = _initiator . VerifyProof ( _ecParameters , _publicKey . Q , P , Q , proofC , proofZ ) ;
111111 Assert . False ( isValid , "Keys were incorrect and the proof did not get verified" ) ;
112112 }
113113
@@ -127,7 +127,7 @@ public void Run_FailWhenTokenIsMalformed()
127127 var changedQ = Q . Twice ( ) ;
128128
129129 // Try randomising the token
130- var isValid = _initiator . VerifyProof ( _ecParameters , _publicKey , P , changedQ , proofC , proofZ ) ;
130+ var isValid = _initiator . VerifyProof ( _ecParameters , _publicKey . Q , P , changedQ , proofC , proofZ ) ;
131131 Assert . False ( isValid , "The token was malformed and the proof did not get verified" ) ;
132132 }
133133
@@ -147,7 +147,7 @@ public void Run_FailWhenChallengeIsWrong()
147147 var changedC = proofC . Add ( BigInteger . One ) ;
148148
149149 // Try randomising the token
150- var isValid = _initiator . VerifyProof ( _ecParameters , _publicKey , P , Q , changedC , proofZ ) ;
150+ var isValid = _initiator . VerifyProof ( _ecParameters , _publicKey . Q , P , Q , changedC , proofZ ) ;
151151 Assert . False ( isValid , "The challenge was changed and the proof did not get verified" ) ;
152152 }
153153
@@ -167,7 +167,7 @@ public void Run_FailWhenResponseIsWrong()
167167 var changedZ = proofZ . Add ( BigInteger . One ) ;
168168
169169 // Try randomising the token
170- var isValid = _initiator . VerifyProof ( _ecParameters , _publicKey , P , Q , proofC , changedZ ) ;
170+ var isValid = _initiator . VerifyProof ( _ecParameters , _publicKey . Q , P , Q , proofC , changedZ ) ;
171171 Assert . False ( isValid , "The response was changed and the proof did not get verified" ) ;
172172 }
173173
@@ -207,7 +207,7 @@ public async void Run_FailWhenWIsInvalid()
207207 var ( Q , proofC , proofZ ) = _tokenGenerator . GenerateToken ( _privateKey , _publicKey . Q , _ecParameters , P ) ;
208208
209209 // 3. Randomise the token Q, by removing the mask r: W = (1/r)*Q = k*T. Also checks that proof (c,z) is correct.
210- var W = _initiator . RandomiseToken ( _ecParameters , _publicKey , P , Q , proofC , proofZ , r ) ;
210+ var W = _initiator . RandomiseToken ( _ecParameters , _publicKey . Q , P , Q , proofC , proofZ , r ) ;
211211
212212 // Create a new point with invalid coordinates
213213 var invalidW = _ecParameters . Curve . CreatePoint ( W . XCoord . ToBigInteger ( ) . Add ( BigInteger . One ) , W . YCoord . ToBigInteger ( ) ) ;
0 commit comments