File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed
src/Yubico/YubiKey/Cryptography
tests/unit/Yubico/YubiKey/Cryptography Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ public bool VerifyData(
286
286
{
287
287
256 => CryptographyProviders . Sha256Creator ( ) ,
288
288
384 => CryptographyProviders . Sha384Creator ( ) ,
289
- 512 => CryptographyProviders . Sha512Creator ( ) ,
289
+ 521 => CryptographyProviders . Sha512Creator ( ) ,
290
290
_ => throw new ArgumentException ( ExceptionMessages . UnsupportedAlgorithm ) ,
291
291
} ;
292
292
Original file line number Diff line number Diff line change @@ -144,6 +144,17 @@ public void ECDsa_VerifyDigestedData_WithDerFormat_Succeeds(KeyDefinitions.KeyTy
144
144
Assert . True ( isVerified ) ;
145
145
}
146
146
147
+ [ Fact ]
148
+ public void EncodedKey_VerifyDigestedData_Succeeds ( )
149
+ {
150
+ byte [ ] pubKey = GetEncodedPoint ( ) ;
151
+ byte [ ] digest = GetDigest ( ) ;
152
+ byte [ ] signature = GetSignature ( ) ;
153
+
154
+ using var verifier = new EcdsaVerify ( pubKey ) ;
155
+ bool isVerified = verifier . VerifyDigestedData ( digest , signature ) ;
156
+ Assert . True ( isVerified ) ;
157
+ }
147
158
148
159
[ Theory ]
149
160
[ InlineData ( KeyDefinitions . KeyType . P256 ) ]
@@ -166,19 +177,6 @@ public void ECDsa_VerifyData_WithDerFormat_Succeeds(KeyDefinitions.KeyType keyTy
166
177
Assert . True ( isVerified ) ;
167
178
}
168
179
169
-
170
- [ Fact ]
171
- public void EncodedKey_Verify_Succeeds ( )
172
- {
173
- byte [ ] pubKey = GetEncodedPoint ( ) ;
174
- byte [ ] digest = GetDigest ( ) ;
175
- byte [ ] signature = GetSignature ( ) ;
176
-
177
- using var verifier = new EcdsaVerify ( pubKey ) ;
178
- bool isVerified = verifier . VerifyDigestedData ( digest , signature ) ;
179
- Assert . True ( isVerified ) ;
180
- }
181
-
182
180
private byte [ ] GetEncodedPoint ( )
183
181
{
184
182
byte [ ] xCoord = GetX ( ) ;
You can’t perform that action at this time.
0 commit comments