diff --git a/weaver/sdks/fabric/interoperation-node-sdk/src/eciesCrypto.js b/weaver/sdks/fabric/interoperation-node-sdk/src/eciesCrypto.js index 1005d5a7d3..f3b6ea4134 100644 --- a/weaver/sdks/fabric/interoperation-node-sdk/src/eciesCrypto.js +++ b/weaver/sdks/fabric/interoperation-node-sdk/src/eciesCrypto.js @@ -98,18 +98,25 @@ function eciesDecryptMessage(recipientPrivateKey, cipherText, options) { const privKey = ecdsa.keyFromPrivate(recipientPrivateKey.prvKeyHex, "hex"); const Z = privKey.derive(ephPubKey.pub); // 'z' - const kdfOutput = hkdf(Z.toArray(), ECIESKDFOutput, null, null, options); // The 'null's correspond to 's1' and 's2', which are both - // empty in our SNAMCC and ESCC plugin implementations + // Append missing leading zeros to Z + let ZArray = Z.toArray(); + const zerosToAdd = 32 - ZArray.length; + for (let ii=0; ii