| 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 11 matching lines...) Expand all  Loading... | 
| 22     var extractable = false; | 22     var extractable = false; | 
| 23     // FIXME: Should use aes-ctr here. | 23     // FIXME: Should use aes-ctr here. | 
| 24     var algorithm = {name: 'aes-cbc'}; | 24     var algorithm = {name: 'aes-cbc'}; | 
| 25 | 25 | 
| 26     return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usage
    s); | 26     return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usage
    s); | 
| 27 }).then(function(result) { | 27 }).then(function(result) { | 
| 28     key = result; | 28     key = result; | 
| 29 | 29 | 
| 30     return crypto.subtle.encrypt({name: 'AES-CTR', counter: null}, key, data); | 30     return crypto.subtle.encrypt({name: 'AES-CTR', counter: null}, key, data); | 
| 31 }).then(failAndFinishJSTest, function(result) { | 31 }).then(failAndFinishJSTest, function(result) { | 
| 32     error = result; | 32     logError(result); | 
| 33     shouldBeNull("error"); |  | 
| 34 | 33 | 
| 35     return crypto.subtle.encrypt({name: 'AES-CTR'}, key, data); | 34     return crypto.subtle.encrypt({name: 'AES-CTR'}, key, data); | 
| 36 }).then(failAndFinishJSTest, function(result) { | 35 }).then(failAndFinishJSTest, function(result) { | 
| 37     error = result; | 36     logError(result); | 
| 38     shouldBeNull("error"); |  | 
| 39 | 37 | 
| 40     return crypto.subtle.encrypt({name: 'AES-CTR', counter: new Uint8Array(0)}, 
    key, data); | 38     return crypto.subtle.encrypt({name: 'AES-CTR', counter: new Uint8Array(0)}, 
    key, data); | 
| 41 }).then(failAndFinishJSTest, function(result) { | 39 }).then(failAndFinishJSTest, function(result) { | 
| 42     error = result; | 40     logError(result); | 
| 43     shouldBeNull("error"); |  | 
| 44 | 41 | 
| 45     return crypto.subtle.encrypt({name: 'AES-CTR', counter: new Uint8Array(16), 
    length: 256}, key, data); | 42     return crypto.subtle.encrypt({name: 'AES-CTR', counter: new Uint8Array(16), 
    length: 256}, key, data); | 
| 46 }).then(failAndFinishJSTest, function(result) { | 43 }).then(failAndFinishJSTest, function(result) { | 
| 47     error = result; | 44     logError(result); | 
| 48     shouldBeNull("error"); |  | 
| 49 | 45 | 
| 50     return crypto.subtle.encrypt({name: 'AES-CTR', counter: new Uint8Array(16), 
    length: -3}, key, data); | 46     return crypto.subtle.encrypt({name: 'AES-CTR', counter: new Uint8Array(16), 
    length: -3}, key, data); | 
| 51 }).then(failAndFinishJSTest, function(result) { | 47 }).then(failAndFinishJSTest, function(result) { | 
| 52     error = result; | 48     logError(result); | 
| 53     shouldBeNull("error"); |  | 
| 54 | 49 | 
| 55     return crypto.subtle.encrypt({name: 'AES-CTR', counter: new Uint8Array(16), 
    length: Infinity}, key, data); | 50     return crypto.subtle.encrypt({name: 'AES-CTR', counter: new Uint8Array(16), 
    length: Infinity}, key, data); | 
| 56 }).then(failAndFinishJSTest, function(result) { | 51 }).then(failAndFinishJSTest, function(result) { | 
| 57     error = result; | 52     logError(result); | 
| 58     shouldBeNull("error"); |  | 
| 59 }).then(finishJSTest, failAndFinishJSTest); | 53 }).then(finishJSTest, failAndFinishJSTest); | 
| 60 | 54 | 
| 61 </script> | 55 </script> | 
| 62 | 56 | 
| 63 </body> | 57 </body> | 
| 64 </html> | 58 </html> | 
| OLD | NEW | 
|---|