From 55a4bda36b5b756d348c6d6994b133294dfc701d 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 8cbc2099e..6d0d185e3 100644 --- a/src/crypto/crypto.js +++ b/src/crypto/crypto.js @@ -328,7 +328,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 + 4032); read += mldsaSecretKey.length; return { read, privateParams: { eccSecretKey, mldsaSecretKey } }; diff --git a/src/crypto/signature.js b/src/crypto/signature.js index c5970808d..3eb613502 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 + 3309); read += mldsaSignature.length; return { read, signatureParams: { eccSignature, mldsaSignature } };