From 4f7b9da30a0cf10e7666d46ffb2e3239d79a01ca Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Sun, 5 Nov 2023 12:58:22 +0100 Subject: [PATCH] Minor fixes --- src/crypto/crypto.js | 2 +- src/crypto/signature.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypto/crypto.js b/src/crypto/crypto.js index 57e6620d4..a056c5d89 100644 --- a/src/crypto/crypto.js +++ b/src/crypto/crypto.js @@ -321,7 +321,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 } }; diff --git a/src/crypto/signature.js b/src/crypto/signature.js index 7968a09f6..462716da6 100644 --- a/src/crypto/signature.js +++ b/src/crypto/signature.js @@ -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 } };