From 86238e714ecad3fac440fc43902ad1d70795cd70 Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Tue, 22 Sep 2020 19:26:15 +0200 Subject: [PATCH] Remove unused functions in tests These functions are unused since e83bc4b4. --- test/crypto/ecdh.js | 70 --------------------------------------------- 1 file changed, 70 deletions(-) diff --git a/test/crypto/ecdh.js b/test/crypto/ecdh.js index 7c2eec5c..e7578cc7 100644 --- a/test/crypto/ecdh.js +++ b/test/crypto/ecdh.js @@ -127,76 +127,6 @@ module.exports = () => describe('ECDH key exchange @lightweight', function () { 123, 123, 76, 133, 245, 212, 151, 243, 236, 71, 245, 86, 3, 168, 101, 74, 209, 105 ]); - async function genPublicEphemeralKey(curve, Q, fingerprint) { - const curveObj = new openpgp.crypto.publicKey.elliptic.Curve(curve); - const oid = new openpgp.OID(curveObj.oid); - const { publicKey: V, sharedKey } = await openpgp.crypto.publicKey.elliptic.ecdh.genPublicEphemeralKey( - curveObj, Q - ); - let cipher_algo = curveObj.cipher; - const hash_algo = curveObj.hash; - const kdfParams = new openpgp.KDFParams({ cipher: cipher_algo, hash: hash_algo }); - const param = openpgp.crypto.publicKey.elliptic.ecdh.buildEcdhParam( - openpgp.enums.publicKey.ecdh, oid, kdfParams, fingerprint - ); - cipher_algo = openpgp.enums.read(openpgp.enums.symmetric, cipher_algo); - const Z = await openpgp.crypto.publicKey.elliptic.ecdh.kdf( - hash_algo, sharedKey, openpgp.crypto.cipher[cipher_algo].keySize, param, curveObj, false - ); - return { V, Z }; - } - - async function genPrivateEphemeralKey(curve, V, Q, d, fingerprint) { - const curveObj = new openpgp.crypto.publicKey.elliptic.Curve(curve); - const oid = new openpgp.OID(curveObj.oid); - const { sharedKey } = await openpgp.crypto.publicKey.elliptic.ecdh.genPrivateEphemeralKey( - curveObj, V, Q, d - ); - let cipher_algo = curveObj.cipher; - const hash_algo = curveObj.hash; - const kdfParams = new openpgp.KDFParams({ cipher: cipher_algo, hash: hash_algo }); - const param = openpgp.crypto.publicKey.elliptic.ecdh.buildEcdhParam( - openpgp.enums.publicKey.ecdh, oid, kdfParams, fingerprint - ); - cipher_algo = openpgp.enums.read(openpgp.enums.symmetric, cipher_algo); - const Z = await openpgp.crypto.publicKey.elliptic.ecdh.kdf( - hash_algo, sharedKey, openpgp.crypto.cipher[cipher_algo].keySize, param, curveObj, false - ); - return Z; - } - - async function genPrivateEphemeralKeySpecific(fun, curve, V, Q, d, fingerprint) { - const curveObj = new openpgp.crypto.publicKey.elliptic.Curve(curve); - const oid = new openpgp.OID(curveObj.oid); - let result; - switch (fun) { - case 'webPrivateEphemeralKey': { - result = await openpgp.crypto.publicKey.elliptic.ecdh[fun]( - curveObj, V, Q, d - ); - break; - } - case 'nodePrivateEphemeralKey': - case 'ellipticPrivateEphemeralKey': { - result = await openpgp.crypto.publicKey.elliptic.ecdh[fun]( - curveObj, V, d - ); - break; - } - } - const sharedKey = result.sharedKey; - let cipher_algo = curveObj.cipher; - const hash_algo = curveObj.hash; - const kdfParams = new openpgp.KDFParams({ cipher: cipher_algo, hash: hash_algo }); - const param = openpgp.crypto.publicKey.elliptic.ecdh.buildEcdhParam( - openpgp.enums.publicKey.ecdh, oid, kdfParams, fingerprint - ); - cipher_algo = openpgp.enums.read(openpgp.enums.symmetric, cipher_algo); - const Z = await openpgp.crypto.publicKey.elliptic.ecdh.kdf( - hash_algo, sharedKey, openpgp.crypto.cipher[cipher_algo].keySize, param, curveObj, false - ); - return Z; - } describe('ECDHE key generation', function () { it('Invalid curve', async function () {