Skip to content

Commit 766b286

Browse files
authored
fix: add support for generating MLDSA-44 and MLDSA-65 keys (#37)
1 parent 2cb1934 commit 766b286

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/com/google/cose/CoseKey.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ public static CoseKey generateKey(Algorithm algorithm) throws CborException, Cos
132132
switch (algorithm) {
133133
case SIGNING_ALGORITHM_EDDSA:
134134
return OkpSigningKey.generateKey();
135+
case SIGNING_ALGORITHM_MLDSA_44:
136+
case SIGNING_ALGORITHM_MLDSA_65:
135137
case SIGNING_ALGORITHM_MLDSA_87:
136138
return AkpSigningKey.generateKey(algorithm, AkpKey.CONSCRYPT_PROVIDER);
137139
case SIGNING_ALGORITHM_ECDSA_SHA_256:

‎src/com/google/cose/utils/CoseUtils.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public static void verifyCoseSign1Message(CoseKey key, Sign1Message message,
331331
((AkpSigningKey) key)
332332
.verify(algorithm, encodedStructure, message.getSignature(), AkpKey.CONSCRYPT_PROVIDER);
333333
} else {
334-
new CoseException("Incompatible key used.");
334+
throw new CoseException("Incompatible key used.");
335335
}
336336
}
337337

0 commit comments

Comments
 (0)