Commit 03717fd6 authored by eroman@chromium.org's avatar eroman@chromium.org

Speed up slow tests by reducing RSA modulus size (from 2048 --> 512).

BUG=384565,245025

Review URL: https://codereview.chromium.org/333063004

git-svn-id: svn://svn.chromium.org/blink/trunk@176145 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 187bc9da
...@@ -8,13 +8,13 @@ PASS keyPair.toString() is '[object KeyPair]' ...@@ -8,13 +8,13 @@ PASS keyPair.toString() is '[object KeyPair]'
PASS keyPair.publicKey.type is 'public' PASS keyPair.publicKey.type is 'public'
PASS keyPair.publicKey.extractable is true PASS keyPair.publicKey.extractable is true
PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP' PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
PASS keyPair.publicKey.algorithm.modulusLength is 2048 PASS keyPair.publicKey.algorithm.modulusLength is 512
PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001' PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
PASS keyPair.publicKey.algorithm.hash.name is 'SHA-256' PASS keyPair.publicKey.algorithm.hash.name is 'SHA-256'
PASS keyPair.privateKey.type is 'private' PASS keyPair.privateKey.type is 'private'
PASS keyPair.privateKey.extractable is false PASS keyPair.privateKey.extractable is false
PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP' PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
PASS keyPair.privateKey.algorithm.modulusLength is 2048 PASS keyPair.privateKey.algorithm.modulusLength is 512
PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001' PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
PASS keyPair.privateKey.algorithm.hash.name is 'SHA-256' PASS keyPair.privateKey.algorithm.hash.name is 'SHA-256'
PASS successfullyParsed is true PASS successfullyParsed is true
......
...@@ -17,7 +17,7 @@ var algorithmKeyGen = { ...@@ -17,7 +17,7 @@ var algorithmKeyGen = {
name: "RSA-OAEP", name: "RSA-OAEP",
hash: {name: "sha-256"}, hash: {name: "sha-256"},
// RsaKeyGenParams // RsaKeyGenParams
modulusLength: 2048, modulusLength: 512,
publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537 publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
}; };
var nonExtractable = false; var nonExtractable = false;
...@@ -29,13 +29,13 @@ crypto.subtle.generateKey(algorithmKeyGen, nonExtractable, []).then(function(res ...@@ -29,13 +29,13 @@ crypto.subtle.generateKey(algorithmKeyGen, nonExtractable, []).then(function(res
shouldBe("keyPair.publicKey.type", "'public'"); shouldBe("keyPair.publicKey.type", "'public'");
shouldBe("keyPair.publicKey.extractable", "true"); shouldBe("keyPair.publicKey.extractable", "true");
shouldBe("keyPair.publicKey.algorithm.name", "'RSA-OAEP'"); shouldBe("keyPair.publicKey.algorithm.name", "'RSA-OAEP'");
shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048"); shouldBe("keyPair.publicKey.algorithm.modulusLength", "512");
shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'"); shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
shouldBe("keyPair.publicKey.algorithm.hash.name", "'SHA-256'"); shouldBe("keyPair.publicKey.algorithm.hash.name", "'SHA-256'");
shouldBe("keyPair.privateKey.type", "'private'"); shouldBe("keyPair.privateKey.type", "'private'");
shouldBe("keyPair.privateKey.extractable", "false"); shouldBe("keyPair.privateKey.extractable", "false");
shouldBe("keyPair.privateKey.algorithm.name", "'RSA-OAEP'"); shouldBe("keyPair.privateKey.algorithm.name", "'RSA-OAEP'");
shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048"); shouldBe("keyPair.privateKey.algorithm.modulusLength", "512");
shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'"); shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
shouldBe("keyPair.privateKey.algorithm.hash.name", "'SHA-256'"); shouldBe("keyPair.privateKey.algorithm.hash.name", "'SHA-256'");
}).then(finishJSTest, failAndFinishJSTest); }).then(finishJSTest, failAndFinishJSTest);
......
...@@ -7,13 +7,13 @@ Generating a key pair... ...@@ -7,13 +7,13 @@ Generating a key pair...
PASS keyPair.toString() is '[object KeyPair]' PASS keyPair.toString() is '[object KeyPair]'
PASS keyPair.publicKey.type is 'public' PASS keyPair.publicKey.type is 'public'
PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP' PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
PASS keyPair.publicKey.algorithm.modulusLength is 2048 PASS keyPair.publicKey.algorithm.modulusLength is 512
PASS keyPair.publicKey.usages is ["encrypt", "wrapKey"] PASS keyPair.publicKey.usages is ["encrypt", "wrapKey"]
PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001' PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
PASS keyPair.publicKey.algorithm.hash.name is 'SHA-1' PASS keyPair.publicKey.algorithm.hash.name is 'SHA-1'
PASS keyPair.privateKey.type is 'private' PASS keyPair.privateKey.type is 'private'
PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP' PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
PASS keyPair.privateKey.algorithm.modulusLength is 2048 PASS keyPair.privateKey.algorithm.modulusLength is 512
PASS keyPair.privateKey.usages is ["decrypt", "unwrapKey"] PASS keyPair.privateKey.usages is ["decrypt", "unwrapKey"]
PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001' PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
PASS keyPair.privateKey.algorithm.hash.name is 'SHA-1' PASS keyPair.privateKey.algorithm.hash.name is 'SHA-1'
...@@ -39,7 +39,7 @@ PASS bytesToHexString(Base64URL.parse(jwkPublicKey.e)) is '010001' ...@@ -39,7 +39,7 @@ PASS bytesToHexString(Base64URL.parse(jwkPublicKey.e)) is '010001'
Importing it back... Importing it back...
PASS exportedPublicKey.type is 'public' PASS exportedPublicKey.type is 'public'
PASS exportedPublicKey.algorithm.name is 'RSA-OAEP' PASS exportedPublicKey.algorithm.name is 'RSA-OAEP'
PASS exportedPublicKey.algorithm.modulusLength is 2048 PASS exportedPublicKey.algorithm.modulusLength is 512
PASS bytesToHexString(exportedPublicKey.algorithm.publicExponent) is '010001' PASS bytesToHexString(exportedPublicKey.algorithm.publicExponent) is '010001'
PASS exportedPublicKey.algorithm.hash.name is 'SHA-1' PASS exportedPublicKey.algorithm.hash.name is 'SHA-1'
PASS exportedPublicKey.extractable is true PASS exportedPublicKey.extractable is true
......
...@@ -17,7 +17,7 @@ var algorithmKeyGen = { ...@@ -17,7 +17,7 @@ var algorithmKeyGen = {
name: "RSA-OAEP", name: "RSA-OAEP",
hash: {name: "sha-1"}, hash: {name: "sha-1"},
// RsaKeyGenParams // RsaKeyGenParams
modulusLength: 2048, modulusLength: 512,
publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537 publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
}; };
var extractable = true; var extractable = true;
...@@ -28,13 +28,13 @@ crypto.subtle.generateKey(algorithmKeyGen, extractable, ["encrypt", "decrypt", " ...@@ -28,13 +28,13 @@ crypto.subtle.generateKey(algorithmKeyGen, extractable, ["encrypt", "decrypt", "
shouldBe("keyPair.toString()", "'[object KeyPair]'"); shouldBe("keyPair.toString()", "'[object KeyPair]'");
shouldBe("keyPair.publicKey.type", "'public'"); shouldBe("keyPair.publicKey.type", "'public'");
shouldBe("keyPair.publicKey.algorithm.name", "'RSA-OAEP'"); shouldBe("keyPair.publicKey.algorithm.name", "'RSA-OAEP'");
shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048"); shouldBe("keyPair.publicKey.algorithm.modulusLength", "512");
shouldBe("keyPair.publicKey.usages", '["encrypt", "wrapKey"]'); shouldBe("keyPair.publicKey.usages", '["encrypt", "wrapKey"]');
shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'"); shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
shouldBe("keyPair.publicKey.algorithm.hash.name", "'SHA-1'"); shouldBe("keyPair.publicKey.algorithm.hash.name", "'SHA-1'");
shouldBe("keyPair.privateKey.type", "'private'"); shouldBe("keyPair.privateKey.type", "'private'");
shouldBe("keyPair.privateKey.algorithm.name", "'RSA-OAEP'"); shouldBe("keyPair.privateKey.algorithm.name", "'RSA-OAEP'");
shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048"); shouldBe("keyPair.privateKey.algorithm.modulusLength", "512");
shouldBe("keyPair.privateKey.usages", '["decrypt", "unwrapKey"]'); shouldBe("keyPair.privateKey.usages", '["decrypt", "unwrapKey"]');
shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'"); shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
shouldBe("keyPair.privateKey.algorithm.hash.name", "'SHA-1'"); shouldBe("keyPair.privateKey.algorithm.hash.name", "'SHA-1'");
...@@ -76,7 +76,7 @@ crypto.subtle.generateKey(algorithmKeyGen, extractable, ["encrypt", "decrypt", " ...@@ -76,7 +76,7 @@ crypto.subtle.generateKey(algorithmKeyGen, extractable, ["encrypt", "decrypt", "
exportedPublicKey = result; exportedPublicKey = result;
shouldBe("exportedPublicKey.type", "'public'"); shouldBe("exportedPublicKey.type", "'public'");
shouldBe("exportedPublicKey.algorithm.name", "'RSA-OAEP'"); shouldBe("exportedPublicKey.algorithm.name", "'RSA-OAEP'");
shouldBe("exportedPublicKey.algorithm.modulusLength", "2048"); shouldBe("exportedPublicKey.algorithm.modulusLength", "512");
shouldBe("bytesToHexString(exportedPublicKey.algorithm.publicExponent)", "'010001'"); shouldBe("bytesToHexString(exportedPublicKey.algorithm.publicExponent)", "'010001'");
shouldBe("exportedPublicKey.algorithm.hash.name", "'SHA-1'"); shouldBe("exportedPublicKey.algorithm.hash.name", "'SHA-1'");
shouldBe("exportedPublicKey.extractable", "true"); shouldBe("exportedPublicKey.extractable", "true");
......
...@@ -8,13 +8,13 @@ PASS keyPair.toString() is '[object KeyPair]' ...@@ -8,13 +8,13 @@ PASS keyPair.toString() is '[object KeyPair]'
PASS keyPair.publicKey.type is 'public' PASS keyPair.publicKey.type is 'public'
PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5' PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
PASS keyPair.publicKey.algorithm.hash.name is 'SHA-256' PASS keyPair.publicKey.algorithm.hash.name is 'SHA-256'
PASS keyPair.publicKey.algorithm.modulusLength is 2048 PASS keyPair.publicKey.algorithm.modulusLength is 512
PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001' PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
PASS keyPair.publicKey.usages is ["verify"] PASS keyPair.publicKey.usages is ["verify"]
PASS keyPair.privateKey.type is 'private' PASS keyPair.privateKey.type is 'private'
PASS keyPair.privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5' PASS keyPair.privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
PASS keyPair.privateKey.algorithm.hash.name is 'SHA-256' PASS keyPair.privateKey.algorithm.hash.name is 'SHA-256'
PASS keyPair.privateKey.algorithm.modulusLength is 2048 PASS keyPair.privateKey.algorithm.modulusLength is 512
PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001' PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
PASS keyPair.privateKey.usages is ["sign"] PASS keyPair.privateKey.usages is ["sign"]
......
...@@ -7,13 +7,13 @@ Generating a key pair... ...@@ -7,13 +7,13 @@ Generating a key pair...
PASS keyPair.toString() is '[object KeyPair]' PASS keyPair.toString() is '[object KeyPair]'
PASS keyPair.publicKey.type is 'public' PASS keyPair.publicKey.type is 'public'
PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5' PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
PASS keyPair.publicKey.algorithm.modulusLength is 2048 PASS keyPair.publicKey.algorithm.modulusLength is 512
PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001' PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001' PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
PASS keyPair.publicKey.usages is ["verify"] PASS keyPair.publicKey.usages is ["verify"]
PASS keyPair.privateKey.type is 'private' PASS keyPair.privateKey.type is 'private'
PASS keyPair.privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5' PASS keyPair.privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
PASS keyPair.privateKey.algorithm.modulusLength is 2048 PASS keyPair.privateKey.algorithm.modulusLength is 512
PASS keyPair.privateKey.usages is ["sign"] PASS keyPair.privateKey.usages is ["sign"]
PASS successfullyParsed is true PASS successfullyParsed is true
......
...@@ -17,7 +17,7 @@ var algorithmKeyGen = { ...@@ -17,7 +17,7 @@ var algorithmKeyGen = {
name: "RSASSA-PKCS1-v1_5", name: "RSASSA-PKCS1-v1_5",
hash: {name: "sha-256"}, hash: {name: "sha-256"},
// RsaKeyGenParams // RsaKeyGenParams
modulusLength: 2048, modulusLength: 512,
publicExponent: new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01]), // Equivalent to 65537 publicExponent: new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01]), // Equivalent to 65537
}; };
var extractable = true; var extractable = true;
...@@ -28,14 +28,14 @@ crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then ...@@ -28,14 +28,14 @@ crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then
shouldBe("keyPair.toString()", "'[object KeyPair]'"); shouldBe("keyPair.toString()", "'[object KeyPair]'");
shouldBe("keyPair.publicKey.type", "'public'"); shouldBe("keyPair.publicKey.type", "'public'");
shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'"); shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048"); shouldBe("keyPair.publicKey.algorithm.modulusLength", "512");
shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'"); shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'"); shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
shouldBe("keyPair.publicKey.usages", '["verify"]'); shouldBe("keyPair.publicKey.usages", '["verify"]');
shouldBe("keyPair.privateKey.type", "'private'"); shouldBe("keyPair.privateKey.type", "'private'");
shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'"); shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048"); shouldBe("keyPair.privateKey.algorithm.modulusLength", "512");
shouldBe("keyPair.privateKey.usages", '["sign"]'); shouldBe("keyPair.privateKey.usages", '["sign"]');
}).then(finishJSTest, failAndFinishJSTest); }).then(finishJSTest, failAndFinishJSTest);
</script> </script>
......
...@@ -17,7 +17,7 @@ var algorithmKeyGen = { ...@@ -17,7 +17,7 @@ var algorithmKeyGen = {
name: "RSASSA-PKCS1-v1_5", name: "RSASSA-PKCS1-v1_5",
hash: {name: "sha-256"}, hash: {name: "sha-256"},
// RsaKeyGenParams // RsaKeyGenParams
modulusLength: 2048, modulusLength: 512,
publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537 publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // Equivalent to 65537
}; };
var extractable = true; var extractable = true;
...@@ -29,13 +29,13 @@ crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then ...@@ -29,13 +29,13 @@ crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then
shouldBe("keyPair.publicKey.type", "'public'"); shouldBe("keyPair.publicKey.type", "'public'");
shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'"); shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
shouldBe("keyPair.publicKey.algorithm.hash.name", "'SHA-256'"); shouldBe("keyPair.publicKey.algorithm.hash.name", "'SHA-256'");
shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048"); shouldBe("keyPair.publicKey.algorithm.modulusLength", "512");
shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'"); shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'");
shouldBe("keyPair.publicKey.usages", '["verify"]'); shouldBe("keyPair.publicKey.usages", '["verify"]');
shouldBe("keyPair.privateKey.type", "'private'"); shouldBe("keyPair.privateKey.type", "'private'");
shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'"); shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'");
shouldBe("keyPair.privateKey.algorithm.hash.name", "'SHA-256'"); shouldBe("keyPair.privateKey.algorithm.hash.name", "'SHA-256'");
shouldBe("keyPair.privateKey.algorithm.modulusLength", "2048"); shouldBe("keyPair.privateKey.algorithm.modulusLength", "512");
shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'"); shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'");
shouldBe("keyPair.privateKey.usages", '["sign"]'); shouldBe("keyPair.privateKey.usages", '["sign"]');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment