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 12 matching lines...) Expand all Loading... |
23 var algorithm = {name: 'aes-gcm'}; | 23 var algorithm = {name: 'aes-gcm'}; |
24 | 24 |
25 return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usage
s); | 25 return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usage
s); |
26 }).then(function(result) { | 26 }).then(function(result) { |
27 key = result; | 27 key = result; |
28 shouldEvaluateAs("key.algorithm.name", "AES-GCM"); | 28 shouldEvaluateAs("key.algorithm.name", "AES-GCM"); |
29 | 29 |
30 // Can't use an AES-KW key for AES-CBC (even though both are AES keys). | 30 // Can't use an AES-KW key for AES-CBC (even though both are AES keys). |
31 return crypto.subtle.encrypt({name: 'AES-CBC', iv: new Uint8Array(16)}, key,
data); | 31 return crypto.subtle.encrypt({name: 'AES-CBC', iv: new Uint8Array(16)}, key,
data); |
32 }).then(failAndFinishJSTest, function(result) { | 32 }).then(failAndFinishJSTest, function(result) { |
33 error = result; | 33 logError(result); |
34 shouldBeNull("error"); | |
35 }).then(finishJSTest, failAndFinishJSTest); | 34 }).then(finishJSTest, failAndFinishJSTest); |
36 | 35 |
37 </script> | 36 </script> |
38 | 37 |
39 </body> | 38 </body> |
40 </html> | 39 </html> |
OLD | NEW |