| 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 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 tmpKey = key; | 95 tmpKey = key; |
| 96 shouldEvaluateAs("tmpKey.type", "secret"); | 96 shouldEvaluateAs("tmpKey.type", "secret"); |
| 97 shouldEvaluateAs("tmpKey.extractable", false); | 97 shouldEvaluateAs("tmpKey.extractable", false); |
| 98 shouldEvaluateAs("tmpKey.algorithm.name", "PBKDF2"); | 98 shouldEvaluateAs("tmpKey.algorithm.name", "PBKDF2"); |
| 99 shouldEvaluateAs("tmpKey.usages.join(',')", "deriveKey,deriveBits"); | 99 shouldEvaluateAs("tmpKey.usages.join(',')", "deriveKey,deriveBits"); |
| 100 | 100 |
| 101 // (2) Derive bits | 101 // (2) Derive bits |
| 102 return crypto.subtle.deriveBits(params, key, testCase.dkLen*8); | 102 return crypto.subtle.deriveBits(params, key, testCase.dkLen*8); |
| 103 }).then(function(result) { | 103 }).then(function(result) { |
| 104 bytesShouldMatchHexString("deriveBits", testCase.derived_key, result); | 104 bytesShouldMatchHexString("deriveBits", testCase.derived_key, result); |
| 105 return crypto.subtle.deriveBits(params, key, 0); | |
| 106 }).then(function(result) { | |
| 107 derivedBits = result; | |
| 108 shouldBe("derivedBits.byteLength", "0"); | |
| 109 }); | 105 }); |
| 110 } | 106 } |
| 111 | 107 |
| 112 var lastPromise = Promise.resolve(null); | 108 var lastPromise = Promise.resolve(null); |
| 113 | 109 |
| 114 kPbkdf2SuccessVectors.forEach(function(test) { | 110 kPbkdf2SuccessVectors.forEach(function(test) { |
| 115 lastPromise = lastPromise.then(runPbkdf2SuccessTestCase.bind(null, test)); | 111 lastPromise = lastPromise.then(runPbkdf2SuccessTestCase.bind(null, test)); |
| 116 }); | 112 }); |
| 117 | 113 |
| 118 lastPromise.then(finishJSTest, failAndFinishJSTest); | 114 lastPromise.then(finishJSTest, failAndFinishJSTest); |
| 119 | 115 |
| 120 </script> | 116 </script> |
| 121 | 117 |
| 122 </body> | 118 </body> |
| 123 </html> | 119 </html> |
| OLD | NEW |