Skip to content

Commit

Permalink
Add PQC key generation
Browse files Browse the repository at this point in the history
  • Loading branch information
twiss committed Nov 5, 2023
1 parent ffb47e2 commit 0dc712e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/key/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ export function sanitizeKeyOptions(options, subkeyDefaults = {}) {
}

switch (options.type) {
case 'pqc':
if (options.sign) {
options.algorithm = enums.publicKey.pqc_mldsa_ed25519;
} else {
options.algorithm = enums.publicKey.pqc_mlkem_x25519;
}
break;
case 'ecc': // NB: this case also handles legacy eddsa and x25519 keys, based on `options.curve`
try {
options.curve = enums.write(enums.curve, options.curve);
Expand Down

0 comments on commit 0dc712e

Please sign in to comment.