Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
twiss authored and larabr committed Mar 18, 2024
1 parent 07b692b commit b738933
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/crypto/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export function parsePrivateKeyParams(algo, bytes, publicParams) {
const mlkemSecretKey = util.readExactSubarray(bytes, read, read + 2400); read += mlkemSecretKey.length;
return { read, privateParams: { eccSecretKey, mlkemSecretKey } };
}
case enums.publicKey.pqc_mldsa_x25519: {
case enums.publicKey.pqc_mldsa_ed25519: {
const eccSecretKey = util.readExactSubarray(bytes, read, read + getCurvePayloadSize(enums.publicKey.ed25519)); read += eccSecretKey.length;
const mldsaSecretKey = util.readExactSubarray(bytes, read, read + 4000); read += mldsaSecretKey.length;
return { read, privateParams: { eccSecretKey, mldsaSecretKey } };
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function parseSignatureParams(algo, signature) {
return { read, signatureParams: { mac } };
}
case enums.publicKey.pqc_mldsa_ed25519: {
const eccSignatureSize = 2 * publicKey.elliptic.eddsa.getPayloadSize(algo);
const eccSignatureSize = 2 * publicKey.elliptic.eddsa.getPayloadSize(enums.publicKey.ed25519);
const eccSignature = util.readExactSubarray(signature, read, read + eccSignatureSize); read += eccSignature.length;
const mldsaSignature = util.readExactSubarray(signature, read, read + 3293); read += mldsaSignature.length;
return { read, signatureParams: { eccSignature, mldsaSignature } };
Expand Down

0 comments on commit b738933

Please sign in to comment.