8000 crypto, refactor: remove unused code. · fibjs/fibjs@1701ed4 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 1701ed4

Browse files
committed
crypto, refactor: remove unused code.
1 parent 1038489 commit 1701ed4

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

test/crypto_test.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ var os = require("os");
88
var encoding = require("encoding");
99
var hex = require("hex");
1010
var path = require("path");
11-
var ecsdsa_case = require("./crypto_case/ecsdsa.json");
1211

1312
var rsa4096_pem = "-----BEGIN RSA PRIVATE KEY-----\n" +
1413
"MIIJJwIBAAKCAgEAiAUwIJyWHEnusONGDVCguTr3FkkVoSiDJ2mmFYYibt1paXpI\n" +
@@ -1368,9 +1367,7 @@ MCowBQYDK2VwAyEA11qYAYKxCrfVS/7TyWQHOg7hcvPapiMlrwIaaPcHURo=
13681367
});
13691368

13701369
describe("alg", () => {
1371-
var all_algs = ['RSA', 'ECDSA', 'SM2', 'ECSDSA', 'EdDSA', 'BLS', 'DH'];
1372-
1373-
function test_alg(alg, algs, pk) {
1370+
function test_alg(alg, pk) {
13741371
describe(alg, () => {
13751372
it("generateKey", () => {
13761373
assert.equal(pk.alg, alg);
@@ -1408,12 +1405,12 @@ MCowBQYDK2VwAyEA11qYAYKxCrfVS/7TyWQHOg7hcvPapiMlrwIaaPcHURo=
14081405
});
14091406
}
14101407

1411-
test_alg("RSA", ['RSA'], crypto.generateKey(512));
1412-
test_alg("ECDSA", ['ECDSA', 'ECSDSA'], crypto.generateKey());
1413-
test_alg("SM2", ['SM2', 'ECSDSA'], crypto.generateKey("SM2"));
1414-
test_alg("EdDSA", ['EdDSA'], crypto.generateKey("ed25519"));
1415-
test_alg("DH", ['DH'], crypto.generateKey("X25519"));
1416-
test_alg("BLS", ['BLS'], crypto.generateKey("BLS12381_G1"));
1408+
test_alg("RSA", crypto.generateKey(512));
1409+
test_alg("ECDSA", crypto.generateKey());
1410+
test_alg("SM2", crypto.generateKey("SM2"));
1411+
test_alg("EdDSA", crypto.generateKey("ed25519"));
1412+
test_alg("DH", crypto.generateKey("X25519"));
1413+
test_alg("BLS", crypto.generateKey("BLS12381_G1"));
14171414
});
14181415

14191416
describe("X509 Cert", () => {

0 commit comments

Comments
 (0)
0