OLD | NEW |
---|---|
1 // Tests for wrapKey and unwrapKey round tripping | 1 // Tests for wrapKey and unwrapKey round tripping |
Mike West
2017/04/24 14:34:05
Does this need to be renamed? It seems to break th
| |
2 | 2 |
3 function run_test() { | 3 function run_test() { |
4 var subtle = self.crypto.subtle; | 4 var subtle = self.crypto.subtle; |
5 | 5 |
6 var wrappers = []; // Things we wrap (and upwrap) keys with | 6 var wrappers = []; // Things we wrap (and upwrap) keys with |
7 var keys = []; // Things to wrap and unwrap | 7 var keys = []; // Things to wrap and unwrap |
8 var ecdhPeerKey; // ECDH peer public key needed for non-extractable ECDH key comparison | 8 var ecdhPeerKey; // ECDH peer public key needed for non-extractable ECDH key comparison |
9 | 9 |
10 // Generate all the keys needed, then iterate over all combinations | 10 // Generate all the keys needed, then iterate over all combinations |
11 // to test wrapping and unwrapping. | 11 // to test wrapping and unwrapping. |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
507 } | 507 } |
508 | 508 |
509 return p; | 509 return p; |
510 } | 510 } |
511 | 511 |
512 function str2ab(str) { return Uint8Array.from( str.split(''), functio n(s){return s.charCodeAt(0)} ); } | 512 function str2ab(str) { return Uint8Array.from( str.split(''), functio n(s){return s.charCodeAt(0)} ); } |
513 function ab2str(ab) { return String.fromCharCode.apply(null, new Uin t8Array(ab)); } | 513 function ab2str(ab) { return String.fromCharCode.apply(null, new Uin t8Array(ab)); } |
514 | 514 |
515 | 515 |
516 } | 516 } |
OLD | NEW |