OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
5 <script src="resources/common.js"></script> | 5 <script src="resources/common.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <p id="description"></p> | 8 <p id="description"></p> |
9 <div id="console"></div> | 9 <div id="console"></div> |
10 | 10 |
11 <script> | 11 <script> |
12 description("Tests generating AES keys"); | 12 description("Tests generating AES keys"); |
13 | 13 |
14 jsTestIsAsync = true; | 14 jsTestIsAsync = true; |
15 | 15 |
16 // Tests the 48 permutations of keys generated by: | 16 // Tests the 32 permutations of keys generated by: |
17 // kPossibleAlgorithms x kPossibleExtractable x kPossibleKeyUsages x kPossible
KeyLengths | 17 // kPossibleAlgorithms x kPossibleExtractable x kPossibleKeyUsages x kPossible
KeyLengths |
18 // | 18 // |
19 // For practical reasons these tests are not exhaustive. | 19 // For practical reasons these tests are not exhaustive. |
20 | 20 |
21 var kPossibleAlgorithms = ['AES-CBC', 'AES-GCM']; | 21 var kPossibleAlgorithms = ['AES-CBC', 'AES-GCM']; |
22 var kPossibleExtractable = [true, false]; | 22 var kPossibleExtractable = [true, false]; |
23 var kPossibleKeyUsages = [[], ['encrypt'], ['decrypt', 'wrapKey'], ['encrypt', '
wrapKey', 'unwrapKey']]; | 23 var kPossibleKeyUsages = [[], ['encrypt'], ['decrypt', 'wrapKey'], ['encrypt', '
wrapKey', 'unwrapKey']]; |
24 var kPossibleKeyLengths = [128, 192, 256]; | 24 var kPossibleKeyLengths = [128, 256]; |
25 | 25 |
26 // Set of all key data generated so far. | 26 // Set of all key data generated so far. |
27 var allKeyDataGenerated = {}; | 27 var allKeyDataGenerated = {}; |
28 | 28 |
29 function runTest(algorithmName, extractable, keyUsages, keyLengthBits) | 29 function runTest(algorithmName, extractable, keyUsages, keyLengthBits) |
30 { | 30 { |
31 var genAlgorithm = { name: algorithmName, length: keyLengthBits }; | 31 var genAlgorithm = { name: algorithmName, length: keyLengthBits }; |
32 | 32 |
33 var results = {}; | 33 var results = {}; |
34 | 34 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 }); | 77 }); |
78 }); | 78 }); |
79 }); | 79 }); |
80 | 80 |
81 lastPromise.then(finishJSTest, failAndFinishJSTest); | 81 lastPromise.then(finishJSTest, failAndFinishJSTest); |
82 | 82 |
83 </script> | 83 </script> |
84 | 84 |
85 </body> | 85 </body> |
86 </html> | 86 </html> |
OLD | NEW |