<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[203201] trunk/LayoutTests</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/203201">203201</a></dd>
<dt>Author</dt> <dd>jiewen_tan@apple.com</dd>
<dt>Date</dt> <dd>2016-07-13 17:08:29 -0700 (Wed, 13 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Import W3C WebCryptoAPI tests
https://bugs.webkit.org/show_bug.cgi?id=159636

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* WebCryptoAPI/OWNERS: Added.
* WebCryptoAPI/README.md: Added.
* WebCryptoAPI/WebCryptoAPI.idl: Added.
* WebCryptoAPI/digest/digest.js: Added.
(run_test.):
(run_test.copyBuffer):
(run_test.equalBuffers):
(run_test):
* WebCryptoAPI/digest/digest.worker.js: Added.
* WebCryptoAPI/digest/test_digest-expected.txt: Added.
* WebCryptoAPI/digest/test_digest.html: Added.
* WebCryptoAPI/digest/w3c-import.log: Added.
* WebCryptoAPI/encrypt_decrypt/aes.js: Added.
(run_test.):
(run_test.importVectorKey):
(run_test):
(run_test.equalBuffers):
* WebCryptoAPI/encrypt_decrypt/aes_cbc.worker.js: Added.
* WebCryptoAPI/encrypt_decrypt/aes_cbc_vectors.js: Added.
(getTestVectors):
* WebCryptoAPI/encrypt_decrypt/aes_ctr.worker.js: Added.
* WebCryptoAPI/encrypt_decrypt/aes_ctr_vectors.js: Added.
(getTestVectors):
* WebCryptoAPI/encrypt_decrypt/aes_gcm.worker.js: Added.
* WebCryptoAPI/encrypt_decrypt/aes_gcm_vectors.js: Added.
(getTestVectors):
* WebCryptoAPI/encrypt_decrypt/rsa.js: Added.
(run_test.):
(run_test.else):
(run_test.importVectorKeys):
(run_test.copyBuffer):
(run_test.equalBuffers):
(run_test):
* WebCryptoAPI/encrypt_decrypt/rsa.worker.js: Added.
* WebCryptoAPI/encrypt_decrypt/rsa_vectors.js: Added.
(getTestVectors):
* WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt: Added.
* WebCryptoAPI/encrypt_decrypt/test_aes_cbc.html: Added.
* WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt: Added.
* WebCryptoAPI/encrypt_decrypt/test_aes_ctr.html: Added.
* WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt: Added.
* WebCryptoAPI/encrypt_decrypt/test_aes_gcm.html: Added.
* WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt: Added.
* WebCryptoAPI/encrypt_decrypt/test_rsa_oaep.html: Added.
* WebCryptoAPI/encrypt_decrypt/w3c-import.log: Added.
* WebCryptoAPI/generateKey/failures.js: Added.
(run_test.parameterString):
(run_test.testError):
(run_test):
(run_test.invalidUsages):
(run_test.):
* WebCryptoAPI/generateKey/failures.worker.js: Added.
* WebCryptoAPI/generateKey/failures_AES-CBC.worker.js: Added.
* WebCryptoAPI/generateKey/failures_AES-CTR.worker.js: Added.
* WebCryptoAPI/generateKey/failures_AES-GCM.worker.js: Added.
* WebCryptoAPI/generateKey/failures_AES-KW.worker.js: Added.
* WebCryptoAPI/generateKey/failures_ECDH.worker.js: Added.
* WebCryptoAPI/generateKey/failures_ECDSA.worker.js: Added.
* WebCryptoAPI/generateKey/failures_HMAC.worker.js: Added.
* WebCryptoAPI/generateKey/failures_RSA-OAEP.worker.js: Added.
* WebCryptoAPI/generateKey/failures_RSA-PSS.worker.js: Added.
* WebCryptoAPI/generateKey/failures_RSASSA-PKCS1-v1_5.worker.js: Added.
* WebCryptoAPI/generateKey/successes.js: Added.
(run_test.parameterString):
(run_test.):
(run_test.testSuccess):
(run_test):
* WebCryptoAPI/generateKey/successes.worker.js: Added.
* WebCryptoAPI/generateKey/successes_AES-CBC.worker.js: Added.
* WebCryptoAPI/generateKey/successes_AES-CTR.worker.js: Added.
* WebCryptoAPI/generateKey/successes_AES-GCM.worker.js: Added.
* WebCryptoAPI/generateKey/successes_AES-KW.worker.js: Added.
* WebCryptoAPI/generateKey/successes_ECDH.worker.js: Added.
* WebCryptoAPI/generateKey/successes_ECDSA.worker.js: Added.
* WebCryptoAPI/generateKey/successes_HMAC.worker.js: Added.
* WebCryptoAPI/generateKey/successes_RSA-OAEP.worker.js: Added.
* WebCryptoAPI/generateKey/successes_RSA-PSS.worker.js: Added.
* WebCryptoAPI/generateKey/successes_RSASSA-PKCS1-v1_5.worker.js: Added.
* WebCryptoAPI/generateKey/test_aes-cbc-expected.txt: Added.
* WebCryptoAPI/generateKey/test_aes-cbc.html: Added.
* WebCryptoAPI/generateKey/test_aes-ctr-expected.txt: Added.
* WebCryptoAPI/generateKey/test_aes-ctr.html: Added.
* WebCryptoAPI/generateKey/test_failures-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures.html: Added.
* WebCryptoAPI/generateKey/test_failures_AES-CBC-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_AES-CBC.html: Added.
* WebCryptoAPI/generateKey/test_failures_AES-CTR-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_AES-CTR.html: Added.
* WebCryptoAPI/generateKey/test_failures_AES-GCM-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_AES-GCM.html: Added.
* WebCryptoAPI/generateKey/test_failures_AES-KW-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_AES-KW.html: Added.
* WebCryptoAPI/generateKey/test_failures_ECDH-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_ECDH.html: Added.
* WebCryptoAPI/generateKey/test_failures_ECDSA-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_ECDSA.html: Added.
* WebCryptoAPI/generateKey/test_failures_HMAC-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_HMAC.html: Added.
* WebCryptoAPI/generateKey/test_failures_RSA-OAEP-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_RSA-OAEP.html: Added.
* WebCryptoAPI/generateKey/test_failures_RSA-PSS-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_RSA-PSS.html: Added.
* WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5.html: Added.
* WebCryptoAPI/generateKey/test_successes-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes.html: Added.
* WebCryptoAPI/generateKey/test_successes_AES-CBC-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_AES-CBC.html: Added.
* WebCryptoAPI/generateKey/test_successes_AES-CTR-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_AES-CTR.html: Added.
* WebCryptoAPI/generateKey/test_successes_AES-GCM-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_AES-GCM.html: Added.
* WebCryptoAPI/generateKey/test_successes_AES-KW-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_AES-KW.html: Added.
* WebCryptoAPI/generateKey/test_successes_ECDH-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_ECDH.html: Added.
* WebCryptoAPI/generateKey/test_successes_ECDSA-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_ECDSA.html: Added.
* WebCryptoAPI/generateKey/test_successes_HMAC-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_HMAC.html: Added.
* WebCryptoAPI/generateKey/test_successes_RSA-OAEP-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_RSA-OAEP.html: Added.
* WebCryptoAPI/generateKey/test_successes_RSA-PSS-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_RSA-PSS.html: Added.
* WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5.html: Added.
* WebCryptoAPI/generateKey/w3c-import.log: Added.
* WebCryptoAPI/getRandomValues.js: Added.
(run_test.):
(run_test):
* WebCryptoAPI/getRandomValues.worker.js: Added.
* WebCryptoAPI/idlharness-expected.txt: Added.
* WebCryptoAPI/idlharness.html: Added.
* WebCryptoAPI/idlharness.worker.js: Added.
(request.onload):
* WebCryptoAPI/test_getRandomValues-expected.txt: Added.
* WebCryptoAPI/test_getRandomValues.html: Added.
* WebCryptoAPI/tools/generate.py: Added.
* WebCryptoAPI/tools/w3c-import.log: Added.
* WebCryptoAPI/util/helpers.js: Added.
(allNonemptySubsetsOf):
(objectToString.):
(objectToString):
(assert_goodCryptoKey):
(allAlgorithmSpecifiersFor):
(allValidUsages):
(allNameVariants):
* WebCryptoAPI/util/w3c-import.log: Added.
* WebCryptoAPI/w3c-import.log: Added.

LayoutTests:

* TestExpectations:
Skip test cases for unimplemented features.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/imported/w3c/WebCryptoAPI/</li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIOWNERS">trunk/LayoutTests/imported/w3c/WebCryptoAPI/OWNERS</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIREADMEmd">trunk/LayoutTests/imported/w3c/WebCryptoAPI/README.md</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIWebCryptoAPIidl">trunk/LayoutTests/imported/w3c/WebCryptoAPI/WebCryptoAPI.idl</a></li>
<li>trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/</li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIdigestdigestjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/digest.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIdigestdigestworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/digest.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIdigesttest_digestexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIdigesttest_digesthtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIdigestw3cimportlog">trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/w3c-import.log</a></li>
<li>trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/</li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaesjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaes_cbcworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_cbc.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaes_cbc_vectorsjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_cbc_vectors.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaes_ctrworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_ctr.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaes_ctr_vectorsjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_ctr_vectors.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaes_gcmworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_gcm.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaes_gcm_vectorsjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_gcm_vectors.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptrsajs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptrsaworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptrsa_vectorsjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa_vectors.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_aes_cbcexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_aes_cbchtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_cbc.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_aes_ctrexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_aes_ctrhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_ctr.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_aes_gcmexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_aes_gcmhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_gcm.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_rsa_oaepexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_rsa_oaephtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptw3cimportlog">trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/w3c-import.log</a></li>
<li>trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/</li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailuresjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailuresworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_AESCBCworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-CBC.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_AESCTRworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-CTR.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_AESGCMworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-GCM.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_AESKWworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-KW.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_ECDHworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_ECDH.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_ECDSAworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_ECDSA.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_HMACworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_HMAC.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_RSAOAEPworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSA-OAEP.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_RSAPSSworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSA-PSS.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_RSASSAPKCS1v1_5workerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSASSA-PKCS1-v1_5.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccessesjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccessesworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_AESCBCworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-CBC.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_AESCTRworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-CTR.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_AESGCMworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-GCM.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_AESKWworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-KW.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_ECDHworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_ECDH.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_ECDSAworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_ECDSA.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_HMACworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_HMAC.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_RSAOAEPworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSA-OAEP.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_RSAPSSworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSA-PSS.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_RSASSAPKCS1v1_5workerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSASSA-PKCS1-v1_5.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_aescbcexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-cbc-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_aescbchtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-cbc.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_aesctrexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-ctr-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_aesctrhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-ctr.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failuresexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failureshtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESCBCexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CBC-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESCBChtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CBC.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESCTRexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CTR-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESCTRhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CTR.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESGCMexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-GCM-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESGCMhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-GCM.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESKWexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-KW-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESKWhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-KW.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_ECDHexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDH-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_ECDHhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDH.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_ECDSAexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDSA-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_ECDSAhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDSA.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_HMACexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_HMAC-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_HMAChtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_HMAC.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_RSAOAEPexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-OAEP-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_RSAOAEPhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-OAEP.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_RSAPSSexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-PSS-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_RSAPSShtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-PSS.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_RSASSAPKCS1v1_5expectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_RSASSAPKCS1v1_5html">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successesexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successeshtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESCBCexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CBC-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESCBChtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CBC.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESCTRexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CTR-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESCTRhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CTR.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESGCMexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-GCM-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESGCMhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-GCM.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESKWexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-KW-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESKWhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-KW.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_ECDHexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDH-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_ECDHhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDH.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_ECDSAexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDSA-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_ECDSAhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDSA.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_HMACexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_HMAC-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_HMAChtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_HMAC.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_RSAOAEPexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-OAEP-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_RSAOAEPhtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-OAEP.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_RSAPSSexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-PSS-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_RSAPSShtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-PSS.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_RSASSAPKCS1v1_5expectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_RSASSAPKCS1v1_5html">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyw3cimportlog">trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/w3c-import.log</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgetRandomValuesjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/getRandomValues.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIgetRandomValuesworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/getRandomValues.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIidlharnessexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIidlharnesshtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIidlharnessworkerjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPItest_getRandomValuesexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/test_getRandomValues-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPItest_getRandomValueshtml">trunk/LayoutTests/imported/w3c/WebCryptoAPI/test_getRandomValues.html</a></li>
<li>trunk/LayoutTests/imported/w3c/WebCryptoAPI/tools/</li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPItoolsgeneratepy">trunk/LayoutTests/imported/w3c/WebCryptoAPI/tools/generate.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPItoolsw3cimportlog">trunk/LayoutTests/imported/w3c/WebCryptoAPI/tools/w3c-import.log</a></li>
<li>trunk/LayoutTests/imported/w3c/WebCryptoAPI/util/</li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIutilhelpersjs">trunk/LayoutTests/imported/w3c/WebCryptoAPI/util/helpers.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIutilw3cimportlog">trunk/LayoutTests/imported/w3c/WebCryptoAPI/util/w3c-import.log</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIw3cimportlog">trunk/LayoutTests/imported/w3c/WebCryptoAPI/w3c-import.log</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203200 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-13 23:54:23 UTC (rev 203200)
+++ trunk/LayoutTests/ChangeLog        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-07-13  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        Import W3C WebCryptoAPI tests
+        https://bugs.webkit.org/show_bug.cgi?id=159636
+
+        Reviewed by Alex Christensen.
+
+        * TestExpectations:
+        Skip test cases for unimplemented features.
+
</ins><span class="cx"> 2016-07-13  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove duplicated TestExpectation for perf/rel-list-remove.html on ios-simulator
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (203200 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2016-07-13 23:54:23 UTC (rev 203200)
+++ trunk/LayoutTests/TestExpectations        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -999,3 +999,34 @@
</span><span class="cx"> [ Debug ] js/regress/misc-bugs-847389-jpeg2000.html [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/159678 http/tests/preload/single_download_preload_runner.html [ Timeout ]
</span><ins>+
+# WebCryptoAPI tests, skip for unimplemented features. webkit.org/b/159638
+imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_cbc.html [ Skip ]
+imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_ctr.html [ Skip ]
+imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_gcm.html [ Skip ]
+imported/w3c/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_aes-cbc.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_aes-ctr.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CBC.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CTR.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-GCM.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-KW.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDH.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDSA.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_failures_HMAC.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-OAEP.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-PSS.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_failures.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CBC.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CTR.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-GCM.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-KW.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDH.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDSA.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_successes_HMAC.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-OAEP.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-PSS.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5.html [ Skip ]
+imported/w3c/WebCryptoAPI/generateKey/test_successes.html [ Skip ]
+imported/w3c/WebCryptoAPI/idlharness.html [ Skip ]
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (203200 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-07-13 23:54:23 UTC (rev 203200)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -1,3 +1,160 @@
</span><ins>+2016-07-13  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        Import W3C WebCryptoAPI tests
+        https://bugs.webkit.org/show_bug.cgi?id=159636
+
+        Reviewed by Alex Christensen.
+
+        * WebCryptoAPI/OWNERS: Added.
+        * WebCryptoAPI/README.md: Added.
+        * WebCryptoAPI/WebCryptoAPI.idl: Added.
+        * WebCryptoAPI/digest/digest.js: Added.
+        (run_test.):
+        (run_test.copyBuffer):
+        (run_test.equalBuffers):
+        (run_test):
+        * WebCryptoAPI/digest/digest.worker.js: Added.
+        * WebCryptoAPI/digest/test_digest-expected.txt: Added.
+        * WebCryptoAPI/digest/test_digest.html: Added.
+        * WebCryptoAPI/digest/w3c-import.log: Added.
+        * WebCryptoAPI/encrypt_decrypt/aes.js: Added.
+        (run_test.):
+        (run_test.importVectorKey):
+        (run_test):
+        (run_test.equalBuffers):
+        * WebCryptoAPI/encrypt_decrypt/aes_cbc.worker.js: Added.
+        * WebCryptoAPI/encrypt_decrypt/aes_cbc_vectors.js: Added.
+        (getTestVectors):
+        * WebCryptoAPI/encrypt_decrypt/aes_ctr.worker.js: Added.
+        * WebCryptoAPI/encrypt_decrypt/aes_ctr_vectors.js: Added.
+        (getTestVectors):
+        * WebCryptoAPI/encrypt_decrypt/aes_gcm.worker.js: Added.
+        * WebCryptoAPI/encrypt_decrypt/aes_gcm_vectors.js: Added.
+        (getTestVectors):
+        * WebCryptoAPI/encrypt_decrypt/rsa.js: Added.
+        (run_test.):
+        (run_test.else):
+        (run_test.importVectorKeys):
+        (run_test.copyBuffer):
+        (run_test.equalBuffers):
+        (run_test):
+        * WebCryptoAPI/encrypt_decrypt/rsa.worker.js: Added.
+        * WebCryptoAPI/encrypt_decrypt/rsa_vectors.js: Added.
+        (getTestVectors):
+        * WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt: Added.
+        * WebCryptoAPI/encrypt_decrypt/test_aes_cbc.html: Added.
+        * WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt: Added.
+        * WebCryptoAPI/encrypt_decrypt/test_aes_ctr.html: Added.
+        * WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt: Added.
+        * WebCryptoAPI/encrypt_decrypt/test_aes_gcm.html: Added.
+        * WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt: Added.
+        * WebCryptoAPI/encrypt_decrypt/test_rsa_oaep.html: Added.
+        * WebCryptoAPI/encrypt_decrypt/w3c-import.log: Added.
+        * WebCryptoAPI/generateKey/failures.js: Added.
+        (run_test.parameterString):
+        (run_test.testError):
+        (run_test):
+        (run_test.invalidUsages):
+        (run_test.):
+        * WebCryptoAPI/generateKey/failures.worker.js: Added.
+        * WebCryptoAPI/generateKey/failures_AES-CBC.worker.js: Added.
+        * WebCryptoAPI/generateKey/failures_AES-CTR.worker.js: Added.
+        * WebCryptoAPI/generateKey/failures_AES-GCM.worker.js: Added.
+        * WebCryptoAPI/generateKey/failures_AES-KW.worker.js: Added.
+        * WebCryptoAPI/generateKey/failures_ECDH.worker.js: Added.
+        * WebCryptoAPI/generateKey/failures_ECDSA.worker.js: Added.
+        * WebCryptoAPI/generateKey/failures_HMAC.worker.js: Added.
+        * WebCryptoAPI/generateKey/failures_RSA-OAEP.worker.js: Added.
+        * WebCryptoAPI/generateKey/failures_RSA-PSS.worker.js: Added.
+        * WebCryptoAPI/generateKey/failures_RSASSA-PKCS1-v1_5.worker.js: Added.
+        * WebCryptoAPI/generateKey/successes.js: Added.
+        (run_test.parameterString):
+        (run_test.):
+        (run_test.testSuccess):
+        (run_test):
+        * WebCryptoAPI/generateKey/successes.worker.js: Added.
+        * WebCryptoAPI/generateKey/successes_AES-CBC.worker.js: Added.
+        * WebCryptoAPI/generateKey/successes_AES-CTR.worker.js: Added.
+        * WebCryptoAPI/generateKey/successes_AES-GCM.worker.js: Added.
+        * WebCryptoAPI/generateKey/successes_AES-KW.worker.js: Added.
+        * WebCryptoAPI/generateKey/successes_ECDH.worker.js: Added.
+        * WebCryptoAPI/generateKey/successes_ECDSA.worker.js: Added.
+        * WebCryptoAPI/generateKey/successes_HMAC.worker.js: Added.
+        * WebCryptoAPI/generateKey/successes_RSA-OAEP.worker.js: Added.
+        * WebCryptoAPI/generateKey/successes_RSA-PSS.worker.js: Added.
+        * WebCryptoAPI/generateKey/successes_RSASSA-PKCS1-v1_5.worker.js: Added.
+        * WebCryptoAPI/generateKey/test_aes-cbc-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_aes-cbc.html: Added.
+        * WebCryptoAPI/generateKey/test_aes-ctr-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_aes-ctr.html: Added.
+        * WebCryptoAPI/generateKey/test_failures-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_failures.html: Added.
+        * WebCryptoAPI/generateKey/test_failures_AES-CBC-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_failures_AES-CBC.html: Added.
+        * WebCryptoAPI/generateKey/test_failures_AES-CTR-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_failures_AES-CTR.html: Added.
+        * WebCryptoAPI/generateKey/test_failures_AES-GCM-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_failures_AES-GCM.html: Added.
+        * WebCryptoAPI/generateKey/test_failures_AES-KW-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_failures_AES-KW.html: Added.
+        * WebCryptoAPI/generateKey/test_failures_ECDH-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_failures_ECDH.html: Added.
+        * WebCryptoAPI/generateKey/test_failures_ECDSA-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_failures_ECDSA.html: Added.
+        * WebCryptoAPI/generateKey/test_failures_HMAC-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_failures_HMAC.html: Added.
+        * WebCryptoAPI/generateKey/test_failures_RSA-OAEP-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_failures_RSA-OAEP.html: Added.
+        * WebCryptoAPI/generateKey/test_failures_RSA-PSS-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_failures_RSA-PSS.html: Added.
+        * WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5.html: Added.
+        * WebCryptoAPI/generateKey/test_successes-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_successes.html: Added.
+        * WebCryptoAPI/generateKey/test_successes_AES-CBC-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_successes_AES-CBC.html: Added.
+        * WebCryptoAPI/generateKey/test_successes_AES-CTR-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_successes_AES-CTR.html: Added.
+        * WebCryptoAPI/generateKey/test_successes_AES-GCM-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_successes_AES-GCM.html: Added.
+        * WebCryptoAPI/generateKey/test_successes_AES-KW-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_successes_AES-KW.html: Added.
+        * WebCryptoAPI/generateKey/test_successes_ECDH-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_successes_ECDH.html: Added.
+        * WebCryptoAPI/generateKey/test_successes_ECDSA-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_successes_ECDSA.html: Added.
+        * WebCryptoAPI/generateKey/test_successes_HMAC-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_successes_HMAC.html: Added.
+        * WebCryptoAPI/generateKey/test_successes_RSA-OAEP-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_successes_RSA-OAEP.html: Added.
+        * WebCryptoAPI/generateKey/test_successes_RSA-PSS-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_successes_RSA-PSS.html: Added.
+        * WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5-expected.txt: Added.
+        * WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5.html: Added.
+        * WebCryptoAPI/generateKey/w3c-import.log: Added.
+        * WebCryptoAPI/getRandomValues.js: Added.
+        (run_test.):
+        (run_test):
+        * WebCryptoAPI/getRandomValues.worker.js: Added.
+        * WebCryptoAPI/idlharness-expected.txt: Added.
+        * WebCryptoAPI/idlharness.html: Added.
+        * WebCryptoAPI/idlharness.worker.js: Added.
+        (request.onload):
+        * WebCryptoAPI/test_getRandomValues-expected.txt: Added.
+        * WebCryptoAPI/test_getRandomValues.html: Added.
+        * WebCryptoAPI/tools/generate.py: Added.
+        * WebCryptoAPI/tools/w3c-import.log: Added.
+        * WebCryptoAPI/util/helpers.js: Added.
+        (allNonemptySubsetsOf):
+        (objectToString.):
+        (objectToString):
+        (assert_goodCryptoKey):
+        (allAlgorithmSpecifiersFor):
+        (allValidUsages):
+        (allNameVariants):
+        * WebCryptoAPI/util/w3c-import.log: Added.
+        * WebCryptoAPI/w3c-import.log: Added.
+
</ins><span class="cx"> 2016-07-13  Youenn Fablet  &lt;youennf@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Refresh WPT tests up to c875b42
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIOWNERS"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/OWNERS (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/OWNERS                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/OWNERS        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+@Wafflespeanut
+@Ms2ger
+@jimsch
+@engelke
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIREADMEmd"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/README.md (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/README.md                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/README.md        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Directory for Crypto API tests
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIWebCryptoAPIidl"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/WebCryptoAPI.idl (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/WebCryptoAPI.idl                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/WebCryptoAPI.idl        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,277 @@
</span><ins>+[NoInterfaceObject]
+interface GlobalCrypto {
+  readonly attribute Crypto crypto;
+};
+
+//Window implements GlobalCrypto;
+//WorkerGlobalScope implements GlobalCrypto;
+
+[Exposed=(Window,Worker)]
+interface Crypto {
+  readonly attribute SubtleCrypto subtle;
+  ArrayBufferView getRandomValues(ArrayBufferView array);
+};
+
+typedef (object or DOMString) AlgorithmIdentifier;
+
+typedef AlgorithmIdentifier HashAlgorithmIdentifier;
+
+dictionary Algorithm {
+  required DOMString name;
+};
+
+dictionary KeyAlgorithm {
+  required DOMString name;
+};
+
+enum KeyType { &quot;public&quot;, &quot;private&quot;, &quot;secret&quot; };
+
+enum KeyUsage { &quot;encrypt&quot;, &quot;decrypt&quot;, &quot;sign&quot;, &quot;verify&quot;, &quot;deriveKey&quot;, &quot;deriveBits&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot; };
+
+[Exposed=(Window,Worker)]
+interface CryptoKey {
+  readonly attribute KeyType type;
+  readonly attribute boolean extractable;
+  readonly attribute object algorithm;
+  readonly attribute object usages;
+};
+
+
+enum KeyFormat { &quot;raw&quot;, &quot;spki&quot;, &quot;pkcs8&quot;, &quot;jwk&quot; };
+
+[Exposed=(Window,Worker)]
+interface SubtleCrypto {
+  Promise&lt;any&gt; encrypt(AlgorithmIdentifier algorithm,
+                       CryptoKey key,
+                       BufferSource data);
+  Promise&lt;any&gt; decrypt(AlgorithmIdentifier algorithm,
+                       CryptoKey key,
+                       BufferSource data);
+  Promise&lt;any&gt; sign(AlgorithmIdentifier algorithm,
+                    CryptoKey key,
+                    BufferSource data);
+  Promise&lt;any&gt; verify(AlgorithmIdentifier algorithm,
+                      CryptoKey key,
+                      BufferSource signature,
+                      BufferSource data);
+  Promise&lt;any&gt; digest(AlgorithmIdentifier algorithm,
+                      BufferSource data);
+
+  Promise&lt;any&gt; generateKey(AlgorithmIdentifier algorithm,
+                          boolean extractable,
+                          sequence&lt;KeyUsage&gt; keyUsages );
+  Promise&lt;any&gt; deriveKey(AlgorithmIdentifier algorithm,
+                         CryptoKey baseKey,
+                         AlgorithmIdentifier derivedKeyType,
+                         boolean extractable,
+                         sequence&lt;KeyUsage&gt; keyUsages );
+  Promise&lt;any&gt; deriveBits(AlgorithmIdentifier algorithm,
+                          CryptoKey baseKey,
+                          unsigned long length);
+
+  Promise&lt;any&gt; importKey(KeyFormat format,
+                         (BufferSource or JsonWebKey) keyData,
+                         AlgorithmIdentifier algorithm,
+                         boolean extractable,
+                         sequence&lt;KeyUsage&gt; keyUsages );
+  Promise&lt;any&gt; exportKey(KeyFormat format, CryptoKey key);
+
+  Promise&lt;any&gt; wrapKey(KeyFormat format,
+                       CryptoKey key,
+                       CryptoKey wrappingKey,
+                       AlgorithmIdentifier wrapAlgorithm);
+  Promise&lt;any&gt; unwrapKey(KeyFormat format,
+                         BufferSource wrappedKey,
+                         CryptoKey unwrappingKey,
+                         AlgorithmIdentifier unwrapAlgorithm,
+                         AlgorithmIdentifier unwrappedKeyAlgorithm,
+                         boolean extractable,
+                         sequence&lt;KeyUsage&gt; keyUsages );
+};
+
+dictionary RsaOtherPrimesInfo {
+ // The following fields are defined in Section 6.3.2.7 of JSON Web Algorithms
+  DOMString r;
+  DOMString d;
+  DOMString t;
+};
+
+dictionary JsonWebKey {
+  // The following fields are defined in Section 3.1 of JSON Web Key
+  DOMString kty;
+  DOMString use;
+  sequence&lt;DOMString&gt; key_ops;
+  DOMString alg;
+
+  // The following fields are defined in JSON Web Key Parameters Registration
+  boolean ext;
+
+  // The following fields are defined in Section 6 of JSON Web Algorithms
+  DOMString crv;
+  DOMString x;
+  DOMString y;
+  DOMString d;
+  DOMString n;
+  DOMString e;
+  DOMString p;
+  DOMString q;
+  DOMString dp;
+  DOMString dq;
+  DOMString qi;
+  sequence&lt;RsaOtherPrimesInfo&gt; oth;
+  DOMString k;
+};
+
+typedef Uint8Array BigInteger;
+
+dictionary CryptoKeyPair {
+  CryptoKey publicKey;
+  CryptoKey privateKey;
+};
+
+dictionary RsaKeyGenParams : Algorithm {
+  // The length, in bits, of the RSA modulus
+  [EnforceRange] required unsigned long modulusLength;
+  // The RSA public exponent
+  required BigInteger publicExponent;
+};
+
+dictionary RsaHashedKeyGenParams : RsaKeyGenParams {
+  // The hash algorithm to use
+  required HashAlgorithmIdentifier hash;
+};
+
+dictionary RsaKeyAlgorithm : KeyAlgorithm {
+  // The length, in bits, of the RSA modulus
+  required unsigned long modulusLength;
+  // The RSA public exponent
+  required BigInteger publicExponent;
+};
+
+dictionary RsaHashedKeyAlgorithm : RsaKeyAlgorithm {
+  // The hash algorithm that is used with this key
+  required KeyAlgorithm hash;
+};
+
+dictionary RsaHashedImportParams {
+  // The hash algorithm to use
+  required HashAlgorithmIdentifier hash;
+};
+
+dictionary RsaPssParams : Algorithm {
+// The desired length of the random salt
+[EnforceRange] required unsigned long saltLength;
+};
+
+dictionary RsaOaepParams : Algorithm {
+// The optional label/application data to associate with the message
+BufferSource label;
+};
+
+dictionary EcdsaParams : Algorithm {
+// The hash algorithm to use
+required HashAlgorithmIdentifier hash;
+};
+
+typedef DOMString NamedCurve;
+
+dictionary EcKeyGenParams : Algorithm {
+// A named curve
+required NamedCurve namedCurve;
+};
+
+dictionary EcKeyAlgorithm : KeyAlgorithm {
+// The named curve that the key uses
+required NamedCurve namedCurve;
+};
+
+dictionary EcKeyImportParams : Algorithm {
+// A named curve
+required NamedCurve namedCurve;
+};
+
+dictionary EcdhKeyDeriveParams : Algorithm {
+// The peer's EC public key.
+required CryptoKey public;
+};
+
+dictionary AesCtrParams : Algorithm {
+// The initial value of the counter block. counter MUST be 16 bytes
+// (the AES block size). The counter bits are the rightmost length
+// bits of the counter block. The rest of the counter block is for
+// the nonce. The counter bits are incremented using the standard
+// incrementing function specified in NIST SP 800-38A Appendix B.1:
+// the counter bits are interpreted as a big-endian integer and
+// incremented by one.
+required BufferSource counter;
+// The length, in bits, of the rightmost part of the counter block
+// that is incremented.
+[EnforceRange] required octet length;
+};
+
+dictionary AesKeyAlgorithm : KeyAlgorithm {
+// The length, in bits, of the key.
+required unsigned short length;
+};
+
+dictionary AesKeyGenParams : Algorithm {
+// The length, in bits, of the key.
+[EnforceRange] required unsigned short length;
+};
+
+dictionary AesDerivedKeyParams : Algorithm {
+// The length, in bits, of the key.
+[EnforceRange] required unsigned short length;
+};
+
+dictionary AesCbcParams : Algorithm {
+// The initialization vector. MUST be 16 bytes.
+required BufferSource iv;
+};
+
+dictionary AesGcmParams : Algorithm {
+// The initialization vector to use. May be up to 2^64-1 bytes long.
+required BufferSource iv;
+// The additional authentication data to include.
+BufferSource additionalData;
+// The desired length of the authentication tag. May be 0 - 128.
+[EnforceRange] octet tagLength;
+};
+
+dictionary HmacImportParams : Algorithm {
+// The inner hash function to use.
+HashAlgorithmIdentifier hash;
+// The length (in bits) of the key.
+[EnforceRange] unsigned long length;
+};
+
+dictionary HmacKeyAlgorithm : KeyAlgorithm {
+// The inner hash function to use.
+required KeyAlgorithm hash;
+// The length (in bits) of the key.
+required unsigned long length;
+};
+
+dictionary HmacKeyGenParams : Algorithm {
+// The inner hash function to use.
+required HashAlgorithmIdentifier hash;
+// The length (in bits) of the key to generate. If unspecified, the
+// recommended length will be used, which is the size of the associated hash function's block
+// size.
+[EnforceRange] unsigned long length;
+};
+
+dictionary HkdfCtrParams : Algorithm {
+// The algorithm to use with HMAC (e.g.: SHA-256)
+required HashAlgorithmIdentifier hash;
+// A bit string that corresponds to the label that identifies the purpose for the derived keying material.
+required BufferSource label;
+// A bit string that corresponds to the context of the key derivation, as described in Section 5 of [NIST SP800-108]
+required BufferSource context;
+};
+
+dictionary Pbkdf2Params : Algorithm {
+required BufferSource salt;
+[EnforceRange] required unsigned long iterations;
+required HashAlgorithmIdentifier hash;
+};
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIdigestdigestjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/digest.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/digest.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/digest.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,154 @@
</span><ins>+
+function run_test() {
+    var subtle = crypto.subtle; // Change to test prefixed implementations
+
+    var sourceData = {
+        empty: new Uint8Array(0),
+        short: new Uint8Array([21, 110, 234, 124, 193, 76, 86, 203, 148, 219, 3, 10, 74, 157, 149, 255]),
+        medium: new Uint8Array([182, 200, 249, 223, 100, 140, 208, 136, 183, 15, 56, 231, 65, 151, 177, 140, 184, 30, 30, 67, 80, 213, 11, 204, 184, 251, 90, 115, 121, 200, 123, 178, 227, 214, 237, 84, 97, 237, 30, 159, 54, 243, 64, 163, 150, 42, 68, 107, 129, 91, 121, 75, 75, 212, 58, 68, 3, 80, 32, 119, 178, 37, 108, 200, 7, 131, 127, 58, 172, 209, 24, 235, 75, 156, 43, 174, 184, 151, 6, 134, 37, 171, 172, 161, 147])
+    };
+
+    sourceData.long = new Uint8Array(1024 * sourceData.medium.byteLength);
+    for (var i=0; i&lt;1024; i++) {
+        sourceData.long.set(sourceData.medium, i * sourceData.medium.byteLength);
+    }
+
+    var digestedData = {
+        &quot;sha-1&quot;: {
+            empty: new Uint8Array([218, 57, 163, 238, 94, 107, 75, 13, 50, 85, 191, 239, 149, 96, 24, 144, 175, 216, 7, 9]),
+            short: new Uint8Array([201, 19, 24, 205, 242, 57, 106, 1, 94, 63, 78, 106, 134, 160, 186, 101, 184, 99, 89, 68]),
+            medium: new Uint8Array([229, 65, 6, 8, 112, 235, 22, 191, 51, 182, 142, 81, 245, 19, 82, 104, 147, 152, 103, 41]),
+            long: new Uint8Array([48, 152, 181, 0, 55, 236, 208, 46, 189, 101, 118, 83, 178, 191, 160, 30, 238, 39, 162, 234])
+        },
+        &quot;sha-256&quot;: {
+            empty: new Uint8Array([227, 176, 196, 66, 152, 252, 28, 20, 154, 251, 244, 200, 153, 111, 185, 36, 39, 174, 65, 228, 100, 155, 147, 76, 164, 149, 153, 27, 120, 82, 184, 85]),
+            short: new Uint8Array([162, 131, 17, 134, 152, 71, 146, 199, 211, 45, 89, 200, 151, 64, 104, 127, 25, 173, 220, 27, 149, 158, 113, 161, 204, 83, 138, 59, 126, 216, 67, 242]),
+            medium: new Uint8Array([83, 83, 103, 135, 126, 240, 20, 215, 252, 113, 126, 92, 183, 132, 62, 89, 182, 26, 238, 98, 199, 2, 156, 236, 126, 198, 193, 47, 217, 36, 224, 228]),
+            long: new Uint8Array([20, 205, 234, 157, 199, 95, 90, 98, 116, 217, 252, 30, 100, 0, 153, 18, 241, 220, 211, 6, 180, 143, 232, 233, 207, 18, 45, 230, 113, 87, 23, 129])
+        },
+        &quot;sha-384&quot;: {
+            empty: new Uint8Array([56, 176, 96, 167, 81, 172, 150, 56, 76, 217, 50, 126, 177, 177, 227, 106, 33, 253, 183, 17, 20, 190, 7, 67, 76, 12, 199, 191, 99, 246, 225, 218, 39, 78, 222, 191, 231, 111, 101, 251, 213, 26, 210, 241, 72, 152, 185, 91]),
+            short: new Uint8Array([107, 245, 234, 101, 36, 209, 205, 220, 67, 247, 207, 59, 86, 238, 5, 146, 39, 64, 74, 47, 83, 143, 2, 42, 61, 183, 68, 122, 120, 44, 6, 193, 237, 5, 232, 171, 79, 94, 220, 23, 243, 113, 20, 64, 223, 233, 119, 49]),
+            medium: new Uint8Array([203, 194, 197, 136, 254, 91, 37, 249, 22, 218, 40, 180, 228, 122, 72, 74, 230, 252, 31, 228, 144, 45, 213, 201, 147, 154, 107, 253, 3, 74, 179, 180, 139, 57, 8, 116, 54, 1, 31, 106, 153, 135, 157, 39, 149, 64, 233, 119]),
+            long: new Uint8Array([73, 244, 253, 179, 152, 25, 104, 249, 125, 87, 55, 15, 133, 52, 80, 103, 205, 82, 150, 169, 125, 209, 161, 142, 6, 145, 30, 117, 110, 150, 8, 73, 37, 41, 135, 14, 26, 209, 48, 153, 141, 87, 203, 251, 183, 193, 208, 158])
+        },
+        &quot;sha-512&quot;: {
+            empty: new Uint8Array([207, 131, 225, 53, 126, 239, 184, 189, 241, 84, 40, 80, 214, 109, 128, 7, 214, 32, 228, 5, 11, 87, 21, 220, 131, 244, 169, 33, 211, 108, 233, 206, 71, 208, 209, 60, 93, 133, 242, 176, 255, 131, 24, 210, 135, 126, 236, 47, 99, 185, 49, 189, 71, 65, 122, 129, 165, 56, 50, 122, 249, 39, 218, 62]),
+            short: new Uint8Array([55, 82, 72, 190, 95, 243, 75, 231, 76, 171, 79, 241, 195, 188, 141, 198, 139, 213, 248, 223, 244, 2, 62, 152, 248, 123, 134, 92, 255, 44, 114, 66, 146, 223, 24, 148, 67, 166, 79, 244, 19, 74, 101, 205, 70, 53, 185, 212, 245, 220, 13, 63, 182, 117, 40, 0, 42, 99, 172, 242, 108, 157, 165, 117]),
+            medium: new Uint8Array([185, 16, 159, 131, 158, 142, 164, 60, 137, 15, 41, 60, 225, 29, 198, 226, 121, 141, 30, 36, 49, 241, 228, 185, 25, 227, 178, 12, 79, 54, 48, 59, 163, 156, 145, 109, 179, 6, 196, 90, 59, 101, 118, 31, 245, 190, 133, 50, 142, 234, 244, 44, 56, 48, 241, 217, 94, 122, 65, 22, 91, 125, 45, 54]),
+            long: new Uint8Array([75, 2, 202, 246, 80, 39, 96, 48, 234, 86, 23, 229, 151, 197, 213, 63, 217, 218, 166, 139, 120, 191, 230, 11, 34, 170, 184, 211, 106, 76, 42, 58, 255, 219, 113, 35, 79, 73, 39, 103, 55, 197, 117, 221, 247, 77, 20, 5, 76, 189, 111, 219, 152, 253, 13, 220, 188, 180, 111, 145, 173, 118, 182, 238])
+        },
+    }
+
+    // Try every combination of hash with source data size. Variations tested are
+    // hash name in upper, lower, or mixed case, and upper-case version with the
+    // source buffer altered after call.
+    Object.keys(sourceData).forEach(function(size) {
+        Object.keys(digestedData).forEach(function(alg) {
+            var upCase = alg.toUpperCase();
+            var downCase = alg.toLowerCase();
+            var mixedCase = upCase.substr(0, 1) + downCase.substr(1);
+
+            promise_test(function(test) {
+                var promise = subtle.digest({name: upCase}, sourceData[size])
+                .then(function(result) {
+                    assert_true(equalBuffers(result, digestedData[alg][size]), &quot;digest() yielded expected result for &quot; + alg + &quot;:&quot; + size);
+                }, function(err) {
+                    assert_unreached(&quot;digest() threw an error for &quot; + alg + &quot;:&quot; + size + &quot; - &quot; + err.message);
+                });
+
+                return promise;
+            }, upCase + &quot; with &quot; + size + &quot; source data&quot;);
+
+            promise_test(function(test) {
+                var promise = subtle.digest({name: mixedCase}, sourceData[size])
+                .then(function(result) {
+                    assert_true(equalBuffers(result, digestedData[alg][size]), &quot;digest() yielded expected result for &quot; + alg + &quot;:&quot; + size);
+                }, function(err) {
+                    assert_unreached(&quot;digest() threw an error for &quot; + alg + &quot;:&quot; + size + &quot; - &quot; + err.message);mixedCase
+                });
+
+                return promise;
+            }, downCase + &quot; with &quot; + size + &quot; source data&quot;);
+
+            promise_test(function(test) {
+                var promise = subtle.digest({name: mixedCase}, sourceData[size])
+                .then(function(result) {
+                    assert_true(equalBuffers(result, digestedData[alg][size]), &quot;digest() yielded expected result for &quot; + alg + &quot;:&quot; + size);
+                }, function(err) {
+                    assert_unreached(&quot;digest() threw an error for &quot; + alg + &quot;:&quot; + size + &quot; - &quot; + err.message);
+                });
+
+                return promise;
+            }, mixedCase + &quot; with &quot; + size + &quot; source data&quot;);
+
+            promise_test(function(test) {
+                var copiedBuffer = copyBuffer(sourceData[size]);
+                var promise = subtle.digest({name: upCase}, copiedBuffer)
+                .then(function(result) {
+                    assert_true(equalBuffers(result, digestedData[alg][size]), &quot;digest() yielded expected result for &quot; + alg + &quot;:&quot; + size);
+                }, function(err) {
+                    assert_unreached(&quot;digest() threw an error for &quot; + alg + &quot;:&quot; + size + &quot; - &quot; + err.message);
+                });
+
+                copiedBuffer[0] = 255 - copiedBuffer;
+                return promise;
+            }, upCase + &quot; with &quot; + size + &quot; source data and altered buffer after call&quot;);
+
+        });
+    });
+
+    // Call digest() with bad algorithm names to get an error
+    var badNames = [&quot;AES-GCM&quot;, &quot;RSA-OAEP&quot;, &quot;PBKDF2&quot;, &quot;AES-KW&quot;];
+    Object.keys(sourceData).forEach(function(size) {
+        badNames.forEach(function(badName) {
+
+            promise_test(function(test) {
+                var promise = subtle.digest({name: badName}, sourceData[size])
+                .then(function(result) {
+                    assert_unreached(&quot;digest() should not have worked for &quot; + alg + &quot;:&quot; + size);
+                }, function(err) {
+                    assert_equals(err.name, &quot;NotSupportedError&quot;, &quot;Bad algorithm name should cause NotSupportedError&quot;)
+                });
+
+                return promise;
+            }, badName + &quot; with &quot; + size);
+
+        });
+    });
+
+
+    done();
+
+
+    // Returns a copy of the sourceBuffer it is sent.
+    function copyBuffer(sourceBuffer) {
+        var source = new Uint8Array(sourceBuffer);
+        var copy = new Uint8Array(sourceBuffer.byteLength)
+
+        for (var i=0; i&lt;source.byteLength; i++) {
+            copy[i] = source[i];
+        }
+
+        return copy;
+    }
+
+    function equalBuffers(a, b) {
+        if (a.byteLength !== b.byteLength) {
+            return false;
+        }
+
+        var aBytes = new Uint8Array(a);
+        var bBytes = new Uint8Array(b);
+
+        for (var i=0; i&lt;a.byteLength; i++) {
+            if (aBytes[i] !== bBytes[i]) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    return;
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIdigestdigestworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/digest.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/digest.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/digest.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;digest.js&quot;);
+
+run_test();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIdigesttest_digestexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+encrypt Tests for digest method
+
+
+FAIL SHA-1 with empty source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-1 with empty source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-1 with empty source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-1 with empty source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-256 with empty source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-256 with empty source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-256 with empty source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-256 with empty source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-384 with empty source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-384 with empty source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-384 with empty source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-384 with empty source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-512 with empty source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-512 with empty source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-512 with empty source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-512 with empty source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-1 with short source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-1 with short source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-1 with short source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-1 with short source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-256 with short source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-256 with short source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-256 with short source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-256 with short source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-384 with short source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-384 with short source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-384 with short source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-384 with short source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-512 with short source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-512 with short source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-512 with short source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-512 with short source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-1 with medium source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-1 with medium source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-1 with medium source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-1 with medium source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-256 with medium source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-256 with medium source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-256 with medium source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-256 with medium source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-384 with medium source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-384 with medium source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-384 with medium source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-384 with medium source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-512 with medium source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-512 with medium source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-512 with medium source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-512 with medium source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-1 with long source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-1 with long source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-1 with long source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-1 with long source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-256 with long source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-256 with long source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-256 with long source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-256 with long source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-384 with long source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-384 with long source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-384 with long source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-384 with long source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-512 with long source data undefined is not an object (evaluating 'subtle.digest')
+FAIL sha-512 with long source data undefined is not an object (evaluating 'subtle.digest')
+FAIL Sha-512 with long source data undefined is not an object (evaluating 'subtle.digest')
+FAIL SHA-512 with long source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
+FAIL AES-GCM with empty undefined is not an object (evaluating 'subtle.digest')
+FAIL RSA-OAEP with empty undefined is not an object (evaluating 'subtle.digest')
+FAIL PBKDF2 with empty undefined is not an object (evaluating 'subtle.digest')
+FAIL AES-KW with empty undefined is not an object (evaluating 'subtle.digest')
+FAIL AES-GCM with short undefined is not an object (evaluating 'subtle.digest')
+FAIL RSA-OAEP with short undefined is not an object (evaluating 'subtle.digest')
+FAIL PBKDF2 with short undefined is not an object (evaluating 'subtle.digest')
+FAIL AES-KW with short undefined is not an object (evaluating 'subtle.digest')
+FAIL AES-GCM with medium undefined is not an object (evaluating 'subtle.digest')
+FAIL RSA-OAEP with medium undefined is not an object (evaluating 'subtle.digest')
+FAIL PBKDF2 with medium undefined is not an object (evaluating 'subtle.digest')
+FAIL AES-KW with medium undefined is not an object (evaluating 'subtle.digest')
+FAIL AES-GCM with long undefined is not an object (evaluating 'subtle.digest')
+FAIL RSA-OAEP with long undefined is not an object (evaluating 'subtle.digest')
+FAIL PBKDF2 with long undefined is not an object (evaluating 'subtle.digest')
+FAIL AES-KW with long undefined is not an object (evaluating 'subtle.digest')
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIdigesttest_digesthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: digest()&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#dfn-SubtleCrypto-method-digest&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;digest.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;encrypt Tests for digest method&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test();
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIdigestw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/w3c-import.log (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/w3c-import.log        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+        https://github.com/w3c/csswg-test
+        https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/WebCryptoAPI/digest/digest.js
+/LayoutTests/imported/w3c/WebCryptoAPI/digest/digest.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest.html
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,323 @@
</span><ins>+
+function run_test() {
+    var subtle = self.crypto.subtle; // Change to test prefixed implementations
+
+    // When are all these tests really done? When all the promises they use have resolved.
+    var all_promises = [];
+
+    // Source file aes_XXX_vectors.js provides the getTestVectors method
+    // for the AES-XXX algorithm that drives these tests.
+    var vectors = getTestVectors();
+    var passingVectors = vectors.passing;
+    var failingVectors = vectors.failing;
+    var decryptionFailingVectors = vectors.decryptionFailing;
+
+    // Check for successful encryption.
+    passingVectors.forEach(function(vector) {
+        var promise = importVectorKey(vector, [&quot;encrypt&quot;, &quot;decrypt&quot;])
+        .then(function(vector) {
+            promise_test(function(test) {
+                return subtle.encrypt(vector.algorithm, vector.key, vector.plaintext)
+                .then(function(result) {
+                    assert_true(equalBuffers(result, vector.result), &quot;Should return expected result&quot;);
+                }, function(err) {
+                    assert_unreached(&quot;encrypt error for test &quot; + vector.name + &quot;: &quot; + err.message);
+                });
+            }, vector.name);
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importKey failed for &quot; + vector.name);
+            }, &quot;importKey step: &quot; + vector.name);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Check for successful encryption even if the buffer is changed after calling encrypt.
+    passingVectors.forEach(function(vector) {
+        var plaintext = copyBuffer(vector.plaintext);
+        var promise = importVectorKey(vector, [&quot;encrypt&quot;, &quot;decrypt&quot;])
+        .then(function(vector) {
+            promise_test(function(test) {
+                var operation = subtle.encrypt(vector.algorithm, vector.key, plaintext)
+                .then(function(result) {
+                    assert_true(equalBuffers(result, vector.result), &quot;Should return expected result&quot;);
+                }, function(err) {
+                    assert_unreached(&quot;encrypt error for test &quot; + vector.name + &quot;: &quot; + err.message);
+                });
+                plaintext[0] = 255 - plaintext[0];
+                return operation;
+            }, vector.name + &quot; with altered plaintext&quot;);
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importKey failed for &quot; + vector.name);
+            }, &quot;importKey step: &quot; + vector.name + &quot; with altered plaintext&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Check for successful decryption.
+    passingVectors.forEach(function(vector) {
+        var promise = importVectorKey(vector, [&quot;encrypt&quot;, &quot;decrypt&quot;])
+        .then(function(vector) {
+            promise_test(function(test) {
+                return subtle.decrypt(vector.algorithm, vector.key, vector.result)
+                .then(function(result) {
+                    assert_true(equalBuffers(result, vector.plaintext), &quot;Should return expected result&quot;);
+                }, function(err) {
+                    assert_unreached(&quot;decrypt error for test &quot; + vector.name + &quot;: &quot; + err.message);
+                });
+            }, vector.name + &quot; decryption&quot;);
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importKey failed for &quot; + vector.name);
+            }, &quot;importKey step for decryption: &quot; + vector.name);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Check for successful decryption even if ciphertext is altered.
+    passingVectors.forEach(function(vector) {
+        var ciphertext = copyBuffer(vector.result);
+        var promise = importVectorKey(vector, [&quot;encrypt&quot;, &quot;decrypt&quot;])
+        .then(function(vector) {
+            promise_test(function(test) {
+                var operation = subtle.decrypt(vector.algorithm, vector.key, ciphertext)
+                .then(function(result) {
+                    assert_true(equalBuffers(result, vector.plaintext), &quot;Should return expected result&quot;);
+                }, function(err) {
+                    assert_unreached(&quot;decrypt error for test &quot; + vector.name + &quot;: &quot; + err.message);
+                });
+                ciphertext[0] = 255 - ciphertext[0];
+                return operation;
+            }, vector.name + &quot; decryption with altered ciphertext&quot;);
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importKey failed for &quot; + vector.name);
+            }, &quot;importKey step for decryption: &quot; + vector.name + &quot; with altered ciphertext&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Everything that succeeded should fail if no &quot;encrypt&quot; usage.
+    passingVectors.forEach(function(vector) {
+        // Don't want to overwrite key being used for success tests!
+        var badVector = Object.assign({}, vector);
+        badVector.key = null;
+
+        var promise = importVectorKey(badVector, [&quot;decrypt&quot;])
+        .then(function(vector) {
+            promise_test(function(test) {
+                return subtle.encrypt(vector.algorithm, vector.key, vector.plaintext)
+                .then(function(result) {
+                    assert_unreached(&quot;should have thrown exception for test &quot; + vector.name);
+                }, function(err) {
+                    assert_equals(err.name, &quot;InvalidAccessError&quot;, &quot;Should throw an InvalidAccessError instead of &quot; + err.message)
+                });
+            }, vector.name + &quot; without encrypt usage&quot;);
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importKey failed for &quot; + vector.name);
+            }, &quot;importKey step: &quot; + vector.name + &quot; without encrypt usage&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Encryption should fail if algorithm of key doesn't match algorithm of function call.
+    passingVectors.forEach(function(vector) {
+        var algorithm = Object.assign({}, vector.algorithm);
+        if (algorithm.name === &quot;AES-CBC&quot;) {
+            algorithm.name = &quot;AES-CTR&quot;;
+            algorithm.counter = new Uint8Array(16);
+            algorithm.length = 64;
+        } else {
+            algorithm.name = &quot;AES-CBC&quot;;
+            algorithm.iv = new Uint8Array(16); // Need syntactically valid parameter to get to error being checked.
+        }
+
+        var promise = importVectorKey(vector, [&quot;encrypt&quot;, &quot;decrypt&quot;])
+        .then(function(vector) {
+            promise_test(function(test) {
+                return subtle.encrypt(algorithm, vector.key, vector.plaintext)
+                .then(function(result) {
+                    assert_unreached(&quot;encrypt succeeded despite mismatch &quot; + vector.name + &quot;: &quot; + err.message);
+                }, function(err) {
+                    assert_equals(err.name, &quot;InvalidAccessError&quot;, &quot;Mismatch should cause InvalidAccessError instead of &quot; + err.message);
+                });
+            }, vector.name + &quot; with mismatched key and algorithm&quot;);
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importKey failed for &quot; + vector.name);
+            }, &quot;importKey step: &quot; + vector.name + &quot; with mismatched key and algorithm&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Everything that succeeded decrypting should fail if no &quot;decrypt&quot; usage.
+    passingVectors.forEach(function(vector) {
+        // Don't want to overwrite key being used for success tests!
+        var badVector = Object.assign({}, vector);
+        badVector.key = null;
+
+        var promise = importVectorKey(badVector, [&quot;encrypt&quot;])
+        .then(function(vector) {
+            promise_test(function(test) {
+                return subtle.decrypt(vector.algorithm, vector.key, vector.result)
+                .then(function(result) {
+                    assert_unreached(&quot;should have thrown exception for test &quot; + vector.name);
+                }, function(err) {
+                    assert_equals(err.name, &quot;InvalidAccessError&quot;, &quot;Should throw an InvalidAccessError instead of &quot; + err.message)
+                });
+            }, vector.name + &quot; without decrypt usage&quot;);
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importKey failed for &quot; + vector.name);
+            }, &quot;importKey step: &quot; + vector.name + &quot; without decrypt usage&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Check for OperationError due to data lengths.
+    failingVectors.forEach(function(vector) {
+        var promise = importVectorKey(vector, [&quot;encrypt&quot;, &quot;decrypt&quot;])
+        .then(function(vector) {
+            promise_test(function(test) {
+                return subtle.encrypt(vector.algorithm, vector.key, vector.plaintext)
+                .then(function(result) {
+                    assert_unreached(&quot;should have thrown exception for test &quot; + vector.name);
+                }, function(err) {
+                    assert_equals(err.name, &quot;OperationError&quot;, &quot;Should throw an OperationError instead of &quot; + err.message)
+                });
+            }, vector.name);
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importKey failed for &quot; + vector.name);
+            }, &quot;importKey step: &quot; + vector.name);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Check for OperationError due to data lengths for decryption, too.
+    failingVectors.forEach(function(vector) {
+        var promise = importVectorKey(vector, [&quot;encrypt&quot;, &quot;decrypt&quot;])
+        .then(function(vector) {
+            promise_test(function(test) {
+                return subtle.decrypt(vector.algorithm, vector.key, vector.result)
+                .then(function(result) {
+                    assert_unreached(&quot;should have thrown exception for test &quot; + vector.name);
+                }, function(err) {
+                    assert_equals(err.name, &quot;OperationError&quot;, &quot;Should throw an OperationError instead of &quot; + err.message)
+                });
+            }, vector.name + &quot; decryption&quot;);
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importKey failed for &quot; + vector.name);
+            }, &quot;importKey step: decryption &quot; + vector.name);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Check for decryption failing for algorithm-specific reasons (such as bad
+    // padding for AES-CBC).
+    decryptionFailingVectors.forEach(function(vector) {
+        var promise = importVectorKey(vector, [&quot;encrypt&quot;, &quot;decrypt&quot;])
+        .then(function(vector) {
+            promise_test(function(test) {
+                return subtle.decrypt(vector.algorithm, vector.key, vector.result)
+                .then(function(result) {
+                    assert_unreached(&quot;should have thrown exception for test &quot; + vector.name);
+                }, function(err) {
+                    assert_equals(err.name, &quot;OperationError&quot;, &quot;Should throw an OperationError instead of &quot; + err.message)
+                });
+            }, vector.name);
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importKey failed for &quot; + vector.name);
+            }, &quot;importKey step: decryption &quot; + vector.name);
+        });
+
+        all_promises.push(promise);
+    });
+
+    Promise.all(all_promises)
+    .then(function() {done();})
+    .catch(function() {done();})
+
+    // A test vector has all needed fields for encryption, EXCEPT that the
+    // key field may be null. This function replaces that null with the Correct
+    // CryptoKey object.
+    //
+    // Returns a Promise that yields an updated vector on success.
+    function importVectorKey(vector, usages) {
+        if (vector.key !== null) {
+            return new Promise(function(resolve, reject) {
+                resolve(vector);
+            });
+        } else {
+            return subtle.importKey(&quot;raw&quot;, vector.keyBuffer, {name: vector.algorithm.name}, false, usages)
+            .then(function(key) {
+                vector.key = key;
+                return vector;
+            });
+        }
+    }
+
+    // Returns a copy of the sourceBuffer it is sent.
+    function copyBuffer(sourceBuffer) {
+        var source = new Uint8Array(sourceBuffer);
+        var copy = new Uint8Array(sourceBuffer.byteLength)
+
+        for (var i=0; i&lt;source.byteLength; i++) {
+            copy[i] = source[i];
+        }
+
+        return copy;
+    }
+
+    function equalBuffers(a, b) {
+        if (a.byteLength !== b.byteLength) {
+            return false;
+        }
+
+        var aBytes = new Uint8Array(a);
+        var bBytes = new Uint8Array(b);
+
+        for (var i=0; i&lt;a.byteLength; i++) {
+            if (aBytes[i] !== bBytes[i]) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    return;
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaes_cbcworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_cbc.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_cbc.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_cbc.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;aes_cbc_vectors.js&quot;);
+importScripts(&quot;aes.js&quot;);
+
+run_test();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaes_cbc_vectorsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_cbc_vectors.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_cbc_vectors.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_cbc_vectors.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,261 @@
</span><ins>+
+// aes_cbc_vectors.js
+
+// The following function returns an array of test vectors
+// for the subtleCrypto encrypt method.
+//
+// Each test vector has the following fields:
+//     name - a unique name for this vector
+//     keyBuffer - an arrayBuffer with the key data in raw form
+//     key - a CryptoKey object for the keyBuffer. INITIALLY null! You must fill this in first to use it!
+//     algorithm - the value of the AlgorithmIdentifier parameter to provide to encrypt
+//     plaintext - the text to encrypt
+//     result - the expected result (usually just ciphertext, sometimes with added authentication)
+function getTestVectors() {
+    // Before we can really start, we need to fill a bunch of buffers with data
+    var plaintext = new Uint8Array([84, 104, 105, 115, 32, 115,
+        112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110,
+        32, 100, 101, 115, 99, 114, 105, 98, 101, 115, 32, 97, 32,
+        74, 97, 118, 97, 83, 99, 114, 105, 112, 116, 32, 65, 80,
+        73, 32, 102, 111, 114, 32, 112, 101, 114, 102, 111, 114,
+        109, 105, 110, 103, 32, 98, 97, 115, 105, 99, 32, 99, 114,
+        121, 112, 116, 111, 103, 114, 97, 112, 104, 105, 99, 32,
+        111, 112, 101, 114, 97, 116, 105, 111, 110, 115, 32, 105,
+        110, 32, 119, 101, 98, 32, 97, 112, 112, 108, 105, 99, 97,
+        116, 105, 111, 110, 115, 44, 32, 115, 117, 99, 104, 32, 97,
+        115, 32, 104, 97, 115, 104, 105, 110, 103, 44, 32, 115,
+        105, 103, 110, 97, 116, 117, 114, 101, 32, 103, 101, 110,
+        101, 114, 97, 116, 105, 111, 110, 32, 97, 110, 100, 32,
+        118, 101, 114, 105, 102, 105, 99, 97, 116, 105, 111, 110,
+        44, 32, 97, 110, 100, 32, 101, 110, 99, 114, 121, 112,
+        116, 105, 111, 110, 32, 97, 110, 100, 32, 100, 101, 99,
+        114, 121, 112, 116, 105, 111, 110, 46, 32, 65, 100, 100,
+        105, 116, 105, 111, 110, 97, 108, 108, 121, 44, 32, 105,
+        116, 32, 100, 101, 115, 99, 114, 105, 98, 101, 115, 32, 97,
+        110, 32, 65, 80, 73, 32, 102, 111, 114, 32, 97, 112, 112,
+        108, 105, 99, 97, 116, 105, 111, 110, 115, 32, 116, 111,
+        32, 103, 101, 110, 101, 114, 97, 116, 101, 32, 97, 110,
+        100, 47, 111, 114, 32, 109, 97, 110, 97, 103, 101, 32, 116,
+        104, 101, 32, 107, 101, 121, 105, 110, 103, 32, 109, 97,
+        116, 101, 114, 105, 97, 108, 32, 110, 101, 99, 101, 115,
+        115, 97, 114, 121, 32, 116, 111, 32, 112, 101, 114, 102,
+        111, 114, 109, 32, 116, 104, 101, 115, 101, 32, 111, 112,
+        101, 114, 97, 116, 105, 111, 110, 115, 46, 32, 85, 115,
+        101, 115, 32, 102, 111, 114, 32, 116, 104, 105, 115, 32,
+        65, 80, 73, 32, 114, 97, 110, 103, 101, 32, 102, 114, 111,
+        109, 32, 117, 115, 101, 114, 32, 111, 114, 32, 115, 101,
+        114, 118, 105, 99, 101, 32, 97, 117, 116, 104, 101, 110,
+        116, 105, 99, 97, 116, 105, 111, 110, 44, 32, 100, 111,
+        99, 117, 109, 101, 110, 116, 32, 111, 114, 32, 99, 111,
+        100, 101, 32, 115, 105, 103, 110, 105, 110, 103, 44, 32,
+        97, 110, 100, 32, 116, 104, 101, 32, 99, 111, 110, 102,
+        105, 100, 101, 110, 116, 105, 97, 108, 105, 116, 121, 32,
+        97, 110, 100, 32, 105, 110, 116, 101, 103, 114, 105, 116,
+        121, 32, 111, 102, 32, 99, 111, 109, 109, 117, 110, 105,
+        99, 97, 116, 105, 111, 110, 115, 46]);
+
+    // We want some random key bytes of various sizes.
+    // These were randomly generated from a script.
+    var keyBytes = {
+        128: new Uint8Array([222, 192, 212, 252, 191, 60, 71,
+            65, 200, 146, 218, 189, 28, 212, 192, 78]),
+        192: new Uint8Array([208, 238, 131, 65, 63, 68, 196, 63, 186, 208,
+            61, 207, 166, 18, 99, 152, 29, 109, 221, 95, 240, 30, 28, 246]),
+        256: new Uint8Array([103, 105, 56, 35, 251, 29, 88, 7, 63, 145, 236,
+            233, 204, 58, 249, 16, 229, 83, 38, 22, 164, 210, 123, 19, 235, 123, 116,
+            216, 0, 11, 191, 48])
+    }
+
+    // AES-CBC needs a 16 byte (128 bit) IV.
+    var iv = new Uint8Array([85, 170, 248, 155, 168, 148, 19, 213, 78, 167, 39,
+        167, 108, 39, 162, 132]);
+
+
+    // Results. These were created using the Python cryptography module.
+
+    // AES-CBC produces ciphertext
+    var ciphertext = {
+        128: new Uint8Array([35, 127, 3, 254, 231, 8, 114, 231, 143, 174, 193,
+            72, 221, 189, 1, 189, 119, 203, 150, 227, 56, 30, 244, 236, 226, 175,
+            234, 23, 167, 175, 211, 124, 203, 228, 97, 223, 156, 77, 88, 174,
+            166, 187, 186, 225, 176, 92, 250, 177, 225, 41, 135, 124, 215, 86,
+            198, 134, 124, 49, 154, 60, 224, 93, 165, 12, 190, 245, 241, 164,
+            247, 220, 227, 69, 242, 105, 208, 108, 222, 193, 223, 0, 226, 217,
+            39, 160, 78, 147, 191, 38, 153, 232, 206, 221, 254, 25, 185, 249, 7,
+            181, 215, 104, 98, 163, 194, 161, 103, 161, 237, 167, 10, 242, 37,
+            80, 2, 255, 173, 96, 20, 106, 170, 110, 80, 38, 136, 127, 16, 85,
+            244, 78, 172, 56, 106, 3, 115, 130, 58, 186, 129, 236, 255, 251,
+            178, 112, 24, 159, 82, 252, 1, 178, 132, 92, 40, 125, 18, 135, 116,
+            64, 178, 31, 174, 87, 114, 114, 218, 78, 111, 0, 239, 252, 79, 63,
+            119, 58, 118, 78, 55, 249, 36, 130, 225, 205, 13, 76, 97, 214, 250,
+            174, 232, 67, 103, 211, 178, 206, 32, 129, 188, 243, 100, 71, 63,
+            154, 159, 200, 125, 34, 138, 39, 73, 130, 75, 97, 203, 204, 111,
+            244, 75, 186, 181, 43, 207, 175, 146, 98, 207, 27, 23, 90, 144, 161,
+            19, 235, 199, 93, 98, 238, 72, 134, 157, 220, 207, 66, 167, 236, 94,
+            57, 0, 3, 202, 250, 55, 26, 163, 20, 133, 191, 67, 20, 63, 150, 203,
+            87, 216, 44, 57, 188, 236, 64, 80, 111, 68, 26, 12, 10, 163, 82, 3,
+            191, 19, 71, 186, 196, 177, 84, 244, 7, 78, 41, 172, 203, 27, 225,
+            231, 108, 206, 141, 221, 253, 204, 220, 134, 20, 130, 54, 113, 81,
+            127, 197, 27, 101, 121, 159, 223, 193, 115, 190, 12, 153, 174, 231,
+            196, 92, 142, 156, 61, 189, 3, 18, 153, 206, 190, 58, 255, 154, 115,
+            66, 23, 107, 94, 220, 156, 220, 228, 241, 66, 6, 184, 44, 238, 249,
+            51, 240, 109, 142, 208, 189, 11, 117, 70, 170, 217, 170, 216, 66,
+            231, 18, 175, 121, 221, 16, 29, 139, 55, 103, 91, 239, 111, 29, 108,
+            94, 179, 138, 134, 73, 130, 29, 69, 182, 192, 249, 150, 165, 79, 47,
+            91, 203, 226, 63, 87, 52, 60, 172, 191, 190, 179, 171, 155, 205, 88,
+            172, 111, 59, 40, 198, 250, 209, 148, 177, 115, 200, 40, 43, 165,
+            167, 67, 116, 64, 159, 240, 81, 253, 235, 137, 132, 49, 223, 214,
+            172, 53, 7, 47, 184, 223, 120, 59, 51, 33, 124, 147, 221, 27, 60,
+            16, 254, 24, 115, 115, 214, 75, 73, 97, 136, 214, 209, 177, 106, 71,
+            254, 211, 94, 57, 104, 170, 168, 35, 37, 93, 203, 199, 38, 28, 84]),
+
+        192: new Uint8Array([131, 160, 2, 14, 214, 229, 41, 230, 47, 99, 83,
+            193, 62, 133, 172, 195, 127, 61, 247, 80, 71, 167, 37, 184, 230,
+            207, 168, 163, 139, 145, 18, 225, 205, 134, 87, 138, 80, 247, 166,
+            176, 177, 18, 71, 88, 193, 56, 45, 96, 36, 78, 134, 212, 9, 250, 217,
+            24, 207, 215, 111, 72, 114, 203, 27, 188, 122, 34, 212, 191, 88, 72,
+            22, 194, 224, 217, 236, 201, 191, 236, 214, 231, 90, 244, 100, 153,
+            211, 35, 182, 205, 128, 84, 79, 161, 53, 166, 236, 196, 181, 163,
+            140, 255, 80, 59, 49, 71, 170, 118, 14, 100, 40, 105, 184, 187, 41,
+            198, 180, 135, 69, 211, 69, 74, 132, 243, 76, 144, 102, 90, 155,
+            243, 125, 140, 190, 20, 9, 232, 188, 198, 221, 148, 13, 53, 155, 91,
+            34, 235, 24, 121, 109, 48, 242, 142, 8, 160, 223, 242, 163, 98, 198,
+            131, 164, 160, 79, 27, 210, 216, 192, 228, 27, 4, 254, 222, 195, 14,
+            77, 72, 225, 151, 114, 38, 130, 143, 6, 17, 138, 229, 193, 114, 169,
+            2, 108, 225, 35, 37, 232, 200, 167, 147, 251, 210, 138, 243, 44, 48,
+            12, 84, 192, 169, 108, 0, 113, 77, 160, 218, 96, 4, 138, 171, 207,
+            20, 189, 146, 255, 206, 68, 160, 87, 127, 3, 83, 182, 203, 116, 59,
+            24, 186, 79, 68, 220, 161, 85, 227, 29, 118, 134, 128, 187, 29, 128,
+            121, 120, 64, 211, 30, 255, 52, 187, 185, 216, 151, 30, 10, 165,
+            203, 148, 39, 224, 14, 173, 199, 57, 0, 194, 79, 115, 206, 159, 43,
+            13, 36, 169, 97, 144, 32, 0, 207, 230, 16, 162, 156, 166, 34, 150,
+            12, 93, 141, 164, 181, 194, 10, 47, 139, 82, 75, 42, 23, 224, 3, 92,
+            151, 154, 249, 170, 57, 141, 113, 32, 52, 158, 218, 49, 242, 134,
+            65, 69, 203, 71, 19, 133, 125, 117, 1, 207, 210, 224, 130, 45, 37,
+            42, 181, 139, 34, 85, 8, 67, 165, 249, 180, 89, 3, 60, 152, 1, 231,
+            49, 1, 124, 243, 81, 44, 72, 232, 239, 129, 75, 108, 4, 169, 132,
+            73, 183, 21, 29, 46, 94, 138, 83, 190, 131, 146, 65, 104, 107, 251,
+            218, 95, 227, 94, 145, 70, 0, 2, 252, 59, 188, 58, 150, 203, 148,
+            100, 219, 36, 182, 81, 237, 138, 160, 83, 151, 119, 11, 216, 122,
+            134, 189, 246, 251, 192, 41, 158, 125, 247, 190, 32, 173, 104, 9,
+            58, 223, 97, 212, 48, 62, 3, 112, 21, 74, 206, 87, 182, 110, 197,
+            67, 68, 155, 189, 223, 136, 2, 239, 137, 151, 138, 252, 162, 141,
+            255, 209, 25, 4, 146, 24, 221, 43, 148, 120, 26, 228, 208, 200, 198,
+            192, 4, 96, 70, 227, 237, 104, 17, 67, 9, 211]),
+
+        256: new Uint8Array([41, 213, 121, 140, 181, 227, 200, 97, 100, 133, 58,
+            227, 106, 115, 25, 63, 77, 51, 26, 57, 238, 140, 99, 63, 71, 211,
+            128, 84, 115, 26, 236, 52, 103, 81, 145, 14, 101, 161, 181, 58, 135,
+            193, 56, 167, 214, 220, 5, 52, 85, 222, 183, 27, 101, 134, 86, 155,
+            64, 148, 124, 212, 219, 251, 65, 42, 32, 44, 128, 2, 50, 128, 221,
+            22, 238, 56, 189, 83, 28, 122, 121, 157, 215, 135, 151, 128, 233,
+            193, 65, 190, 86, 148, 191, 140, 196, 120, 8, 172, 100, 166, 254,
+            41, 245, 75, 56, 6, 166, 244, 178, 111, 234, 23, 4, 107, 6, 22, 132,
+            187, 230, 17, 71, 172, 113, 238, 73, 4, 180, 90, 103, 77, 37, 51,
+            118, 112, 129, 238, 199, 7, 222, 122, 173, 30, 232, 178, 233, 234,
+            144, 98, 14, 234, 112, 77, 68, 62, 62, 159, 230, 101, 98, 43, 2,
+            204, 69, 156, 86, 104, 128, 34, 128, 7, 173, 90, 120, 33, 104, 59,
+            45, 251, 93, 51, 240, 232, 60, 94, 189, 134, 90, 20, 184, 122, 29,
+            225, 85, 213, 38, 116, 159, 80, 69, 106, 168, 236, 201, 69, 140, 98,
+            240, 45, 160, 133, 225, 106, 45, 245, 212, 160, 176, 128, 27, 114,
+            153, 182, 144, 145, 214, 72, 196, 138, 183, 87, 61, 245, 150, 56,
+            82, 158, 224, 50, 114, 125, 122, 172, 161, 129, 234, 70, 63, 245,
+            136, 30, 136, 9, 128, 220, 229, 157, 222, 195, 149, 189, 70, 8, 71,
+            40, 195, 93, 27, 7, 234, 164, 175, 102, 201, 149, 115, 248, 179,
+            125, 66, 122, 194, 26, 61, 218, 198, 181, 152, 140, 199, 48, 148,
+            31, 14, 241, 197, 3, 70, 128, 239, 32, 86, 15, 215, 86, 245, 190,
+            95, 141, 41, 111, 0, 232, 28, 152, 67, 87, 197, 255, 118, 13, 251,
+            71, 84, 22, 231, 134, 188, 175, 115, 138, 37, 199, 5, 238, 199, 2,
+            99, 203, 75, 62, 231, 21, 150, 239, 94, 201, 185, 219, 58, 210, 228,
+            151, 131, 76, 148, 104, 60, 74, 82, 6, 168, 49, 251, 182, 3, 232,
+            173, 210, 201, 19, 101, 166, 7, 94, 11, 194, 211, 146, 229, 75, 241,
+            15, 50, 187, 36, 175, 78, 227, 98, 224, 3, 95, 209, 93, 126, 112,
+            178, 29, 18, 108, 241, 232, 79, 210, 41, 2, 238, 208, 190, 171, 134,
+            147, 188, 191, 229, 122, 32, 209, 166, 118, 129, 223, 130, 214, 195,
+            89, 67, 94, 218, 155, 185, 0, 144, 255, 132, 213, 25, 59, 83, 242,
+            57, 69, 148, 109, 133, 61, 163, 30, 214, 254, 54, 169, 3, 217, 77,
+            66, 123, 193, 204, 199, 109, 123, 49, 186, 223, 229, 8, 230, 164,
+            171, 196, 145, 225, 10, 111, 248, 111, 164, 216, 54, 225, 253])
+    };
+
+    // Replace the last block of each ciphertext with bad padding below for decryption errors
+    var badPadding = {
+        128: {
+            &quot;zeroPadChar&quot;: new Uint8Array([238, 27, 248, 169, 218, 138, 164, 86, 207, 102, 36, 223, 6, 166, 77, 14]),
+            &quot;bigPadChar&quot;: new Uint8Array([91, 67, 119, 104, 252, 238, 175, 144, 17, 75, 12, 163, 212, 52, 46, 51]),
+            &quot;inconsistentPadChars&quot;: new Uint8Array([135, 101, 112, 208, 3, 106, 226, 20, 25, 219, 79, 94, 58, 212, 242, 192])
+        },
+        192: {
+            &quot;zeroPadChar&quot;: new Uint8Array([22, 158, 50, 15, 168, 47, 19, 194, 182, 133, 184, 65, 36, 43, 177, 254]),
+            &quot;bigPadChar&quot;: new Uint8Array([207, 110, 28, 160, 165, 213, 48, 213, 163, 242, 15, 78, 96, 117, 106, 87]),
+            &quot;inconsistentPadChars&quot;: new Uint8Array([143, 227, 12, 112, 216, 207, 136, 167, 78, 137, 93, 30, 50, 75, 102, 101])
+        },
+        256: {
+            &quot;zeroPadChar&quot;: new Uint8Array([1, 253, 141, 214, 30, 193, 254, 68, 140, 200, 157, 110, 200, 89, 177, 129]),
+            &quot;bigPadChar&quot;: new Uint8Array([88, 7, 110, 221, 74, 34, 97, 109, 99, 25, 189, 222, 94, 90, 27, 60]),
+            &quot;inconsistentPadChars&quot;: new Uint8Array([152, 54, 60, 148, 59, 136, 193, 21, 77, 140, 170, 67, 120, 74, 106, 62])
+        }
+    };
+
+    var keyLengths = [128, 192, 256];
+
+    // All the scenarios that should succeed, if the key has &quot;encrypt&quot; usage
+    var passing = [];
+    keyLengths.forEach(function(keyLength) {
+        passing.push({
+            name: &quot;AES-CBC &quot; + keyLength.toString() + &quot;-bit key&quot;,
+            keyBuffer: keyBytes[keyLength],
+            key: null,
+            algorithm: {name: &quot;AES-CBC&quot;, iv: iv},
+            plaintext: plaintext,
+            result: ciphertext[keyLength]
+        });
+    });
+
+    // Scenarios that should fail because of a bad iv length, causing an OperationError
+    var failing = [];
+    keyLengths.forEach(function(keyLength) {
+        var shortIv = iv.slice(0, 8);
+        failing.push({
+            name: &quot;AES-CBC &quot; + keyLength.toString() + &quot;-bit key, 64-bit IV&quot;,
+            keyBuffer: keyBytes[keyLength],
+            key: null,
+            algorithm: {name: &quot;AES-CBC&quot;, iv: shortIv},
+            plaintext: plaintext,
+            result: ciphertext[keyLength]
+        });
+
+        var longIv = new Uint8Array(24);
+        longIv.set(iv, 0);
+        longIv.set(iv.slice(0, 8), 16);
+        failing.push({
+            name: &quot;AES-CBC &quot; + keyLength.toString() + &quot;-bit key, 192-bit IV&quot;,
+            keyBuffer: keyBytes[keyLength],
+            key: null,
+            algorithm: {name: &quot;AES-CBC&quot;, iv: longIv},
+            plaintext: plaintext,
+            result: ciphertext[keyLength]
+        });
+    });
+
+    // Scenarios that should fail decryption because of bad padding
+    var decryptionFailing = [];
+    keyLengths.forEach(function(keyLength) {
+        [&quot;zeroPadChar&quot;, &quot;bigPadChar&quot;, &quot;inconsistentPadChars&quot;].forEach(function(paddingProblem) {
+            var badCiphertext = new Uint8Array(ciphertext[keyLength].byteLength);
+            badCiphertext.set(ciphertext[keyLength].slice(0, ciphertext[keyLength].byteLength - 16));
+            badCiphertext.set(badPadding[keyLength][paddingProblem]);
+
+            decryptionFailing.push({
+                name: &quot;AES-CBC &quot; + keyLength.toString() + &quot;-bit key, &quot; + paddingProblem,
+                keyBuffer: keyBytes[keyLength],
+                key: null,
+                algorithm: {name: &quot;AES-CBC&quot;, iv: iv},
+                plaintext: plaintext,
+                result: badCiphertext
+            });
+        });
+    });
+
+    return {passing: passing, failing: failing, decryptionFailing: decryptionFailing};
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaes_ctrworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_ctr.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_ctr.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_ctr.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;aes_ctr_vectors.js&quot;);
+importScripts(&quot;aes.js&quot;);
+
+run_test();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaes_ctr_vectorsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_ctr_vectors.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_ctr_vectors.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_ctr_vectors.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,123 @@
</span><ins>+
+// aes_ctr_vectors.js
+
+// The following function returns an array of test vectors
+// for the subtleCrypto encrypt method.
+//
+// Each test vector has the following fields:
+//     name - a unique name for this vector
+//     keyBuffer - an arrayBuffer with the key data in raw form
+//     key - a CryptoKey object for the keyBuffer. INITIALLY null! You must fill this in first to use it!
+//     algorithm - the value of the AlgorithmIdentifier parameter to provide to encrypt
+//     plaintext - the text to encrypt
+//     result - the expected result (usually just ciphertext, sometimes with added authentication)
+function getTestVectors() {
+    // Before we can really start, we need to fill a bunch of buffers with data
+    var plaintext = new Uint8Array([84, 104, 105, 115, 32, 115,
+        112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110,
+        32, 100, 101, 115, 99, 114, 105, 98, 101, 115, 32, 97, 32,
+        74, 97, 118, 97, 83, 99, 114, 105, 112, 116, 32, 65, 80,
+        73, 32, 102, 111, 114, 32, 112, 101, 114, 102, 111, 114,
+        109, 105, 110, 103, 32, 98, 97, 115, 105, 99, 32, 99, 114,
+        121, 112, 116, 111, 103, 114, 97, 112, 104, 105, 99, 32,
+        111, 112, 101, 114, 97, 116, 105, 111, 110, 115, 32, 105,
+        110, 32, 119, 101, 98, 32, 97, 112, 112, 108, 105, 99, 97,
+        116, 105, 111, 110, 115, 44, 32, 115, 117, 99, 104, 32, 97,
+        115, 32, 104, 97, 115, 104, 105, 110, 103, 44, 32, 115,
+        105, 103, 110, 97, 116, 117, 114, 101, 32, 103, 101, 110,
+        101, 114, 97, 116, 105, 111, 110, 32, 97, 110, 100, 32,
+        118, 101, 114, 105, 102, 105, 99, 97, 116, 105, 111, 110,
+        44, 32, 97, 110, 100, 32, 101, 110, 99, 114, 121, 112,
+        116, 105, 111, 110, 32, 97, 110, 100, 32, 100, 101, 99,
+        114, 121, 112, 116, 105, 111, 110, 46, 32, 65, 100, 100,
+        105, 116, 105, 111, 110, 97, 108, 108, 121, 44, 32, 105,
+        116, 32, 100, 101, 115, 99, 114, 105, 98, 101, 115, 32, 97,
+        110, 32, 65, 80, 73, 32, 102, 111, 114, 32, 97, 112, 112,
+        108, 105, 99, 97, 116, 105, 111, 110, 115, 32, 116, 111,
+        32, 103, 101, 110, 101, 114, 97, 116, 101, 32, 97, 110,
+        100, 47, 111, 114, 32, 109, 97, 110, 97, 103, 101, 32, 116,
+        104, 101, 32, 107, 101, 121, 105, 110, 103, 32, 109, 97,
+        116, 101, 114, 105, 97, 108, 32, 110, 101, 99, 101, 115,
+        115, 97, 114, 121, 32, 116, 111, 32, 112, 101, 114, 102,
+        111, 114, 109, 32, 116, 104, 101, 115, 101, 32, 111, 112,
+        101, 114, 97, 116, 105, 111, 110, 115, 46, 32, 85, 115,
+        101, 115, 32, 102, 111, 114, 32, 116, 104, 105, 115, 32,
+        65, 80, 73, 32, 114, 97, 110, 103, 101, 32, 102, 114, 111,
+        109, 32, 117, 115, 101, 114, 32, 111, 114, 32, 115, 101,
+        114, 118, 105, 99, 101, 32, 97, 117, 116, 104, 101, 110,
+        116, 105, 99, 97, 116, 105, 111, 110, 44, 32, 100, 111,
+        99, 117, 109, 101, 110, 116, 32, 111, 114, 32, 99, 111,
+        100, 101, 32, 115, 105, 103, 110, 105, 110, 103, 44, 32,
+        97, 110, 100, 32, 116, 104, 101, 32, 99, 111, 110, 102,
+        105, 100, 101, 110, 116, 105, 97, 108, 105, 116, 121, 32,
+        97, 110, 100, 32, 105, 110, 116, 101, 103, 114, 105, 116,
+        121, 32, 111, 102, 32, 99, 111, 109, 109, 117, 110, 105,
+        99, 97, 116, 105, 111, 110, 115, 46]);
+
+    // We want some random key bytes of various sizes.
+    // These were randomly generated from a script.
+    var keyBytes = {
+        128: new Uint8Array([222, 192, 212, 252, 191, 60, 71,
+            65, 200, 146, 218, 189, 28, 212, 192, 78]),
+        192: new Uint8Array([208, 238, 131, 65, 63, 68, 196, 63, 186, 208,
+            61, 207, 166, 18, 99, 152, 29, 109, 221, 95, 240, 30, 28, 246]),
+        256: new Uint8Array([103, 105, 56, 35, 251, 29, 88, 7, 63, 145, 236,
+            233, 204, 58, 249, 16, 229, 83, 38, 22, 164, 210, 123, 19, 235, 123, 116,
+            216, 0, 11, 191, 48])
+    }
+
+    // AES-CTR needs a 16 byte (128 bit) counter.
+    var counter = new Uint8Array([85, 170, 248, 155, 168, 148, 19, 213, 78, 167, 39,
+        167, 108, 39, 162, 132]);
+
+
+    // Results. These were created using the Python cryptography module.
+
+    // AES-CTR produces ciphertext
+    var ciphertext = {
+        128: new Uint8Array([233, 17, 117, 253, 164, 245, 234, 87, 197, 43, 13, 0, 11, 190, 152, 175, 104, 192, 165, 144, 88, 174, 237, 138, 181, 183, 6, 53, 3, 161, 206, 71, 13, 121, 218, 209, 116, 249, 10, 170, 250, 165, 68, 157, 132, 141, 200, 178, 197, 87, 209, 231, 250, 75, 154, 65, 162, 251, 30, 159, 234, 20, 20, 181, 147, 218, 180, 12, 4, 241, 75, 79, 129, 64, 15, 228, 60, 147, 153, 1, 129, 176, 150, 161, 85, 97, 22, 154, 234, 23, 127, 16, 4, 22, 226, 11, 104, 16, 176, 14, 225, 176, 79, 239, 103, 243, 190, 222, 40, 186, 244, 212, 29, 57, 125, 175, 21, 17, 233, 2, 13, 119, 102, 233, 230, 4, 16, 222, 56, 225, 67, 45, 191, 250, 15, 153, 45, 193, 240, 212, 117, 101, 68, 232, 199, 101, 175, 125, 247, 6, 249, 14, 0, 157, 185, 56, 76, 51, 228, 77, 234, 84, 60, 42, 119, 187, 213, 32, 34, 222, 65, 231, 215, 26, 73, 141, 231, 254, 185, 118, 14, 180, 126, 80, 51, 102, 200, 141, 204, 45, 26, 56, 119, 136, 222, 45, 143, 120, 231, 44, 43, 221, 136, 21, 188, 138, 84, 232, 208, 238, 
 226, 117, 104, 60, 165, 4, 18, 144, 240, 49, 173, 90, 68, 84, 239, 161, 124, 196, 144, 119, 24, 243, 239, 75, 117, 254, 219, 209, 53, 131, 37, 79, 68, 26, 21, 168, 163, 50, 59, 18, 244, 11, 143, 190, 188, 129, 108, 249, 180, 104, 216, 215, 165, 160, 251, 84, 132, 152, 195, 154, 110, 216, 70, 21, 248, 148, 146, 152, 56, 174, 248, 227, 1, 102, 15, 118, 182, 50, 73, 63, 35, 112, 159, 237, 253, 94, 16, 127, 120, 38, 127, 51, 27, 96, 163, 140, 20, 111, 151, 16, 72, 74, 74, 205, 239, 241, 16, 179, 183, 116, 95, 248, 58, 168, 203, 93, 233, 225, 91, 17, 226, 10, 120, 85, 114, 4, 31, 40, 82, 161, 152, 17, 86, 237, 207, 7, 228, 110, 182, 65, 68, 68, 156, 206, 116, 185, 204, 148, 22, 58, 111, 218, 138, 225, 146, 25, 114, 29, 96, 183, 87, 181, 181, 236, 113, 141, 171, 213, 9, 84, 182, 230, 163, 147, 246, 86, 246, 52, 111, 64, 34, 157, 12, 80, 224, 28, 21, 112, 31, 42, 79, 229, 210, 90, 23, 78, 223, 155, 144, 238, 12, 14, 191, 158, 6, 181, 254, 0, 85, 134, 56, 161, 234, 55, 129, 64, 59, 
 12, 146, 6, 217, 232, 20, 214, 167, 159, 183, 165, 96, 96, 225, 199, 23, 106, 243, 108, 106, 26, 214, 53, 152, 26, 155, 253, 128, 7, 216, 207, 109, 159, 147, 240, 232, 226, 43, 147, 169, 162, 204, 215, 9, 10, 177, 223, 99, 206, 163, 240, 64]),
+
+        192: new Uint8Array([98, 123, 235, 65, 14, 86, 80, 133, 88, 104, 244, 125, 165, 185, 163, 4, 3, 230, 62, 58, 113, 222, 46, 210, 17, 155, 95, 19, 125, 125, 70, 234, 105, 54, 23, 246, 114, 9, 237, 191, 9, 194, 34, 254, 156, 11, 50, 216, 80, 178, 185, 221, 132, 154, 27, 85, 82, 49, 241, 123, 23, 106, 119, 134, 203, 0, 151, 66, 149, 218, 124, 247, 227, 233, 236, 184, 88, 234, 174, 250, 83, 168, 33, 15, 122, 26, 96, 213, 210, 4, 52, 92, 20, 12, 64, 12, 209, 197, 69, 100, 15, 56, 60, 63, 241, 52, 18, 189, 93, 146, 47, 60, 33, 200, 218, 243, 43, 169, 17, 108, 19, 199, 174, 33, 107, 186, 57, 95, 167, 138, 180, 187, 53, 113, 208, 148, 190, 48, 167, 53, 209, 52, 153, 184, 231, 63, 168, 54, 179, 238, 93, 130, 125, 3, 149, 119, 60, 25, 142, 150, 183, 193, 29, 18, 3, 219, 235, 219, 26, 116, 217, 196, 108, 6, 96, 103, 212, 48, 227, 91, 124, 77, 181, 169, 18, 111, 123, 83, 26, 169, 230, 88, 103, 185, 153, 93, 143, 152, 142, 231, 41, 226, 226, 156, 179, 206, 212, 67, 18, 193, 187, 5
 3, 252, 214, 15, 228, 246, 131, 170, 101, 134, 212, 100, 170, 146, 47, 57, 125, 50, 230, 51, 246, 74, 175, 129, 196, 178, 206, 176, 52, 153, 39, 77, 24, 186, 99, 137, 83, 105, 111, 168, 35, 176, 24, 29, 170, 223, 74, 160, 138, 247, 12, 102, 233, 136, 59, 172, 228, 242, 84, 13, 34, 155, 80, 80, 87, 180, 143, 129, 61, 213, 54, 41, 8, 183, 102, 126, 179, 127, 77, 55, 176, 152, 41, 131, 85, 86, 225, 87, 216, 139, 226, 196, 195, 210, 34, 33, 161, 249, 153, 205, 197, 128, 41, 28, 121, 6, 159, 25, 211, 168, 137, 26, 217, 249, 113, 81, 141, 18, 1, 250, 228, 68, 238, 74, 54, 99, 167, 236, 176, 199, 148, 161, 143, 156, 51, 189, 204, 59, 240, 151, 170, 85, 63, 23, 38, 152, 199, 12, 81, 217, 244, 178, 231, 249, 159, 224, 107, 214, 58, 127, 116, 143, 219, 155, 80, 55, 213, 171, 80, 127, 235, 20, 247, 12, 104, 228, 147, 202, 124, 143, 110, 223, 76, 221, 154, 175, 143, 185, 237, 222, 189, 104, 218, 72, 244, 55, 253, 138, 183, 92, 231, 68, 176, 239, 171, 100, 10, 63, 61, 194, 228, 15, 133, 
 216, 45, 60, 135, 203, 142, 127, 153, 172, 223, 213, 230, 220, 189, 223, 234, 156, 134, 238, 220, 251, 104, 209, 117, 175, 47, 46, 148, 6, 61, 216, 215, 39, 30, 116, 212, 45, 112, 202, 227, 198, 98, 253, 97, 177, 120, 74, 238, 68, 99, 240, 96, 43, 88, 166]),
+
+        256: new Uint8Array([55, 82, 154, 67, 47, 80, 186, 78, 83, 56, 95, 130, 102, 236, 61, 236, 204, 236, 234, 222, 122, 226, 147, 149, 233, 41, 16, 118, 201, 91, 185, 162, 79, 71, 146, 252, 221, 110, 165, 137, 75, 129, 94, 219, 93, 94, 64, 34, 250, 190, 5, 90, 6, 177, 167, 224, 25, 121, 85, 91, 87, 152, 56, 100, 191, 35, 1, 156, 177, 179, 127, 253, 173, 176, 87, 247, 40, 207, 178, 175, 10, 51, 209, 70, 52, 76, 251, 160, 172, 203, 77, 191, 97, 58, 123, 238, 82, 60, 166, 214, 134, 14, 71, 74, 156, 15, 77, 6, 141, 76, 10, 205, 148, 204, 85, 203, 242, 30, 66, 133, 202, 21, 17, 108, 151, 2, 15, 44, 51, 180, 88, 80, 8, 248, 254, 151, 201, 226, 156, 6, 39, 197, 212, 124, 72, 217, 75, 232, 139, 155, 22, 199, 242, 223, 116, 10, 141, 42, 7, 85, 99, 5, 184, 43, 145, 159, 122, 135, 202, 46, 209, 157, 178, 114, 98, 194, 119, 194, 19, 242, 167, 236, 162, 94, 90, 106, 219, 234, 67, 11, 162, 225, 6, 17, 152, 23, 16, 84, 40, 90, 255, 158, 8, 105, 198, 56, 220, 213, 36, 203, 241, 242, 85,
  218, 103, 90, 202, 214, 215, 134, 121, 169, 149, 139, 122, 143, 155, 178, 29, 217, 197, 128, 173, 25, 111, 154, 14, 76, 106, 101, 0, 215, 187, 33, 223, 116, 205, 89, 52, 206, 60, 77, 141, 31, 57, 211, 74, 42, 219, 88, 210, 36, 196, 128, 151, 136, 124, 222, 157, 59, 225, 70, 163, 234, 59, 173, 228, 198, 134, 76, 249, 228, 69, 181, 196, 194, 179, 239, 78, 43, 143, 94, 234, 10, 177, 192, 185, 171, 231, 164, 254, 91, 44, 11, 29, 148, 223, 107, 18, 149, 61, 50, 115, 38, 14, 128, 189, 9, 77, 236, 151, 163, 23, 122, 156, 236, 11, 80, 66, 190, 24, 4, 4, 12, 148, 57, 64, 59, 143, 114, 247, 66, 111, 167, 86, 173, 98, 102, 207, 44, 134, 89, 231, 64, 50, 157, 208, 210, 79, 159, 133, 73, 118, 98, 202, 215, 57, 247, 29, 97, 116, 1, 28, 119, 248, 243, 31, 180, 66, 38, 40, 141, 251, 134, 129, 126, 241, 113, 22, 50, 28, 113, 187, 158, 217, 125, 182, 233, 144, 246, 32, 88, 88, 15, 0, 102, 131, 67, 31, 34, 150, 98, 241, 213, 227, 205, 175, 254, 3, 53, 70, 124, 167, 38, 53, 104, 140, 147, 158,
  200, 179, 45, 100, 101, 246, 81, 166, 53, 247, 60, 10, 78, 127, 10, 173, 176, 232, 31, 91, 203, 250, 236, 38, 113, 172, 151, 253, 194, 253, 50, 242, 76, 148, 23, 117, 195, 122, 104, 16, 212, 177, 113, 188, 138, 186, 144, 168, 102, 3])
+    };
+
+    var keyLengths = [128, 192, 256];
+
+    // All the scenarios that should succeed, if the key has &quot;encrypt&quot; usage
+    var passing = [];
+    keyLengths.forEach(function(keyLength) {
+        passing.push({
+            name: &quot;AES-CTR &quot; + keyLength.toString() + &quot;-bit key&quot;,
+            keyBuffer: keyBytes[keyLength],
+            key: null,
+            algorithm: {name: &quot;AES-CTR&quot;, counter: counter, length: 64},
+            plaintext: plaintext,
+            result: ciphertext[keyLength]
+        });
+    });
+
+    // Scenarios that should fail because of a bad length parameter, causing an OperationError
+    var failing = [];
+    keyLengths.forEach(function(keyLength) {
+        failing.push({
+            name: &quot;AES-CTR &quot; + keyLength.toString() + &quot;-bit key, 0-bit counter&quot;,
+            keyBuffer: keyBytes[keyLength],
+            key: null,
+            algorithm: {name: &quot;AES-CTR&quot;, counter: counter, length: 0},
+            plaintext: plaintext,
+            result: ciphertext[keyLength]
+        });
+
+        failing.push({
+            name: &quot;AES-CTR &quot; + keyLength.toString() + &quot;-bit key, 129-bit counter&quot;,
+            keyBuffer: keyBytes[keyLength],
+            key: null,
+            algorithm: {name: &quot;AES-CTR&quot;, counter: counter, length: 129},
+            plaintext: plaintext,
+            result: ciphertext[keyLength]
+        });
+    });
+
+    return {passing: passing, failing: failing, decryptionFailing: []};
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaes_gcmworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_gcm.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_gcm.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_gcm.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;aes_gcm_vectors.js&quot;);
+importScripts(&quot;aes.js&quot;);
+
+run_test();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptaes_gcm_vectorsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_gcm_vectors.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_gcm_vectors.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_gcm_vectors.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,262 @@
</span><ins>+
+// aes_gcm_vectors.js
+
+// The following function returns an array of test vectors
+// for the subtleCrypto encrypt method.
+//
+// Each test vector has the following fields:
+//     name - a unique name for this vector
+//     keyBuffer - an arrayBuffer with the key data in raw form
+//     key - a CryptoKey object for the keyBuffer. INITIALLY null! You must fill this in first to use it!
+//     algorithm - the value of the AlgorithmIdentifier parameter to provide to encrypt
+//     plaintext - the text to encrypt
+//     result - the expected result (usually just ciphertext, sometimes with added authentication)
+function getTestVectors() {
+    // Before we can really start, we need to fill a bunch of buffers with data
+    var plaintext = new Uint8Array([84, 104, 105, 115, 32, 115,
+        112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110,
+        32, 100, 101, 115, 99, 114, 105, 98, 101, 115, 32, 97, 32,
+        74, 97, 118, 97, 83, 99, 114, 105, 112, 116, 32, 65, 80,
+        73, 32, 102, 111, 114, 32, 112, 101, 114, 102, 111, 114,
+        109, 105, 110, 103, 32, 98, 97, 115, 105, 99, 32, 99, 114,
+        121, 112, 116, 111, 103, 114, 97, 112, 104, 105, 99, 32,
+        111, 112, 101, 114, 97, 116, 105, 111, 110, 115, 32, 105,
+        110, 32, 119, 101, 98, 32, 97, 112, 112, 108, 105, 99, 97,
+        116, 105, 111, 110, 115, 44, 32, 115, 117, 99, 104, 32, 97,
+        115, 32, 104, 97, 115, 104, 105, 110, 103, 44, 32, 115,
+        105, 103, 110, 97, 116, 117, 114, 101, 32, 103, 101, 110,
+        101, 114, 97, 116, 105, 111, 110, 32, 97, 110, 100, 32,
+        118, 101, 114, 105, 102, 105, 99, 97, 116, 105, 111, 110,
+        44, 32, 97, 110, 100, 32, 101, 110, 99, 114, 121, 112,
+        116, 105, 111, 110, 32, 97, 110, 100, 32, 100, 101, 99,
+        114, 121, 112, 116, 105, 111, 110, 46, 32, 65, 100, 100,
+        105, 116, 105, 111, 110, 97, 108, 108, 121, 44, 32, 105,
+        116, 32, 100, 101, 115, 99, 114, 105, 98, 101, 115, 32, 97,
+        110, 32, 65, 80, 73, 32, 102, 111, 114, 32, 97, 112, 112,
+        108, 105, 99, 97, 116, 105, 111, 110, 115, 32, 116, 111,
+        32, 103, 101, 110, 101, 114, 97, 116, 101, 32, 97, 110,
+        100, 47, 111, 114, 32, 109, 97, 110, 97, 103, 101, 32, 116,
+        104, 101, 32, 107, 101, 121, 105, 110, 103, 32, 109, 97,
+        116, 101, 114, 105, 97, 108, 32, 110, 101, 99, 101, 115,
+        115, 97, 114, 121, 32, 116, 111, 32, 112, 101, 114, 102,
+        111, 114, 109, 32, 116, 104, 101, 115, 101, 32, 111, 112,
+        101, 114, 97, 116, 105, 111, 110, 115, 46, 32, 85, 115,
+        101, 115, 32, 102, 111, 114, 32, 116, 104, 105, 115, 32,
+        65, 80, 73, 32, 114, 97, 110, 103, 101, 32, 102, 114, 111,
+        109, 32, 117, 115, 101, 114, 32, 111, 114, 32, 115, 101,
+        114, 118, 105, 99, 101, 32, 97, 117, 116, 104, 101, 110,
+        116, 105, 99, 97, 116, 105, 111, 110, 44, 32, 100, 111,
+        99, 117, 109, 101, 110, 116, 32, 111, 114, 32, 99, 111,
+        100, 101, 32, 115, 105, 103, 110, 105, 110, 103, 44, 32,
+        97, 110, 100, 32, 116, 104, 101, 32, 99, 111, 110, 102,
+        105, 100, 101, 110, 116, 105, 97, 108, 105, 116, 121, 32,
+        97, 110, 100, 32, 105, 110, 116, 101, 103, 114, 105, 116,
+        121, 32, 111, 102, 32, 99, 111, 109, 109, 117, 110, 105,
+        99, 97, 116, 105, 111, 110, 115, 46]);
+
+    // We want some random key bytes of various sizes.
+    // These were randomly generated from a script.
+    var keyBytes = {
+        128: new Uint8Array([222, 192, 212, 252, 191, 60, 71,
+            65, 200, 146, 218, 189, 28, 212, 192, 78]),
+        192: new Uint8Array([208, 238, 131, 65, 63, 68, 196, 63, 186, 208,
+            61, 207, 166, 18, 99, 152, 29, 109, 221, 95, 240, 30, 28, 246]),
+        256: new Uint8Array([103, 105, 56, 35, 251, 29, 88, 7, 63, 145, 236,
+            233, 204, 58, 249, 16, 229, 83, 38, 22, 164, 210, 123, 19, 235, 123, 116,
+            216, 0, 11, 191, 48])
+    }
+
+    // AES-GCM needs an IV of no more than 2^64 - 1 bytes. Well, 32 bytes is okay then.
+    var iv = new Uint8Array([58, 146, 115, 42, 166, 234, 57,
+        191, 57, 134, 224, 199, 63, 169, 32, 0, 32, 33, 117, 56,
+        94, 248, 173, 234, 194, 200, 115, 53, 235, 146, 141, 212]);
+
+    // Authenticated encryption via AES-GCM requires additional data that
+    // will be checked. We use the ASCII encoded Editorial Note
+    // following the Abstract of the Web Cryptography API recommendation.
+    var additionalData = new Uint8Array([84, 104, 101, 114, 101,
+        32, 97, 114, 101, 32, 55, 32, 102, 117, 114, 116, 104, 101,
+        114, 32, 101, 100, 105, 116, 111, 114, 105, 97, 108, 32,
+        110, 111, 116, 101, 115, 32, 105, 110, 32, 116, 104, 101,
+        32, 100, 111, 99, 117, 109, 101, 110, 116, 46]);
+
+    //  The length of the tag defaults to 16 bytes (128 bit).
+    var tag = {
+        128: new Uint8Array([194, 226, 198, 253, 239, 28,
+            197, 240, 123, 216, 176, 151, 239, 200, 184, 183]),
+        192: new Uint8Array([183, 57, 32, 144, 164, 76, 121, 77, 58,
+            86, 62, 132, 53, 130, 96, 225]),
+        256: new Uint8Array([188, 239, 241, 48, 159, 21, 213, 0, 241,
+            42, 85, 76, 194, 28, 49, 60])
+    };
+
+    var tag_with_empty_ad = {
+        128: new Uint8Array([222, 51, 11, 23, 36, 222, 250, 248, 27, 98, 30, 81, 150, 35, 220, 198]),
+        192: new Uint8Array([243, 11, 130, 112, 169, 239, 114, 238, 185, 219, 93, 1, 95, 108, 184, 183]),
+        256: new Uint8Array([244, 186, 86, 203, 154, 37, 191, 248, 246, 57, 139, 130, 224, 47, 217, 238])
+    };
+
+
+    // Results. These were created using the Python cryptography module.
+
+    // AES-GCM produces ciphertext and a tag.
+    var ciphertext = {
+        128: new Uint8Array([180, 241, 40, 183, 105,
+            52, 147, 238, 224, 175, 175, 236, 168, 244, 241, 121, 9,
+            202, 225, 237, 56, 216, 253, 254, 186, 102, 111, 207, 228,
+            190, 130, 177, 159, 246, 6, 53, 249, 113, 228, 254, 81,
+            126, 253, 191, 100, 43, 251, 147, 107, 91, 166, 231, 201,
+            241, 180, 214, 112, 47, 123, 164, 186, 134, 54, 65, 22,
+            181, 201, 82, 236, 59, 52, 139, 172, 39, 41, 89, 123, 62,
+            102, 167, 82, 150, 250, 93, 96, 169, 135, 89, 245, 255,
+            164, 192, 169, 159, 25, 16, 139, 145, 76, 4, 144, 131,
+            148, 197, 204, 46, 23, 110, 193, 228, 127, 120, 242, 24,
+            54, 240, 181, 162, 98, 244, 249, 68, 134, 122, 126, 151,
+            38, 108, 116, 68, 150, 109, 38, 194, 21, 159, 140, 205,
+            183, 35, 97, 151, 186, 120, 145, 22, 235, 22, 210, 223,
+            187, 143, 162, 183, 93, 196, 104, 51, 96, 53, 234, 250,
+            184, 76, 237, 157, 37, 203, 226, 87, 222, 75, 240, 95, 218,
+            222, 64, 81, 165, 75, 201, 216, 190, 13, 116, 217, 69, 66,
+            47, 161, 68, 247, 74, 253, 157, 181, 162, 121, 53, 32, 91,
+            124, 230, 105, 224, 17, 187, 50, 61, 77, 103, 79, 71, 57,
+            163, 116, 234, 149, 27, 105, 24, 31, 159, 3, 128, 130, 42,
+            94, 125, 200, 142, 251, 148, 201, 17, 149, 232, 84, 50, 17,
+            18, 203, 186, 226, 164, 227, 202, 76, 65, 16, 163, 224,
+            132, 52, 31, 101, 129, 72, 171, 159, 42, 177, 253, 98, 86,
+            201, 95, 117, 62, 12, 205, 78, 36, 126, 196, 121, 89, 185,
+            37, 161, 66, 181, 117, 186, 71, 124, 132, 110, 120, 27,
+            246, 163, 18, 13, 90, 200, 127, 82, 209, 241, 170, 73, 247,
+            137, 96, 244, 254, 251, 119, 71, 156, 27, 107, 53, 33, 45,
+            22, 0, 144, 48, 32, 11, 116, 21, 125, 246, 217, 171, 158,
+            224, 142, 234, 141, 242, 168, 89, 154, 66, 227, 161, 182,
+            96, 1, 88, 78, 12, 7, 239, 30, 206, 31, 89, 111, 107, 42,
+            37, 241, 148, 232, 1, 8, 251, 117, 146, 183, 9, 48, 39, 94,
+            59, 70, 230, 26, 165, 97, 156, 140, 141, 31, 62, 10, 206,
+            55, 48, 207, 0, 197, 202, 197, 108, 133, 175, 80, 4, 16,
+            154, 223, 255, 4, 196, 188, 178, 240, 29, 13, 120, 5, 225,
+            202, 3, 35, 225, 158, 92, 152, 73, 205, 107, 157, 224, 245,
+            99, 194, 171, 156, 245, 247, 183, 165, 40, 62, 200, 110,
+            29, 151, 206, 100, 175, 88, 36, 242, 90, 4, 82, 73, 250,
+            140, 245, 217, 9, 153, 35, 242, 206, 78, 197, 121, 115, 15,
+            80, 128, 101, 191, 240, 91, 151, 249, 62, 62, 244, 18, 3,
+            17, 135, 222, 210, 93, 149, 123]),
+
+        192: new Uint8Array([126, 160, 166, 112, 227, 212, 106,
+            186, 175, 70, 24, 28, 86, 149, 31, 154, 156, 190, 244, 132, 44, 61, 149,
+            242, 105, 67, 17, 136, 7, 146, 153, 170, 200, 214, 142, 205, 170, 225,
+            85, 44, 241, 159, 255, 234, 10, 13, 37, 48, 255, 21, 141, 176, 60, 117,
+            73, 130, 247, 204, 144, 102, 167, 89, 203, 235, 229, 129, 122, 253, 124,
+            179, 115, 118, 163, 157, 67, 141, 122, 146, 209, 11, 112, 5, 230, 117,
+            123, 184, 243, 99, 83, 10, 31, 166, 96, 1, 121, 44, 10, 241, 24, 43,
+            184, 187, 25, 239, 246, 176, 108, 230, 127, 25, 42, 67, 202, 140, 179,
+            104, 159, 75, 103, 43, 248, 98, 166, 179, 67, 0, 163, 227, 84, 40, 129,
+            227, 198, 205, 7, 156, 16, 185, 24, 166, 59, 218, 197, 114, 74, 34, 126,
+            22, 226, 226, 85, 212, 69, 83, 163, 185, 68, 109, 182, 54, 209, 237, 96,
+            184, 32, 53, 127, 175, 13, 146, 141, 115, 164, 184, 98, 245, 174, 223,
+            46, 32, 167, 39, 103, 19, 210, 80, 131, 254, 103, 249, 247, 29, 120, 31,
+            105, 241, 103, 169, 249, 93, 153, 74, 56, 53, 239, 157, 132, 236, 169,
+            246, 242, 24, 113, 97, 128, 238, 152, 148, 31, 84, 8, 52, 105, 198, 116,
+            103, 132, 48, 199, 23, 90, 24, 29, 63, 41, 117, 191, 57, 31, 209, 128,
+            60, 119, 175, 84, 141, 177, 165, 169, 195, 35, 163, 105, 146, 157, 209,
+            93, 149, 105, 160, 93, 231, 78, 201, 92, 235, 200, 89, 37, 50, 181, 30,
+            213, 242, 59, 156, 219, 19, 158, 17, 224, 81, 108, 52, 87, 248, 101, 23,
+            39, 107, 67, 151, 103, 230, 126, 202, 184, 118, 226, 18, 29, 93, 37, 208,
+            40, 82, 113, 35, 157, 145, 152, 50, 253, 140, 47, 141, 192, 1, 148, 114,
+            40, 10, 112, 79, 227, 16, 105, 247, 31, 49, 102, 195, 75, 183, 172, 254,
+            188, 42, 89, 77, 38, 104, 1, 180, 106, 61, 71, 70, 35, 160, 103, 101,
+            244, 26, 226, 37, 159, 155, 4, 107, 222, 219, 136, 37, 24, 246, 44, 23,
+            44, 248, 132, 108, 59, 179, 99, 145, 132, 82, 53, 203, 111, 150, 55,
+            123, 51, 214, 165, 108, 124, 179, 131, 174, 139, 224, 114, 96, 218, 181,
+            243, 128, 198, 98, 115, 92, 95, 165, 23, 229, 108, 146, 14, 244, 162,
+            37, 85, 201, 33, 44, 92, 106, 112, 185, 16, 189, 42, 114, 109, 59, 124,
+            131, 16, 211, 31, 97, 29, 135, 61, 150, 75, 250, 207, 129, 38, 205, 187,
+            186, 55, 207, 232, 24, 48, 232, 49, 226, 16, 12, 27, 70, 31, 124, 128,
+            218, 100, 91, 200, 184, 78, 252, 100, 235, 62, 43, 69, 214, 163, 65, 14,
+            44, 180]),
+
+        256: new Uint8Array([8, 97, 235, 113, 70, 32, 135, 131,
+            210, 209, 124, 160, 255, 182, 9, 29, 125, 193, 27, 240, 129, 46, 2, 137,
+            169, 142, 61, 7, 145, 54, 170, 207, 159, 111, 39, 95, 87, 63, 162, 27,
+            6, 18, 219, 215, 116, 34, 90, 57, 114, 244, 102, 145, 67, 6, 51, 152,
+            247, 165, 242, 116, 100, 219, 177, 72, 177, 17, 110, 67, 93, 219, 100,
+            217, 20, 207, 89, 154, 45, 37, 105, 83, 67, 162, 140, 235, 129, 40, 177,
+            202, 174, 54, 148, 55, 156, 193, 232, 249, 134, 163, 195, 51, 114, 116,
+            65, 38, 73, 99, 96, 249, 224, 69, 17, 119, 186, 188, 181, 43, 78, 156,
+            76, 138, 226, 63, 5, 248, 9, 94, 26, 1, 2, 235, 39, 174, 74, 47, 183,
+            22, 40, 47, 47, 13, 100, 119, 12, 67, 178, 184, 56, 167, 238, 143, 13,
+            44, 208, 185, 151, 108, 6, 17, 52, 122, 182, 210, 207, 42, 219, 37, 74,
+            94, 126, 36, 249, 37, 32, 4, 218, 44, 238, 69, 56, 219, 31, 77, 173, 46,
+            187, 103, 36, 112, 213, 252, 40, 87, 164, 240, 163, 159, 32, 129, 125,
+            178, 108, 47, 28, 31, 36, 42, 115, 36, 14, 145, 195, 156, 191, 46, 163,
+            249, 181, 31, 90, 73, 30, 72, 57, 223, 63, 60, 79, 140, 14, 117, 31,
+            145, 222, 156, 121, 237, 32, 145, 143, 96, 12, 254, 35, 21, 21, 59, 168,
+            171, 154, 217, 0, 59, 202, 175, 103, 214, 192, 175, 26, 18, 43, 54, 176,
+            222, 75, 22, 7, 122, 253, 224, 145, 61, 42, 208, 73, 237, 84, 141, 209,
+            213, 228, 46, 244, 59, 9, 68, 6, 35, 88, 189, 10, 62, 9, 85, 28, 44, 82,
+            19, 153, 160, 178, 240, 56, 160, 244, 201, 173, 77, 61, 20, 227, 30,
+            180, 167, 16, 105, 185, 193, 95, 207, 41, 23, 134, 78, 198, 182, 93, 24,
+            89, 247, 231, 75, 233, 194, 137, 242, 114, 194, 190, 130, 138, 238, 94,
+            137, 193, 194, 115, 137, 190, 207, 169, 83, 155, 14, 210, 160, 129, 195,
+            161, 234, 221, 255, 114, 67, 98, 12, 93, 41, 65, 183, 244, 103, 247,
+            101, 82, 246, 125, 87, 125, 78, 21, 186, 102, 205, 20, 40, 32, 201, 174,
+            15, 52, 240, 217, 180, 162, 108, 6, 211, 41, 18, 135, 232, 184, 18, 188,
+            169, 157, 190, 76, 166, 75, 176, 127, 39, 251, 22, 203, 153, 80, 49,
+            241, 124, 137, 151, 123, 204, 43, 159, 190, 177, 196, 18, 117, 169, 46,
+            152, 251, 45, 25, 164, 27, 145, 214, 228, 55, 15, 2, 131, 216, 80, 255,
+            204, 175, 100, 59, 145, 15, 103, 40, 33, 45, 255, 200, 254, 172, 138,
+            20, 58, 87, 182, 192, 148, 219, 41, 88, 230, 229, 70, 249])
+    };
+
+    var keyLengths = [128, 192, 256];
+    var tagLengths = [32, 64, 96, 104, 112, 120, 128];
+
+    // All the scenarios that should succeed, if the key has &quot;encrypt&quot; usage
+    var passing = [];
+    keyLengths.forEach(function(keyLength) {
+        tagLengths.forEach(function(tagLength) {
+            var byteCount = tagLength / 8;
+
+            var result = new Uint8Array(ciphertext[keyLength].byteLength + byteCount);
+            result.set(ciphertext[keyLength], 0);
+            result.set(tag[keyLength].slice(0, byteCount), ciphertext[keyLength].byteLength);
+            passing.push({
+                    name: &quot;AES-GCM &quot; + keyLength.toString() + &quot;-bit key, &quot; + tagLength.toString() + &quot;-bit tag&quot;,
+                    keyBuffer: keyBytes[keyLength],
+                    key: null,
+                    algorithm: {name: &quot;AES-GCM&quot;, iv: iv, additionalData: additionalData, tagLength: tagLength},
+                    plaintext: plaintext,
+                    result: result
+            });
+
+            var noadresult = new Uint8Array(ciphertext[keyLength].byteLength + byteCount);
+            noadresult.set(ciphertext[keyLength], 0);
+            noadresult.set(tag_with_empty_ad[keyLength].slice(0, byteCount), ciphertext[keyLength].byteLength);
+            passing.push({
+                    name: &quot;AES-GCM &quot; + keyLength.toString() + &quot;-bit key, no additional data, &quot; + tagLength.toString() + &quot;-bit tag&quot;,
+                    keyBuffer: keyBytes[keyLength],
+                    key: null,
+                    algorithm: {name: &quot;AES-GCM&quot;, iv: iv, tagLength: tagLength},
+                    plaintext: plaintext,
+                    result: noadresult
+            });
+        });
+    });
+
+    // Scenarios that should fail because of a bad tag length, causing an OperationError
+    var failing = [];
+    keyLengths.forEach(function(keyLength) {
+        // First, make some tests for bad tag lengths
+        [24, 48, 72, 95, 129, 256].forEach(function(badTagLength) {
+            failing.push({
+                name: &quot;AES-GCM &quot; + keyLength.toString() + &quot;-bit key, illegal tag length &quot; + badTagLength.toString() + &quot;-bits&quot;,
+                keyBuffer: keyBytes[keyLength],
+                key: null,
+                algorithm: {name: &quot;AES-GCM&quot;, iv: iv, additionalData: additionalData, tagLength: badTagLength},
+                plaintext: plaintext,
+                result: ciphertext[keyLength]
+            });
+        });
+    });
+
+    return {passing: passing, failing: failing, decryptionFailing: []};
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptrsajs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,376 @@
</span><ins>+
+function run_test() {
+    var subtle = self.crypto.subtle; // Change to test prefixed implementations
+
+    // When are all these tests really done? When all the promises they use have resolved.
+    var all_promises = [];
+
+    // Source file rsa_vectors.js provides the getTestVectors method
+    // for the RSA-OAEP algorithm that drives these tests.
+    var vectors = getTestVectors();
+    var passingVectors = vectors.passing;
+    var failingVectors = vectors.failing;
+
+    // Test decryption, first, because encryption tests rely on that working
+    passingVectors.forEach(function(vector) {
+        var promise = importVectorKeys(vector, [&quot;encrypt&quot;], [&quot;decrypt&quot;])
+        .then(function(vectors) {
+            // Get a one byte longer plaintext to encrypt
+            if (!(&quot;ciphertext&quot; in vector)) {
+                return;
+            }
+
+            promise_test(function(test) {
+                return subtle.decrypt(vector.algorithm, vector.privateKey, vector.ciphertext)
+                .then(function(plaintext) {
+                    assert_true(equalBuffers(plaintext, vector.plaintext, &quot;Decryption works&quot;));
+                }, function(err) {
+                    assert_unreached(&quot;Decryption should not throw error &quot; + vector.name + &quot;: &quot; + err.message + &quot;'&quot;);
+                });
+            }, vector.name + &quot; decryption&quot;);
+
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importVectorKeys failed for &quot; + vector.name + &quot;. Message: ''&quot; + err.message + &quot;''&quot;);
+            }, &quot;importVectorKeys step: &quot; + vector.name + &quot; decryption&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Test decryption with an altered buffer
+    passingVectors.forEach(function(vector) {
+        var promise = importVectorKeys(vector, [&quot;encrypt&quot;], [&quot;decrypt&quot;])
+        .then(function(vectors) {
+            // Get a one byte longer plaintext to encrypt
+            if (!(&quot;ciphertext&quot; in vector)) {
+                return;
+            }
+
+            promise_test(function(test) {
+                var ciphertext = copyBuffer(vector.ciphertext);
+                var operation = subtle.decrypt(vector.algorithm, vector.privateKey, ciphertext)
+                .then(function(plaintext) {
+                    assert_true(equalBuffers(plaintext, vector.plaintext, &quot;Decryption works&quot;));
+                }, function(err) {
+                    assert_unreached(&quot;Decryption should not throw error &quot; + vector.name + &quot;: &quot; + err.message + &quot;'&quot;);
+                });
+                ciphertext[0] = 255 - ciphertext[0];
+                return operation;
+            }, vector.name + &quot; decryption with altered ciphertext&quot;);
+
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importVectorKeys failed for &quot; + vector.name + &quot;. Message: ''&quot; + err.message + &quot;''&quot;);
+            }, &quot;importVectorKeys step: &quot; + vector.name + &quot; decryption with altered ciphertext&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Check for failures due to using publicKey to decrypt.
+    passingVectors.forEach(function(vector) {
+        var promise = importVectorKeys(vector, [&quot;encrypt&quot;], [&quot;decrypt&quot;])
+        .then(function(vectors) {
+            promise_test(function(test) {
+                return subtle.decrypt(vector.algorithm, vector.publicKey, vector.ciphertext)
+                .then(function(plaintext) {
+                    assert_unreached(&quot;Should have thrown error for using publicKey to decrypt in &quot; + vector.name + &quot;: &quot; + err.message + &quot;'&quot;);
+                }, function(err) {
+                    assert_equals(err.name, &quot;InvalidAccessError&quot;, &quot;Should throw InvalidAccessError instead of &quot; + err.message);
+                });
+            }, vector.name + &quot; using publicKey to decrypt&quot;);
+
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importVectorKeys failed for &quot; + vector.name + &quot;. Message: ''&quot; + err.message + &quot;''&quot;);
+            }, &quot;importVectorKeys step: &quot; + vector.name + &quot; using publicKey to decrypt&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+
+    // Check for failures due to no &quot;decrypt&quot; usage.
+    passingVectors.forEach(function(originalVector) {
+        var vector = Object.assign({}, originalVector);
+
+        var promise = importVectorKeys(vector, [&quot;encrypt&quot;], [&quot;unwrapKey&quot;])
+        .then(function(vectors) {
+            // Get a one byte longer plaintext to encrypt
+            promise_test(function(test) {
+                return subtle.decrypt(vector.algorithm, vector.publicKey, vector.ciphertext)
+                .then(function(plaintext) {
+                    assert_unreached(&quot;Should have thrown error for no decrypt usage in &quot; + vector.name + &quot;: &quot; + err.message + &quot;'&quot;);
+                }, function(err) {
+                    assert_equals(err.name, &quot;InvalidAccessError&quot;, &quot;Should throw InvalidAccessError instead of &quot; + err.message);
+                });
+            }, vector.name + &quot; no decrypt usage&quot;);
+
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importVectorKeys failed for &quot; + vector.name + &quot;. Message: ''&quot; + err.message + &quot;''&quot;);
+            }, &quot;importVectorKeys step: &quot; + vector.name + &quot; no decrypt usage&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+
+    // Check for successful encryption even if plaintext is altered after call.
+    passingVectors.forEach(function(vector) {
+        var promise = importVectorKeys(vector, [&quot;encrypt&quot;], [&quot;decrypt&quot;])
+        .then(function(vectors) {
+            promise_test(function(test) {
+                var plaintext = copyBuffer(vector.plaintext);
+                var operation = subtle.encrypt(vector.algorithm, vector.publicKey, plaintext)
+                .then(function(ciphertext) {
+                    assert_equals(ciphertext.byteLength * 8, vector.privateKey.algorithm.modulusLength, &quot;Ciphertext length matches modulus length&quot;);
+                    // Can we get the original plaintext back via decrypt?
+                    return subtle.decrypt(vector.algorithm, vector.privateKey, ciphertext)
+                    .then(function(result) {
+                        assert_true(equalBuffers(result, vector.plaintext), &quot;Round trip returns original plaintext&quot;);
+                        return ciphertext;
+                    }, function(err) {
+                        assert_unreached(&quot;decrypt error for test &quot; + vector.name + &quot;: &quot; + err.message + &quot;'&quot;);
+                    });
+                })
+                .then(function(priorCiphertext) {
+                    // Will a second encrypt give us different ciphertext, as it should?
+                    return subtle.encrypt(vector.algorithm, vector.publicKey, vector.plaintext)
+                    .then(function(ciphertext) {
+                        assert_false(equalBuffers(priorCiphertext, ciphertext), &quot;Two encrypts give different results&quot;)
+                    }, function(err) {
+                        assert_unreached(&quot;second time encrypt error for test &quot; + vector.name + &quot;: '&quot; + err.message + &quot;'&quot;);
+                    });
+                }, function(err) {
+                    assert_unreached(&quot;decrypt error for test &quot; + vector.name + &quot;: '&quot; + err.message + &quot;'&quot;);
+                });
+
+                plaintext[0] = 255 - plaintext[0];
+                return operation;
+            }, vector.name + &quot; with altered plaintext&quot;);
+
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importVectorKeys failed for &quot; + vector.name + &quot;. Message: ''&quot; + err.message + &quot;''&quot;);
+            }, &quot;importVectorKeys step: &quot; + vector.name + &quot; with altered plaintext&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Check for successful encryption.
+    passingVectors.forEach(function(vector) {
+        var promise = importVectorKeys(vector, [&quot;encrypt&quot;], [&quot;decrypt&quot;])
+        .then(function(vectors) {
+            promise_test(function(test) {
+                return subtle.encrypt(vector.algorithm, vector.publicKey, vector.plaintext)
+                .then(function(ciphertext) {
+                    assert_equals(ciphertext.byteLength * 8, vector.privateKey.algorithm.modulusLength, &quot;Ciphertext length matches modulus length&quot;);
+
+                    // Can we get the original plaintext back via decrypt?
+                    return subtle.decrypt(vector.algorithm, vector.privateKey, ciphertext)
+                    .then(function(result) {
+                        assert_true(equalBuffers(result, vector.plaintext), &quot;Round trip returns original plaintext&quot;);
+                        return ciphertext;
+                    }, function(err) {
+                        assert_unreached(&quot;decrypt error for test &quot; + vector.name + &quot;: &quot; + err.message + &quot;'&quot;);
+                    });
+                })
+                .then(function(priorCiphertext) {
+                    // Will a second encrypt give us different ciphertext, as it should?
+                    return subtle.encrypt(vector.algorithm, vector.publicKey, vector.plaintext)
+                    .then(function(ciphertext) {
+                        assert_false(equalBuffers(priorCiphertext, ciphertext), &quot;Two encrypts give different results&quot;)
+                    }, function(err) {
+                        assert_unreached(&quot;second time encrypt error for test &quot; + vector.name + &quot;: '&quot; + err.message + &quot;'&quot;);
+                    });
+                }, function(err) {
+                    assert_unreached(&quot;decrypt error for test &quot; + vector.name + &quot;: '&quot; + err.message + &quot;'&quot;);
+                });
+            }, vector.name);
+
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importVectorKeys failed for &quot; + vector.name + &quot;. Message: ''&quot; + err.message + &quot;''&quot;);
+            }, &quot;importVectorKeys step: &quot; + vector.name);
+        });
+
+        all_promises.push(promise);
+    });
+
+    // Check for failures due to too long plaintext.
+    passingVectors.forEach(function(vector) {
+        var promise = importVectorKeys(vector, [&quot;encrypt&quot;], [&quot;decrypt&quot;])
+        .then(function(vectors) {
+            // Get a one byte longer plaintext to encrypt
+            var plaintext = new Uint8Array(vector.plaintext.byteLength + 1);
+            plaintext.set(plaintext, 0);
+            plaintext.set(new Uint8Array([32]), vector.plaintext.byteLength);
+            promise_test(function(test) {
+                return subtle.encrypt(vector.algorithm, vector.publicKey, plaintext)
+                .then(function(ciphertext) {
+                    assert_unreached(&quot;Should have thrown error for too long plaintext in &quot; + vector.name + &quot;: &quot; + err.message + &quot;'&quot;);
+                }, function(err) {
+                    assert_equals(err.name, &quot;OperationError&quot;, &quot;Should throw OperationError instead of &quot; + err.message);
+                });
+            }, vector.name + &quot; too long plaintext&quot;);
+
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importVectorKeys failed for &quot; + vector.name + &quot;. Message: ''&quot; + err.message + &quot;''&quot;);
+            }, &quot;importVectorKeys step: &quot; + vector.name + &quot; too long plaintext&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+
+    // Check for failures due to using privateKey to encrypt.
+    passingVectors.forEach(function(vector) {
+        var promise = importVectorKeys(vector, [&quot;encrypt&quot;], [&quot;decrypt&quot;])
+        .then(function(vectors) {
+            promise_test(function(test) {
+                return subtle.encrypt(vector.algorithm, vector.privateKey, vector.plaintext)
+                .then(function(ciphertext) {
+                    assert_unreached(&quot;Should have thrown error for using privateKey to encrypt in &quot; + vector.name + &quot;: &quot; + err.message + &quot;'&quot;);
+                }, function(err) {
+                    assert_equals(err.name, &quot;InvalidAccessError&quot;, &quot;Should throw InvalidAccessError instead of &quot; + err.message);
+                });
+            }, vector.name + &quot; using privateKey to encrypt&quot;);
+
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importVectorKeys failed for &quot; + vector.name + &quot;. Message: ''&quot; + err.message + &quot;''&quot;);
+            }, &quot;importVectorKeys step: &quot; + vector.name + &quot; using privateKey to encrypt&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+
+    // Check for failures due to no &quot;encrypt usage&quot;.
+    passingVectors.forEach(function(originalVector) {
+        var vector = Object.assign({}, originalVector);
+
+        var promise = importVectorKeys(vector, [], [&quot;decrypt&quot;])
+        .then(function(vectors) {
+            // Get a one byte longer plaintext to encrypt
+            promise_test(function(test) {
+                return subtle.encrypt(vector.algorithm, vector.publicKey, vector.plaintext)
+                .then(function(ciphertext) {
+                    assert_unreached(&quot;Should have thrown error for no encrypt usage in &quot; + vector.name + &quot;: &quot; + err.message + &quot;'&quot;);
+                }, function(err) {
+                    assert_equals(err.name, &quot;InvalidAccessError&quot;, &quot;Should throw InvalidAccessError instead of &quot; + err.message);
+                });
+            }, vector.name + &quot; no encrypt usage&quot;);
+
+        }, function(err) {
+            // We need a failed test if the importVectorKey operation fails, so
+            // we know we never tested encryption
+            promise_test(function(test) {
+                assert_unreached(&quot;importVectorKeys failed for &quot; + vector.name + &quot;. Message: ''&quot; + err.message + &quot;''&quot;);
+            }, &quot;importVectorKeys step: &quot; + vector.name + &quot; no encrypt usage&quot;);
+        });
+
+        all_promises.push(promise);
+    });
+
+    Promise.all(all_promises)
+    .then(function() {done();})
+    .catch(function() {done();})
+
+    // A test vector has all needed fields for encryption, EXCEPT that the
+    // key field may be null. This function replaces that null with the Correct
+    // CryptoKey object.
+    //
+    // Returns a Promise that yields an updated vector on success.
+    function importVectorKeys(vector, publicKeyUsages, privateKeyUsages) {
+        var publicPromise, privatePromise;
+
+        if (vector.publicKey !== null) {
+            publicPromise = new Promise(function(resolve, reject) {
+                resolve(vector);
+            });
+        } else {
+            publicPromise = subtle.importKey(vector.publicKeyFormat, vector.publicKeyBuffer, {name: vector.algorithm.name, hash: vector.hash}, false, publicKeyUsages)
+            .then(function(key) {
+                vector.publicKey = key;
+                return vector;
+            });        // Returns a copy of the sourceBuffer it is sent.
+        function copyBuffer(sourceBuffer) {
+            var source = new Uint8Array(sourceBuffer);
+            var copy = new Uint8Array(sourceBuffer.byteLength)
+
+            for (var i=0; i&lt;source.byteLength; i++) {
+                copy[i] = source[i];
+            }
+
+            return copy;
+        }
+
+        }
+
+        if (vector.privateKey !== null) {
+            privatePromise = new Promise(function(resolve, reject) {
+                resolve(vector);
+            });
+        } else {
+            privatePromise = subtle.importKey(vector.privateKeyFormat, vector.privateKeyBuffer, {name: vector.algorithm.name, hash: vector.hash}, false, privateKeyUsages)
+            .then(function(key) {
+                vector.privateKey = key;
+                return vector;
+            });
+        }
+
+        return Promise.all([publicPromise, privatePromise]);
+    }
+
+    // Returns a copy of the sourceBuffer it is sent.
+    function copyBuffer(sourceBuffer) {
+        var source = new Uint8Array(sourceBuffer);
+        var copy = new Uint8Array(sourceBuffer.byteLength)
+
+        for (var i=0; i&lt;source.byteLength; i++) {
+            copy[i] = source[i];
+        }
+
+        return copy;
+    }
+
+    function equalBuffers(a, b) {
+        if (a.byteLength !== b.byteLength) {
+            return false;
+        }
+
+        var aBytes = new Uint8Array(a);
+        var bBytes = new Uint8Array(b);
+
+        for (var i=0; i&lt;a.byteLength; i++) {
+            if (aBytes[i] !== bBytes[i]) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    return;
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptrsaworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;rsa_vectors.js&quot;);
+importScripts(&quot;rsa.js&quot;);
+
+run_test();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptrsa_vectorsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa_vectors.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa_vectors.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa_vectors.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,204 @@
</span><ins>+
+// rsa_vectors.js
+
+// Data for testing RSA-OAEP with a 2048-bit modulus and 65537 public exponent.
+
+// The following function returns an array of test vectors
+// for the subtleCrypto encrypt method.
+//
+// Each test vector has the following fields:
+//     name - a unique name for this vector
+//     publicKeyBuffer - an arrayBuffer with the key data
+//     publicKeyFormat - &quot;spki&quot; &quot;jwk&quot;
+//     publicKey - a CryptoKey object for the keyBuffer. INITIALLY null! You must fill this in first to use it!
+//     privateKeyBuffer - an arrayBuffer with the key data
+//     privateKeyFormat - &quot;pkcs8&quot; or &quot;jwk&quot;
+//     privateKey - a CryptoKey object for the keyBuffer. INITIALLY null! You must fill this in first to use it!
+//     algorithm - the value of the AlgorithmIdentifier parameter to provide to encrypt
+//     plaintext - the text to encrypt
+//     result - the expected result (usually just ciphertext, sometimes with added authentication)
+function getTestVectors() {
+    var pkcs8 = new Uint8Array([48, 130, 4, 191, 2, 1, 0, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 4, 130, 4, 169, 48, 130, 4, 165, 2, 1, 0, 2, 130, 1, 1, 0, 211, 87, 96, 146, 230, 41, 87, 54, 69, 68, 231, 228, 35, 59, 123, 219, 41, 61, 178, 8, 81, 34, 196, 121, 50, 133, 70, 249, 240, 247, 18, 246, 87, 196, 177, 120, 104, 201, 48, 144, 140, 197, 148, 247, 237, 0, 192, 20, 66, 193, 175, 4, 194, 246, 120, 164, 139, 162, 200, 15, 209, 113, 62, 48, 181, 172, 80, 120, 122, 195, 81, 101, 137, 241, 113, 150, 127, 99, 134, 173, 163, 73, 0, 166, 187, 4, 238, 206, 164, 43, 240, 67, 206, 217, 160, 249, 77, 12, 192, 158, 145, 155, 157, 113, 102, 192, 138, 182, 206, 32, 70, 64, 174, 164, 196, 146, 13, 182, 216, 110, 185, 22, 208, 220, 192, 244, 52, 26, 16, 56, 4, 41, 231, 225, 3, 33, 68, 234, 148, 157, 232, 246, 192, 204, 191, 149, 250, 142, 146, 141, 112, 216, 163, 140, 225, 104, 219, 69, 246, 241, 52, 102, 61, 111, 101, 111, 92, 234, 188, 114, 93, 168, 192, 42, 171, 234,
  170, 19, 172, 54, 167, 92, 192, 186, 225, 53, 223, 49, 20, 182, 101, 137, 199, 237, 60, 182, 21, 89, 174, 90, 56, 79, 22, 43, 250, 128, 219, 228, 97, 127, 134, 195, 241, 208, 16, 201, 79, 226, 201, 191, 1, 154, 110, 99, 179, 239, 192, 40, 212, 60, 238, 97, 28, 133, 236, 38, 60, 144, 108, 70, 55, 114, 198, 145, 27, 25, 238, 192, 150, 202, 118, 236, 94, 49, 225, 227, 2, 3, 1, 0, 1, 2, 130, 1, 1, 0, 139, 55, 92, 203, 135, 200, 37, 197, 255, 61, 83, 208, 9, 145, 110, 150, 65, 5, 126, 24, 82, 114, 39, 160, 122, 178, 38, 190, 16, 136, 129, 58, 59, 56, 187, 123, 72, 243, 119, 5, 81, 101, 250, 42, 147, 57, 210, 77, 198, 103, 213, 197, 186, 52, 39, 230, 164, 129, 23, 110, 172, 21, 255, 212, 144, 104, 49, 30, 28, 40, 59, 159, 58, 142, 12, 184, 9, 180, 99, 12, 80, 170, 143, 62, 69, 166, 11, 53, 158, 25, 191, 140, 187, 94, 202, 214, 78, 118, 31, 16, 149, 116, 63, 243, 106, 175, 92, 240, 236, 185, 127, 237, 173, 221, 166, 11, 91, 243, 93, 129, 26, 117, 184, 34, 35, 12, 250, 160, 25, 47,
  173, 64, 84, 126, 39, 84, 72, 170, 51, 22, 191, 142, 43, 76, 224, 133, 79, 199, 112, 139, 83, 123, 162, 45, 19, 33, 11, 9, 174, 195, 122, 39, 89, 239, 192, 130, 161, 83, 27, 35, 169, 23, 48, 3, 125, 222, 78, 242, 107, 95, 150, 239, 220, 195, 159, 211, 76, 52, 90, 213, 28, 187, 228, 79, 229, 139, 138, 59, 78, 201, 151, 134, 108, 8, 109, 255, 27, 136, 49, 239, 10, 31, 234, 38, 60, 247, 218, 205, 3, 192, 76, 188, 194, 178, 121, 229, 127, 165, 185, 83, 153, 107, 251, 29, 214, 136, 23, 175, 127, 180, 44, 222, 247, 165, 41, 74, 87, 250, 194, 184, 173, 115, 159, 27, 2, 153, 2, 129, 129, 0, 251, 248, 51, 194, 198, 49, 201, 112, 36, 12, 142, 116, 133, 240, 106, 62, 162, 168, 72, 34, 81, 26, 134, 39, 221, 70, 78, 248, 175, 175, 113, 72, 209, 164, 37, 182, 184, 101, 125, 221, 82, 70, 131, 43, 142, 83, 48, 32, 197, 187, 181, 104, 133, 90, 106, 236, 62, 66, 33, 215, 147, 241, 220, 91, 47, 37, 132, 226, 65, 94, 72, 233, 162, 189, 41, 43, 19, 64, 49, 249, 156, 142, 180, 47, 192, 188, 208,
  68, 155, 242, 44, 230, 222, 201, 112, 20, 239, 229, 172, 147, 235, 232, 53, 135, 118, 86, 37, 44, 187, 177, 108, 65, 91, 103, 177, 132, 210, 40, 69, 104, 162, 119, 213, 147, 53, 88, 92, 253, 2, 129, 129, 0, 214, 184, 206, 39, 199, 41, 93, 93, 22, 252, 53, 112, 237, 100, 200, 218, 147, 3, 250, 210, 148, 136, 193, 166, 94, 154, 215, 17, 249, 3, 112, 24, 125, 187, 253, 129, 49, 109, 105, 100, 139, 200, 140, 197, 200, 53, 81, 175, 255, 69, 222, 186, 207, 182, 17, 5, 247, 9, 228, 195, 8, 9, 185, 0, 49, 235, 214, 134, 36, 68, 150, 198, 246, 158, 105, 46, 189, 200, 20, 246, 66, 57, 244, 173, 21, 117, 110, 203, 120, 197, 165, 176, 153, 49, 219, 24, 48, 119, 197, 70, 163, 140, 76, 116, 56, 137, 173, 61, 62, 208, 121, 181, 98, 46, 208, 18, 15, 160, 225, 249, 59, 89, 61, 183, 216, 82, 224, 95, 2, 129, 128, 56, 135, 75, 157, 131, 247, 129, 120, 206, 45, 158, 252, 23, 92, 131, 137, 127, 214, 127, 48, 107, 191, 166, 159, 100, 238, 52, 35, 104, 206, 212, 124, 128, 195, 241, 206, 23, 122, 
 117, 141, 100, 186, 251, 12, 151, 134, 164, 66, 133, 250, 1, 205, 236, 53, 7, 205, 238, 125, 201, 183, 226, 178, 29, 60, 187, 204, 16, 14, 238, 153, 103, 132, 59, 5, 115, 41, 253, 204, 166, 41, 152, 237, 15, 17, 179, 140, 232, 176, 171, 199, 222, 57, 1, 124, 113, 207, 208, 174, 87, 84, 108, 85, 145, 68, 205, 208, 175, 208, 100, 95, 126, 168, 255, 7, 185, 116, 209, 237, 68, 253, 31, 142, 0, 245, 96, 191, 109, 69, 2, 129, 129, 0, 133, 41, 239, 144, 115, 207, 143, 123, 95, 249, 226, 26, 186, 223, 58, 65, 115, 211, 144, 6, 112, 223, 175, 89, 66, 106, 188, 223, 4, 147, 193, 61, 47, 29, 27, 70, 184, 36, 166, 172, 24, 148, 179, 217, 37, 37, 12, 24, 30, 52, 114, 193, 96, 120, 5, 110, 177, 154, 141, 40, 247, 31, 48, 128, 146, 117, 52, 129, 212, 148, 68, 253, 247, 140, 158, 166, 194, 68, 7, 220, 1, 142, 119, 211, 175, 239, 56, 91, 47, 247, 67, 158, 150, 35, 121, 65, 51, 45, 212, 70, 206, 190, 255, 219, 68, 4, 254, 79, 113, 89, 81, 97, 208, 22, 64, 44, 51, 77, 15, 87, 198, 26, 190, 79,
  249, 244, 203, 249, 2, 129, 129, 0, 135, 216, 119, 8, 212, 103, 99, 228, 204, 190, 178, 209, 233, 113, 46, 91, 240, 33, 109, 112, 222, 148, 32, 165, 178, 6, 155, 116, 89, 185, 159, 93, 159, 127, 47, 173, 124, 215, 154, 174, 230, 122, 127, 154, 52, 67, 126, 60, 121, 168, 74, 240, 205, 141, 233, 223, 242, 104, 235, 12, 71, 147, 245, 1, 249, 136, 213, 64, 246, 211, 71, 92, 32, 121, 184, 34, 122, 35, 217, 104, 222, 196, 227, 198, 101, 3, 24, 113, 147, 69, 150, 48, 71, 43, 253, 182, 186, 29, 231, 134, 199, 151, 250, 111, 78, 166, 90, 42, 132, 25, 38, 47, 41, 103, 136, 86, 203, 115, 201, 189, 75, 200, 155, 94, 4, 27, 34, 119]);
+    var spki = new Uint8Array([48, 130, 1, 34, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 3, 130, 1, 15, 0, 48, 130, 1, 10, 2, 130, 1, 1, 0, 211, 87, 96, 146, 230, 41, 87, 54, 69, 68, 231, 228, 35, 59, 123, 219, 41, 61, 178, 8, 81, 34, 196, 121, 50, 133, 70, 249, 240, 247, 18, 246, 87, 196, 177, 120, 104, 201, 48, 144, 140, 197, 148, 247, 237, 0, 192, 20, 66, 193, 175, 4, 194, 246, 120, 164, 139, 162, 200, 15, 209, 113, 62, 48, 181, 172, 80, 120, 122, 195, 81, 101, 137, 241, 113, 150, 127, 99, 134, 173, 163, 73, 0, 166, 187, 4, 238, 206, 164, 43, 240, 67, 206, 217, 160, 249, 77, 12, 192, 158, 145, 155, 157, 113, 102, 192, 138, 182, 206, 32, 70, 64, 174, 164, 196, 146, 13, 182, 216, 110, 185, 22, 208, 220, 192, 244, 52, 26, 16, 56, 4, 41, 231, 225, 3, 33, 68, 234, 148, 157, 232, 246, 192, 204, 191, 149, 250, 142, 146, 141, 112, 216, 163, 140, 225, 104, 219, 69, 246, 241, 52, 102, 61, 111, 101, 111, 92, 234, 188, 114, 93, 168, 192, 42, 171, 234, 170, 19, 172, 54, 
 167, 92, 192, 186, 225, 53, 223, 49, 20, 182, 101, 137, 199, 237, 60, 182, 21, 89, 174, 90, 56, 79, 22, 43, 250, 128, 219, 228, 97, 127, 134, 195, 241, 208, 16, 201, 79, 226, 201, 191, 1, 154, 110, 99, 179, 239, 192, 40, 212, 60, 238, 97, 28, 133, 236, 38, 60, 144, 108, 70, 55, 114, 198, 145, 27, 25, 238, 192, 150, 202, 118, 236, 94, 49, 225, 227, 2, 3, 1, 0, 1]);
+
+    // Can optionally provide a label for encryption. We use the ASCII-encoded
+    // abstract from the candidate recommendation.
+    var label = new Uint8Array([84, 104, 101, 114, 101, 32, 97, 114, 101, 32, 55, 32, 102, 117, 114, 116, 104, 101, 114, 32, 101, 100, 105, 116, 111, 114, 105, 97, 108, 32, 110, 111, 116, 101, 115, 32, 105, 110, 32, 116, 104, 101, 32, 100, 111, 99, 117, 109, 101, 110, 116, 46]);
+
+    // overlong plaintext for RSA-OAEP
+    var plaintext = new Uint8Array([95, 77, 186, 79, 50, 12, 12, 232, 118, 114, 90, 252, 229, 251, 210, 91, 248, 62, 90, 113, 37, 160, 140, 175, 231, 60, 62, 186, 196, 33, 119, 157, 249, 213, 93, 24, 12, 58, 233, 148, 38, 69, 225, 216, 47, 238, 140, 157, 41, 75, 60, 177, 160, 138, 153, 49, 32, 27, 60, 14, 129, 252, 71, 202, 207, 131, 21, 162, 175, 102, 50, 65, 19, 195, 182, 98, 48, 195, 70, 8, 196, 244, 89, 54, 52, 206, 2, 178, 103, 54, 34, 119, 240, 168, 64, 202, 116, 188, 61, 26, 98, 54, 149, 44, 94, 215, 170, 248, 168, 254, 203, 221, 250, 117, 132, 230, 151, 140, 234, 93, 42, 91, 159, 183, 241, 180, 140, 139, 11, 229, 138, 48, 82, 2, 117, 77, 131, 118, 16, 115, 116, 121, 60, 240, 38, 170, 238, 83, 0, 114, 125, 131, 108, 215, 30, 113, 179, 69, 221, 178, 228, 68, 70, 255, 197, 185, 1, 99, 84, 19, 137, 13, 145, 14, 163, 128, 152, 74, 144, 25, 16, 49, 50, 63, 22, 219, 204, 157, 107, 225, 104, 184, 72, 133, 56, 76, 160, 62, 18, 96, 10, 193, 194, 72, 2, 138, 243, 114, 108, 201,
  52, 99, 136, 46, 168, 192, 42, 171]);
+
+    var ciphertext = {
+        &quot;sha-1, no label&quot;: new Uint8Array([144, 30, 240, 156, 187, 254, 154, 73, 57, 185, 169, 196, 60, 207, 34, 51, 158, 21, 117, 247, 199, 67, 36, 73, 64, 117, 193, 146, 196, 11, 104, 153, 110, 176, 224, 77, 123, 21, 23, 116, 255, 247, 192, 11, 102, 23, 74, 36, 159, 195, 209, 166, 18, 60, 112, 166, 111, 214, 27, 103, 203, 84, 246, 131, 254, 1, 4, 158, 74, 68, 165, 147, 126, 53, 202, 225, 183, 61, 206, 18, 174, 160, 156, 208, 28, 76, 72, 144, 15, 175, 221, 117, 58, 196, 1, 86, 96, 118, 185, 184, 99, 128, 124, 241, 65, 166, 48, 68, 134, 94, 12, 188, 66, 185, 149, 251, 99, 159, 233, 153, 78, 148, 192, 227, 129, 64, 74, 225, 181, 84, 205, 178, 117, 21, 240, 151, 152, 220, 90, 7, 166, 11, 22, 43, 241, 47, 140, 239, 124, 225, 102, 49, 77, 148, 45, 128, 254, 67, 208, 223, 31, 176, 215, 233, 81, 78, 247, 41, 220, 108, 132, 85, 131, 247, 74, 178, 195, 109, 150, 132, 212, 59, 113, 150, 42, 24, 255, 14, 43, 19, 206, 116, 245, 55, 251, 58, 11, 0, 237, 227, 41, 231, 124, 17, 
 144, 10, 7, 14, 32, 248, 109, 192, 124, 172, 181, 111, 120, 33, 208, 36, 146, 52, 16, 108, 110, 11, 77, 218, 130, 224, 254, 189, 178, 2, 239, 12, 123, 16, 213, 96, 240, 186, 253, 199, 143, 6, 36, 24, 87, 131, 181, 34, 131, 202, 20, 161]),
+        &quot;sha-256, no label&quot;: new Uint8Array([5, 49, 234, 235, 75, 140, 239, 142, 183, 125, 215, 54, 208, 150, 182, 220, 232, 64, 209, 100, 233, 117, 31, 134, 168, 213, 206, 208, 153, 153, 80, 111, 250, 240, 0, 235, 97, 83, 247, 69, 111, 49, 26, 233, 158, 71, 241, 32, 113, 80, 235, 151, 242, 152, 45, 183, 115, 190, 158, 153, 14, 138, 18, 152, 90, 95, 17, 90, 249, 6, 239, 12, 135, 14, 239, 60, 159, 202, 28, 91, 77, 94, 153, 4, 153, 182, 125, 0, 148, 173, 175, 141, 235, 223, 154, 93, 114, 51, 91, 84, 179, 209, 202, 38, 234, 9, 87, 214, 62, 6, 76, 233, 105, 213, 46, 83, 189, 96, 92, 143, 169, 50, 13, 158, 171, 226, 57, 238, 244, 112, 153, 85, 92, 25, 77, 27, 184, 223, 239, 254, 173, 107, 79, 215, 248, 242, 137, 144, 53, 92, 200, 238, 34, 163, 108, 72, 103, 240, 172, 234, 215, 244, 165, 2, 95, 21, 23, 247, 82, 167, 232, 192, 147, 83, 61, 12, 214, 89, 173, 96, 167, 220, 5, 4, 66, 32, 1, 152, 135, 1, 100, 55, 220, 201, 76, 111, 158, 130, 2, 176, 59, 201, 85, 235, 44, 121,
  13, 63, 183, 199, 231, 126, 38, 18, 255, 165, 33, 218, 244, 103, 246, 64, 167, 73, 233, 225, 25, 21, 116, 190, 118, 226, 213, 92, 60, 254, 122, 147, 85, 26, 124, 40, 221, 178, 186, 107, 38, 195, 58, 48, 194, 55, 28, 216, 151, 77]),
+        &quot;sha-384, no label&quot;: new Uint8Array([12, 35, 146, 227, 15, 146, 241, 244, 228, 172, 209, 180, 166, 253, 153, 249, 131, 198, 29, 202, 243, 155, 221, 222, 71, 178, 158, 173, 58, 221, 16, 74, 122, 134, 223, 31, 112, 153, 243, 104, 60, 101, 175, 254, 50, 157, 43, 202, 185, 80, 53, 236, 150, 193, 61, 171, 154, 12, 180, 185, 89, 96, 254, 224, 138, 165, 131, 85, 102, 161, 181, 125, 223, 84, 90, 201, 80, 80, 145, 52, 206, 208, 2, 115, 158, 166, 255, 62, 61, 228, 132, 31, 159, 169, 6, 22, 96, 236, 241, 5, 51, 233, 245, 12, 165, 22, 79, 50, 73, 68, 204, 123, 142, 58, 236, 105, 152, 163, 102, 249, 12, 250, 238, 121, 119, 101, 26, 13, 30, 141, 25, 75, 205, 28, 42, 0, 135, 41, 170, 1, 26, 157, 13, 140, 162, 113, 249, 142, 1, 91, 244, 102, 188, 217, 156, 217, 118, 134, 181, 146, 246, 111, 177, 54, 159, 84, 163, 88, 147, 122, 188, 249, 23, 223, 111, 57, 186, 220, 111, 95, 246, 48, 199, 172, 115, 185, 47, 173, 186, 221, 12, 41, 252, 224, 76, 167, 214, 42, 171, 82, 178, 100
 , 229, 162, 130, 188, 191, 2, 114, 28, 17, 158, 40, 233, 66, 108, 217, 150, 179, 121, 25, 115, 216, 162, 172, 244, 58, 44, 47, 103, 255, 136, 76, 26, 119, 184, 63, 195, 38, 140, 100, 12, 171, 65, 67, 54, 195, 31, 122, 105, 119, 228, 149, 16, 49, 212]),
+        &quot;sha-512, no label&quot;: new Uint8Array([6, 38, 211, 70, 213, 37, 49, 19, 221, 192, 248, 206, 209, 145, 141, 136, 235, 240, 8, 105, 248, 128, 175, 137, 197, 230, 123, 179, 121, 75, 181, 138, 155, 246, 25, 229, 165, 89, 9, 65, 143, 108, 126, 20, 168, 88, 160, 197, 48, 66, 117, 2, 219, 122, 254, 96, 36, 147, 170, 111, 123, 168, 57, 151, 25, 139, 10, 233, 125, 219, 141, 58, 125, 174, 89, 38, 220, 25, 15, 5, 135, 69, 33, 5, 10, 49, 28, 253, 148, 251, 213, 53, 223, 8, 184, 64, 185, 94, 249, 211, 64, 53, 131, 136, 32, 2, 163, 61, 76, 9, 162, 189, 80, 71, 109, 237, 147, 9, 11, 147, 61, 254, 1, 185, 208, 228, 44, 219, 17, 163, 239, 184, 212, 197, 229, 210, 35, 236, 4, 117, 37, 187, 169, 26, 248, 95, 160, 165, 252, 21, 102, 253, 73, 115, 145, 124, 88, 143, 121, 128, 236, 70, 144, 101, 181, 54, 179, 64, 57, 232, 153, 72, 158, 96, 241, 79, 255, 90, 67, 16, 110, 43, 234, 153, 20, 57, 75, 83, 23, 184, 216, 25, 215, 52, 9, 241, 114, 21, 223, 184, 177, 247, 66, 98, 13, 15, 17
 5, 204, 82, 81, 205, 22, 15, 92, 28, 99, 186, 234, 241, 33, 37, 210, 15, 8, 197, 30, 208, 97, 7, 42, 51, 173, 213, 171, 59, 154, 71, 53, 78, 88, 244, 50, 157, 33, 111, 143, 185, 61, 91, 118, 237, 245, 93, 91, 156, 36]),
+        &quot;sha-1, with label&quot;: new Uint8Array([69, 12, 147, 43, 219, 95, 34, 61, 29, 64, 218, 190, 133, 69, 125, 35, 8, 73, 73, 154, 87, 194, 91, 201, 130, 111, 243, 86, 90, 124, 254, 130, 187, 133, 158, 32, 159, 234, 150, 98, 91, 246, 120, 166, 57, 233, 98, 7, 160, 58, 125, 113, 53, 79, 2, 202, 208, 104, 123, 195, 27, 84, 250, 98, 8, 169, 83, 207, 94, 31, 97, 31, 81, 0, 247, 153, 208, 99, 64, 185, 244, 213, 194, 62, 200, 171, 78, 245, 10, 62, 144, 176, 206, 94, 104, 172, 45, 57, 114, 196, 243, 166, 34, 67, 137, 41, 77, 6, 32, 225, 9, 234, 183, 32, 38, 40, 26, 93, 230, 191, 27, 192, 183, 67, 224, 156, 64, 189, 36, 27, 216, 57, 58, 164, 48, 164, 74, 218, 167, 196, 208, 221, 79, 102, 118, 23, 123, 26, 227, 53, 185, 196, 14, 233, 154, 6, 140, 233, 204, 153, 109, 163, 164, 226, 170, 207, 79, 123, 26, 188, 129, 124, 98, 82, 255, 95, 142, 71, 26, 5, 215, 198, 129, 179, 110, 130, 251, 222, 140, 210, 226, 37, 200, 117, 100, 172, 26, 138, 97, 11, 87, 161, 104, 210, 68, 117, 4
 6, 87, 74, 250, 152, 86, 194, 42, 117, 122, 254, 235, 202, 150, 249, 63, 110, 109, 23, 197, 32, 81, 89, 39, 217, 156, 163, 78, 237, 253, 25, 188, 227, 31, 35, 174, 190, 21, 157, 160, 37, 60, 39, 193, 11, 92, 15, 251, 125, 151]),
+        &quot;sha-256, with label&quot;: new Uint8Array([180, 212, 109, 8, 118, 130, 24, 5, 96, 121, 113, 102, 114, 157, 149, 31, 234, 5, 95, 138, 184, 10, 16, 249, 49, 78, 85, 222, 225, 47, 172, 108, 33, 36, 206, 47, 211, 159, 202, 241, 52, 172, 221, 28, 99, 1, 176, 51, 82, 146, 190, 137, 163, 202, 212, 74, 150, 204, 58, 26, 43, 54, 135, 91, 246, 201, 59, 106, 181, 9, 10, 118, 191, 106, 122, 102, 175, 114, 2, 182, 146, 169, 55, 124, 84, 187, 254, 237, 225, 252, 32, 197, 79, 97, 219, 250, 54, 81, 52, 121, 146, 194, 13, 196, 88, 212, 7, 146, 237, 232, 31, 113, 215, 200, 42, 158, 239, 180, 51, 152, 214, 145, 106, 11, 115, 160, 21, 71, 171, 190, 45, 25, 229, 19, 130, 210, 52, 58, 14, 55, 82, 250, 215, 193, 110, 178, 143, 101, 163, 63, 149, 216, 176, 163, 145, 66, 239, 62, 204, 195, 102, 14, 157, 2, 155, 114, 230, 225, 55, 121, 167, 172, 182, 187, 75, 149, 49, 213, 104, 144, 202, 230, 111, 125, 119, 236, 213, 155, 131, 122, 43, 55, 245, 183, 60, 140, 103, 88, 45, 84, 157, 247, 6
 7, 243, 169, 102, 176, 225, 192, 181, 154, 252, 90, 95, 17, 161, 112, 96, 196, 105, 104, 55, 6, 92, 212, 18, 127, 85, 190, 12, 105, 123, 219, 110, 130, 111, 179, 32, 183, 81, 246, 240, 135, 59, 5, 210, 173, 15, 102, 215, 87, 95, 136, 136, 238, 12]),
+        &quot;sha-384, with label&quot;: new Uint8Array([204, 60, 188, 131, 15, 114, 86, 246, 190, 155, 206, 62, 68, 249, 98, 63, 178, 144, 1, 244, 42, 248, 47, 9, 253, 8, 139, 186, 215, 180, 191, 92, 247, 19, 146, 242, 65, 195, 105, 211, 136, 84, 225, 236, 75, 202, 243, 148, 197, 68, 115, 51, 135, 65, 180, 62, 123, 91, 27, 67, 133, 14, 183, 65, 49, 1, 6, 94, 114, 249, 66, 36, 250, 189, 73, 218, 155, 213, 204, 240, 103, 185, 206, 189, 80, 60, 249, 1, 127, 190, 28, 196, 167, 67, 123, 222, 203, 124, 205, 153, 251, 242, 77, 151, 213, 215, 162, 189, 31, 28, 244, 1, 167, 58, 3, 169, 93, 143, 27, 40, 167, 86, 225, 85, 59, 93, 176, 82, 209, 224, 144, 21, 35, 252, 182, 97, 115, 200, 70, 117, 109, 240, 175, 102, 208, 100, 124, 230, 180, 232, 159, 77, 176, 75, 139, 58, 57, 254, 13, 183, 25, 27, 246, 182, 51, 171, 197, 226, 26, 7, 105, 225, 238, 147, 61, 68, 102, 97, 247, 149, 39, 8, 68, 70, 215, 220, 205, 74, 195, 183, 112, 152, 91, 70, 122, 163, 30, 66, 51, 52, 190, 204, 209, 223, 11
 1, 67, 44, 18, 14, 108, 156, 62, 165, 221, 6, 246, 148, 233, 148, 50, 217, 248, 44, 99, 233, 118, 235, 248, 78, 45, 202, 61, 211, 220, 193, 74, 6, 229, 203, 212, 114, 116, 242, 214, 85, 165, 199, 114, 125, 53, 5, 87, 238, 208, 145, 184]),
+        &quot;sha-512, with label&quot;: new Uint8Array([134, 151, 181, 94, 239, 91, 13, 83, 17, 57, 138, 21, 242, 206, 24, 86, 184, 239, 238, 57, 231, 116, 113, 139, 12, 128, 104, 100, 147, 57, 228, 183, 167, 225, 41, 180, 247, 133, 141, 0, 121, 193, 235, 168, 184, 248, 107, 34, 34, 233, 97, 215, 247, 240, 20, 245, 14, 0, 167, 17, 235, 204, 81, 97, 52, 81, 9, 136, 91, 59, 122, 200, 249, 74, 63, 68, 10, 18, 162, 243, 10, 190, 118, 60, 24, 74, 231, 92, 98, 179, 221, 150, 5, 66, 78, 93, 200, 212, 29, 76, 50, 246, 190, 84, 7, 245, 176, 148, 97, 5, 16, 22, 222, 173, 165, 200, 169, 93, 58, 8, 123, 229, 124, 220, 66, 123, 34, 69, 49, 33, 25, 107, 32, 250, 98, 61, 41, 222, 108, 112, 37, 42, 178, 163, 81, 157, 28, 160, 3, 121, 88, 10, 249, 25, 25, 22, 66, 0, 36, 187, 176, 199, 154, 122, 138, 43, 72, 217, 90, 43, 119, 50, 210, 166, 202, 2, 121, 172, 24, 172, 51, 74, 161, 45, 107, 150, 187, 89, 9, 89, 183, 233, 169, 149, 78, 145, 228, 156, 138, 215, 232, 219, 33, 33, 224, 178, 174, 16
 , 6, 72, 185, 214, 34, 204, 159, 161, 154, 11, 151, 142, 39, 244, 74, 75, 243, 191, 123, 231, 32, 54, 118, 235, 12, 19, 200, 165, 252, 161, 87, 46, 99, 51, 248, 146, 180, 122, 44, 210, 103, 237, 169, 50, 28, 210, 121, 136])
+    };
+
+    var passing = [
+        {
+            name: &quot;RSA-OAEP with SHA-1 and no label&quot;,
+            publicKeyBuffer: spki,
+            publicKeyFormat: &quot;spki&quot;,
+            privateKey: null,
+            privateKeyBuffer: pkcs8,
+            privateKeyFormat: &quot;pkcs8&quot;,
+            publicKey: null,
+            algorithm: {name: &quot;RSA-OAEP&quot;},
+            hash: &quot;SHA-1&quot;,
+            plaintext: plaintext.slice(0, 214),
+            ciphertext: ciphertext[&quot;sha-1, no label&quot;]
+        },
+        {
+            name: &quot;RSA-OAEP with SHA-256 and no label&quot;,
+            publicKeyBuffer: spki,
+            publicKeyFormat: &quot;spki&quot;,
+            privateKey: null,
+            privateKeyBuffer: pkcs8,
+            privateKeyFormat: &quot;pkcs8&quot;,
+            publicKey: null,
+            algorithm: {name: &quot;RSA-OAEP&quot;},
+            hash: &quot;SHA-256&quot;,
+            plaintext: plaintext.slice(0, 190),
+            ciphertext: ciphertext[&quot;sha-256, no label&quot;]
+        },
+        {
+            name: &quot;RSA-OAEP with SHA-384 and no label&quot;,
+            publicKeyBuffer: spki,
+            publicKeyFormat: &quot;spki&quot;,
+            privateKey: null,
+            privateKeyBuffer: pkcs8,
+            privateKeyFormat: &quot;pkcs8&quot;,
+            publicKey: null,
+            algorithm: {name: &quot;RSA-OAEP&quot;},
+            hash: &quot;SHA-384&quot;,
+            plaintext: plaintext.slice(0, 158),
+            ciphertext: ciphertext[&quot;sha-384, no label&quot;]
+        },
+        {
+            name: &quot;RSA-OAEP with SHA-512 and no label&quot;,
+            publicKeyBuffer: spki,
+            publicKeyFormat: &quot;spki&quot;,
+            privateKey: null,
+            privateKeyBuffer: pkcs8,
+            privateKeyFormat: &quot;pkcs8&quot;,
+            publicKey: null,
+            algorithm: {name: &quot;RSA-OAEP&quot;},
+            hash: &quot;SHA-512&quot;,
+            plaintext: plaintext.slice(0, 126),
+            ciphertext: ciphertext[&quot;sha-512, no label&quot;]
+        },
+        {
+            name: &quot;RSA-OAEP with SHA-1 and empty label&quot;,
+            publicKeyBuffer: spki,
+            publicKeyFormat: &quot;spki&quot;,
+            privateKey: null,
+            privateKeyBuffer: pkcs8,
+            privateKeyFormat: &quot;pkcs8&quot;,
+            publicKey: null,
+            algorithm: {name: &quot;RSA-OAEP&quot;, label: new Uint8Array([])},
+            hash: &quot;SHA-1&quot;,
+            plaintext: plaintext.slice(0, 214),
+            ciphertext: ciphertext[&quot;sha-1, no label&quot;]
+        },
+        {
+            name: &quot;RSA-OAEP with SHA-256 and empty label&quot;,
+            publicKeyBuffer: spki,
+            publicKeyFormat: &quot;spki&quot;,
+            privateKey: null,
+            privateKeyBuffer: pkcs8,
+            privateKeyFormat: &quot;pkcs8&quot;,
+            publicKey: null,
+            algorithm: {name: &quot;RSA-OAEP&quot;, label: new Uint8Array([])},
+            hash: &quot;SHA-256&quot;,
+            plaintext: plaintext.slice(0, 190),
+            ciphertext: ciphertext[&quot;sha-256, no label&quot;]
+        },
+        {
+            name: &quot;RSA-OAEP with SHA-384 and empty label&quot;,
+            publicKeyBuffer: spki,
+            publicKeyFormat: &quot;spki&quot;,
+            privateKey: null,
+            privateKeyBuffer: pkcs8,
+            privateKeyFormat: &quot;pkcs8&quot;,
+            publicKey: null,
+            algorithm: {name: &quot;RSA-OAEP&quot;, label: new Uint8Array([])},
+            hash: &quot;SHA-384&quot;,
+            plaintext: plaintext.slice(0, 158),
+            ciphertext: ciphertext[&quot;sha-384, no label&quot;]
+        },
+        {
+            name: &quot;RSA-OAEP with SHA-512 and empty label&quot;,
+            publicKeyBuffer: spki,
+            publicKeyFormat: &quot;spki&quot;,
+            privateKey: null,
+            privateKeyBuffer: pkcs8,
+            privateKeyFormat: &quot;pkcs8&quot;,
+            publicKey: null,
+            algorithm: {name: &quot;RSA-OAEP&quot;, label: new Uint8Array([])},
+            hash: &quot;SHA-512&quot;,
+            plaintext: plaintext.slice(0, 126),
+            ciphertext: ciphertext[&quot;sha-512, no label&quot;]
+        },
+        {
+            name: &quot;RSA-OAEP with SHA-1 and a label&quot;,
+            publicKeyBuffer: spki,
+            publicKeyFormat: &quot;spki&quot;,
+            privateKey: null,
+            privateKeyBuffer: pkcs8,
+            privateKeyFormat: &quot;pkcs8&quot;,
+            publicKey: null,
+            algorithm: {name: &quot;RSA-OAEP&quot;, label: label},
+            hash: &quot;SHA-1&quot;,
+            plaintext: plaintext.slice(0, 214),
+            ciphertext: ciphertext[&quot;sha-1, with label&quot;]
+        },
+        {
+            name: &quot;RSA-OAEP with SHA-256 and a label&quot;,
+            publicKeyBuffer: spki,
+            publicKeyFormat: &quot;spki&quot;,
+            privateKey: null,
+            privateKeyBuffer: pkcs8,
+            privateKeyFormat: &quot;pkcs8&quot;,
+            publicKey: null,
+            algorithm: {name: &quot;RSA-OAEP&quot;, label: label},
+            hash: &quot;SHA-256&quot;,
+            plaintext: plaintext.slice(0, 190),
+            ciphertext: ciphertext[&quot;sha-256, with label&quot;]
+        },
+        {
+            name: &quot;RSA-OAEP with SHA-384 and a label&quot;,
+            publicKeyBuffer: spki,
+            publicKeyFormat: &quot;spki&quot;,
+            privateKey: null,
+            privateKeyBuffer: pkcs8,
+            privateKeyFormat: &quot;pkcs8&quot;,
+            publicKey: null,
+            algorithm: {name: &quot;RSA-OAEP&quot;, label: label},
+            hash: &quot;SHA-384&quot;,
+            plaintext: plaintext.slice(0, 158),
+            ciphertext: ciphertext[&quot;sha-384, with label&quot;]
+        },
+        {
+            name: &quot;RSA-OAEP with SHA-512 and a label&quot;,
+            publicKeyBuffer: spki,
+            publicKeyFormat: &quot;spki&quot;,
+            privateKey: null,
+            privateKeyBuffer: pkcs8,
+            privateKeyFormat: &quot;pkcs8&quot;,
+            publicKey: null,
+            algorithm: {name: &quot;RSA-OAEP&quot;, label: label},
+            hash: &quot;SHA-512&quot;,
+            plaintext: plaintext.slice(0, 126),
+            ciphertext: ciphertext[&quot;sha-512, with label&quot;]
+        }
+    ];
+
+    var failing = [];
+
+    return {passing: passing, failing: failing};
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_aes_cbcexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 285: TypeError: undefined is not an object (evaluating 'subtle.importKey')
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_aes_cbchtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_cbc.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_cbc.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_cbc.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: encrypt() Using AES-CBC&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#SubtleCrypto-method-encrypt&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;aes_cbc_vectors.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;aes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;encrypt Tests for AES-CBC&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test();
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_aes_ctrexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 285: TypeError: undefined is not an object (evaluating 'subtle.importKey')
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_aes_ctrhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_ctr.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_ctr.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_ctr.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: encrypt() Using AES-CTR&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#SubtleCrypto-method-encrypt&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;aes_ctr_vectors.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;aes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;encrypt Tests for AES-CTR&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test();
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_aes_gcmexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 285: TypeError: undefined is not an object (evaluating 'subtle.importKey')
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_aes_gcmhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_gcm.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_gcm.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_gcm.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: encrypt() Using AES-GCM&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#SubtleCrypto-method-encrypt&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;aes_gcm_vectors.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;aes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;encrypt Tests for AES-GCM&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test();
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_rsa_oaepexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 313: TypeError: undefined is not an object (evaluating 'subtle.importKey')
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decrypttest_rsa_oaephtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: encrypt() Using RSA-OAEP&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#SubtleCrypto-method-encrypt&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;rsa_vectors.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;rsa.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;encrypt Tests for RSA-OAEP&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test();
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIencrypt_decryptw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/w3c-import.log (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/w3c-import.log        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+        https://github.com/w3c/csswg-test
+        https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes.js
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_cbc.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_cbc_vectors.js
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_ctr.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_ctr_vectors.js
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_gcm.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/aes_gcm_vectors.js
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa.js
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/rsa_vectors.js
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_cbc.html
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_ctr.html
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_aes_gcm.html
+/LayoutTests/imported/w3c/WebCryptoAPI/encrypt_decrypt/test_rsa_oaep.html
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailuresjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,216 @@
</span><ins>+function run_test(algorithmNames) {
+    var subtle = crypto.subtle; // Change to test prefixed implementations
+
+    setup({explicit_timeout: true});
+
+// These tests check that generateKey throws an error, and that
+// the error is of the right type, for a wide set of incorrect parameters.
+//
+// Error testing occurs by setting the parameter that should trigger the
+// error to an invalid value, then combining that with all valid
+// parameters that should be checked earlier by generateKey, and all
+// valid and invalid parameters that should be checked later by
+// generateKey.
+//
+// There are a lot of combinations of possible parameters for both
+// success and failure modes, resulting in a very large number of tests
+// performed.
+
+
+// Setup: define the correct behaviors that should be sought, and create
+// helper functions that generate all possible test parameters for
+// different situations.
+
+    var allTestVectors = [ // Parameters that should work for generateKey
+        {name: &quot;AES-CTR&quot;,  resultType: CryptoKey, usages: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;], mandatoryUsages: []},
+        {name: &quot;AES-CBC&quot;,  resultType: CryptoKey, usages: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;], mandatoryUsages: []},
+        {name: &quot;AES-GCM&quot;,  resultType: CryptoKey, usages: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;], mandatoryUsages: []},
+        {name: &quot;AES-KW&quot;,   resultType: CryptoKey, usages: [&quot;wrapKey&quot;, &quot;unwrapKey&quot;], mandatoryUsages: []},
+        {name: &quot;HMAC&quot;,     resultType: CryptoKey, usages: [&quot;sign&quot;, &quot;verify&quot;], mandatoryUsages: []},
+        {name: &quot;RSASSA-PKCS1-v1_5&quot;, resultType: &quot;CryptoKeyPair&quot;, usages: [&quot;sign&quot;, &quot;verify&quot;], mandatoryUsages: [&quot;sign&quot;]},
+        {name: &quot;RSA-PSS&quot;,  resultType: &quot;CryptoKeyPair&quot;, usages: [&quot;sign&quot;, &quot;verify&quot;], mandatoryUsages: [&quot;sign&quot;]},
+        {name: &quot;RSA-OAEP&quot;, resultType: &quot;CryptoKeyPair&quot;, usages: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;], mandatoryUsages: [&quot;decrypt&quot;, &quot;unwrapKey&quot;]},
+        {name: &quot;ECDSA&quot;,    resultType: &quot;CryptoKeyPair&quot;, usages: [&quot;sign&quot;, &quot;verify&quot;], mandatoryUsages: [&quot;sign&quot;]},
+        {name: &quot;ECDH&quot;,     resultType: &quot;CryptoKeyPair&quot;, usages: [&quot;deriveKey&quot;, &quot;deriveBits&quot;], mandatoryUsages: [&quot;deriveKey&quot;, &quot;deriveBits&quot;]}
+    ];
+
+    var testVectors = [];
+    if (algorithmNames &amp;&amp; !Array.isArray(algorithmNames)) {
+        algorithmNames = [algorithmNames];
+    };
+    allTestVectors.forEach(function(vector) {
+        if (!algorithmNames || algorithmNames.includes(vector.name)) {
+            testVectors.push(vector);
+        }
+    });
+
+
+    function parameterString(algorithm, extractable, usages) {
+        if (typeof algorithm !== &quot;object&quot; &amp;&amp; typeof algorithm !== &quot;string&quot;) {
+            alert(algorithm);
+        }
+
+        var result = &quot;(&quot; +
+                        objectToString(algorithm) + &quot;, &quot; +
+                        objectToString(extractable) + &quot;, &quot; +
+                        objectToString(usages) +
+                     &quot;)&quot;;
+
+        return result;
+    }
+
+    // Test that a given combination of parameters results in an error,
+    // AND that it is the correct kind of error.
+    //
+    // Expected error is either a number, tested against the error code,
+    // or a string, tested against the error name.
+    function testError(algorithm, extractable, usages, expectedError, testTag) {
+        promise_test(function(test) {
+            return crypto.subtle.generateKey(algorithm, extractable, usages)
+            .then(function(result) {
+                assert_unreached(&quot;Operation succeeded, but should not have&quot;);
+            }, function(err) {
+                if (typeof expectedError === &quot;number&quot;) {
+                    assert_equals(err.code, expectedError, testTag + &quot; not supported&quot;);
+                } else {
+                    assert_equals(err.name, expectedError, testTag + &quot; not supported&quot;);
+                }
+            });
+        }, testTag + &quot;: generateKey&quot; + parameterString(algorithm, extractable, usages));
+    }
+
+
+    // Given an algorithm name, create several invalid parameters.
+    function badAlgorithmPropertySpecifiersFor(algorithmName) {
+        var results = [];
+
+        if (algorithmName.toUpperCase().substring(0, 3) === &quot;AES&quot;) {
+            // Specifier properties are name and length
+            [64, 127, 129, 255, 257, 512].forEach(function(length) {
+                results.push({name: algorithmName, length: length});
+            });
+        } else if (algorithmName.toUpperCase().substring(0, 3) === &quot;RSA&quot;) {
+            [new Uint8Array([1]), new Uint8Array([1,0,0])].forEach(function(publicExponent) {
+                results.push({name: algorithmName, hash: &quot;SHA-256&quot;, modulusLength: 1024, publicExponent: publicExponent});
+            });
+        } else if (algorithmName.toUpperCase().substring(0, 2) === &quot;EC&quot;) {
+            [&quot;P-512&quot;, &quot;Curve25519&quot;].forEach(function(curveName) {
+                results.push({name: algorithmName, namedCurve: curveName});
+            });
+        }
+
+        return results;
+    }
+
+
+    // Don't create an exhaustive list of all invalid usages,
+    // because there would usually be nearly 2**8 of them,
+    // way too many to test. Instead, create every singleton
+    // of an illegal usage, and &quot;poison&quot; every valid usage
+    // with an illegal one.
+    function invalidUsages(validUsages, mandatoryUsages) {
+        var results = [];
+
+        var illegalUsages = [];
+        [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;sign&quot;, &quot;verify&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;, &quot;deriveKey&quot;, &quot;deriveBits&quot;].forEach(function(usage) {
+            if (!validUsages.includes(usage)) {
+                illegalUsages.push(usage);
+            }
+        });
+
+        var goodUsageCombinations = allValidUsages(validUsages, false, mandatoryUsages);
+
+        illegalUsages.forEach(function(illegalUsage) {
+            results.push([illegalUsage]);
+            goodUsageCombinations.forEach(function(usageCombination) {
+                results.push(usageCombination.concat([illegalUsage]));
+            });
+        });
+
+        return results;
+    }
+
+
+// Now test for properly handling errors
+// - Unsupported algorithm
+// - Bad usages for algorithm
+// - Bad key lengths
+
+    // Algorithm normalization should fail with &quot;Not supported&quot;
+    var badAlgorithmNames = [
+        &quot;AES&quot;,
+        {name: &quot;AES&quot;},
+        {name: &quot;AES&quot;, length: 128},
+        {name: &quot;AES-CMAC&quot;, length: 128},    // Removed after CR
+        {name: &quot;AES-CFB&quot;, length: 128},      // Removed after CR
+        {name: &quot;HMAC&quot;, hash: &quot;MD5&quot;},
+        {name: &quot;RSA&quot;, hash: &quot;SHA-256&quot;, modulusLength: 2048, publicExponent: new Uint8Array([1,0,1])},
+        {name: &quot;RSA-PSS&quot;, hash: &quot;SHA&quot;, modulusLength: 2048, publicExponent: new Uint8Array([1,0,1])},
+        {name: &quot;EC&quot;, namedCurve: &quot;P521&quot;}
+    ];
+
+
+    // Algorithm normalization failures should be found first
+    // - all other parameters can be good or bad, should fail
+    //   due to NotSupportedError.
+    badAlgorithmNames.forEach(function(algorithm) {
+        allValidUsages([&quot;decrypt&quot;, &quot;sign&quot;, &quot;deriveBits&quot;], true, []) // Small search space, shouldn't matter because should fail before used
+        .forEach(function(usages) {
+            [false, true, &quot;RED&quot;, 7].forEach(function(extractable){
+                testError(algorithm, extractable, usages, &quot;NotSupportedError&quot;, &quot;Bad algorithm&quot;);
+            });
+        });
+    });
+
+
+    // Algorithms normalize okay, but usages bad (though not empty).
+    // It shouldn't matter what other extractable is. Should fail
+    // due to SyntaxError
+    testVectors.forEach(function(vector) {
+        var name = vector.name;
+
+        allAlgorithmSpecifiersFor(name).forEach(function(algorithm) {
+            invalidUsages(vector.usages, vector.mandatoryUsages).forEach(function(usages) {
+                [true].forEach(function(extractable) {
+                    testError(algorithm, extractable, usages, &quot;SyntaxError&quot;, &quot;Bad usages&quot;);
+                });
+            });
+        });
+    });
+
+
+    // Other algorithm properties should be checked next, so try good
+    // algorithm names and usages, but bad algorithm properties next.
+    // - Special case: normally bad usage [] isn't checked until after properties,
+    //   so it's included in this test case. It should NOT cause an error.
+    testVectors.forEach(function(vector) {
+        var name = vector.name;
+        badAlgorithmPropertySpecifiersFor(name).forEach(function(algorithm) {
+            allValidUsages(vector.usages, true, vector.mandatoryUsages)
+            .forEach(function(usages) {
+                [false, true].forEach(function(extractable) {
+                    if (name.substring(0,2) === &quot;EC&quot;) {
+                        testError(algorithm, extractable, usages, &quot;NotSupportedError&quot;, &quot;Bad algorithm property&quot;);
+                    } else {
+                        testError(algorithm, extractable, usages, &quot;OperationError&quot;, &quot;Bad algorithm property&quot;);
+                    }
+                });
+            });
+        });
+    });
+
+
+    // The last thing that should be checked is an empty usages (for secret keys).
+    testVectors.forEach(function(vector) {
+        var name = vector.name;
+
+        allAlgorithmSpecifiersFor(name).forEach(function(algorithm) {
+            var usages = [];
+            [false, true].forEach(function(extractable) {
+                testError(algorithm, extractable, usages, &quot;SyntaxError&quot;, &quot;Empty usages&quot;);
+            });
+        });
+    });
+
+
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailuresworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;failures.js&quot;);
+run_test();
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_AESCBCworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-CBC.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-CBC.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-CBC.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;failures.js&quot;);
+run_test([&quot;AES-CBC&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_AESCTRworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-CTR.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-CTR.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-CTR.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;failures.js&quot;);
+run_test([&quot;AES-CTR&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_AESGCMworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-GCM.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-GCM.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-GCM.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;failures.js&quot;);
+run_test([&quot;AES-GCM&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_AESKWworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-KW.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-KW.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-KW.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;failures.js&quot;);
+run_test([&quot;AES-KW&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_ECDHworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_ECDH.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_ECDH.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_ECDH.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;failures.js&quot;);
+run_test([&quot;ECDH&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_ECDSAworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_ECDSA.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_ECDSA.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_ECDSA.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;failures.js&quot;);
+run_test([&quot;ECDSA&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_HMACworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_HMAC.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_HMAC.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_HMAC.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;failures.js&quot;);
+run_test([&quot;HMAC&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_RSAOAEPworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSA-OAEP.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSA-OAEP.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSA-OAEP.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;failures.js&quot;);
+run_test([&quot;RSA-OAEP&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_RSAPSSworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSA-PSS.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSA-PSS.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSA-PSS.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;failures.js&quot;);
+run_test([&quot;RSA-PSS&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyfailures_RSASSAPKCS1v1_5workerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSASSA-PKCS1-v1_5.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSASSA-PKCS1-v1_5.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSASSA-PKCS1-v1_5.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;failures.js&quot;);
+run_test([&quot;RSASSA-PKCS1-v1_5&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccessesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+
+function run_test(algorithmNames) {
+    var subtle = crypto.subtle; // Change to test prefixed implementations
+
+    setup({explicit_timeout: true});
+
+// These tests check that generateKey successfully creates keys
+// when provided any of a wide set of correct parameters.
+//
+// There are a lot of combinations of possible parameters,
+// resulting in a very large number of tests
+// performed.
+
+
+// Setup: define the correct behaviors that should be sought, and create
+// helper functions that generate all possible test parameters for
+// different situations.
+
+    var allTestVectors = [ // Parameters that should work for generateKey
+        {name: &quot;AES-CTR&quot;,  resultType: CryptoKey, usages: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;], mandatoryUsages: []},
+        {name: &quot;AES-CBC&quot;,  resultType: CryptoKey, usages: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;], mandatoryUsages: []},
+        {name: &quot;AES-GCM&quot;,  resultType: CryptoKey, usages: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;], mandatoryUsages: []},
+        {name: &quot;AES-KW&quot;,   resultType: CryptoKey, usages: [&quot;wrapKey&quot;, &quot;unwrapKey&quot;], mandatoryUsages: []},
+        {name: &quot;HMAC&quot;,     resultType: CryptoKey, usages: [&quot;sign&quot;, &quot;verify&quot;], mandatoryUsages: []},
+        {name: &quot;RSASSA-PKCS1-v1_5&quot;, resultType: &quot;CryptoKeyPair&quot;, usages: [&quot;sign&quot;, &quot;verify&quot;], mandatoryUsages: [&quot;sign&quot;]},
+        {name: &quot;RSA-PSS&quot;,  resultType: &quot;CryptoKeyPair&quot;, usages: [&quot;sign&quot;, &quot;verify&quot;], mandatoryUsages: [&quot;sign&quot;]},
+        {name: &quot;RSA-OAEP&quot;, resultType: &quot;CryptoKeyPair&quot;, usages: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;], mandatoryUsages: [&quot;decrypt&quot;, &quot;unwrapKey&quot;]},
+        {name: &quot;ECDSA&quot;,    resultType: &quot;CryptoKeyPair&quot;, usages: [&quot;sign&quot;, &quot;verify&quot;], mandatoryUsages: [&quot;sign&quot;]},
+        {name: &quot;ECDH&quot;,     resultType: &quot;CryptoKeyPair&quot;, usages: [&quot;deriveKey&quot;, &quot;deriveBits&quot;], mandatoryUsages: [&quot;deriveKey&quot;, &quot;deriveBits&quot;]}
+    ];
+
+    var testVectors = [];
+    if (algorithmNames &amp;&amp; !Array.isArray(algorithmNames)) {
+        algorithmNames = [algorithmNames];
+    };
+    allTestVectors.forEach(function(vector) {
+        if (!algorithmNames || algorithmNames.includes(vector.name)) {
+            testVectors.push(vector);
+        }
+    });
+
+    function parameterString(algorithm, extractable, usages) {
+        var result = &quot;(&quot; +
+                        objectToString(algorithm) + &quot;, &quot; +
+                        objectToString(extractable) + &quot;, &quot; +
+                        objectToString(usages) +
+                     &quot;)&quot;;
+
+        return result;
+    }
+
+    // Test that a given combination of parameters is successful
+    function testSuccess(algorithm, extractable, usages, resultType, testTag) {
+        // algorithm, extractable, and usages are the generateKey parameters
+        // resultType is the expected result, either the CryptoKey object or &quot;CryptoKeyPair&quot;
+        // testTag is a string to prepend to the test name.
+
+        promise_test(function(test) {
+            return subtle.generateKey(algorithm, extractable, usages)
+            .then(function(result) {
+                if (resultType === &quot;CryptoKeyPair&quot;) {
+                    assert_goodCryptoKey(result.privateKey, algorithm, extractable, usages, &quot;private&quot;);
+                    assert_goodCryptoKey(result.publicKey, algorithm, extractable, usages, &quot;public&quot;);
+                } else {
+                    assert_goodCryptoKey(result, algorithm, extractable, usages, &quot;secret&quot;);
+                }
+            }, function(err) {
+                assert_unreached(&quot;Threw an unexpected error: &quot; + err.toString());
+            });
+        }, testTag + &quot;: generateKey&quot; + parameterString(algorithm, extractable, usages));
+    }
+
+
+    // Test all valid sets of parameters for successful
+    // key generation.
+    testVectors.forEach(function(vector) {
+        allNameVariants(vector.name).forEach(function(name) {
+            allAlgorithmSpecifiersFor(name).forEach(function(algorithm) {
+                allValidUsages(vector.usages, false, vector.mandatoryUsages).forEach(function(usages) {
+                    [false, true].forEach(function(extractable) {
+                        testSuccess(algorithm, extractable, usages, vector.resultType, &quot;Success&quot;);
+                    });
+                });
+            });
+        });
+    });
+
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccessesworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;successes.js&quot;);
+
+run_test();
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_AESCBCworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-CBC.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-CBC.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-CBC.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;successes.js&quot;);
+
+run_test([&quot;AES-CBC&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_AESCTRworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-CTR.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-CTR.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-CTR.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;successes.js&quot;);
+
+run_test([&quot;AES-CTR&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_AESGCMworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-GCM.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-GCM.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-GCM.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;successes.js&quot;);
+
+run_test([&quot;AES-GCM&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_AESKWworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-KW.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-KW.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-KW.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;successes.js&quot;);
+
+run_test([&quot;AES-KW&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_ECDHworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_ECDH.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_ECDH.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_ECDH.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;successes.js&quot;);
+
+run_test([&quot;ECDH&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_ECDSAworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_ECDSA.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_ECDSA.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_ECDSA.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;successes.js&quot;);
+
+run_test([&quot;ECDSA&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_HMACworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_HMAC.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_HMAC.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_HMAC.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;successes.js&quot;);
+
+run_test([&quot;HMAC&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_RSAOAEPworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSA-OAEP.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSA-OAEP.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSA-OAEP.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;successes.js&quot;);
+
+run_test([&quot;RSA-OAEP&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_RSAPSSworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSA-PSS.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSA-PSS.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSA-PSS.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;successes.js&quot;);
+
+run_test([&quot;RSA-PSS&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeysuccesses_RSASSAPKCS1v1_5workerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSASSA-PKCS1-v1_5.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSASSA-PKCS1-v1_5.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSASSA-PKCS1-v1_5.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;successes.js&quot;);
+
+run_test([&quot;RSASSA-PKCS1-v1_5&quot;]);
+done();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_aescbcexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-cbc-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-cbc-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-cbc-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_aescbchtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-cbc.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-cbc.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-cbc.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test(&quot;AES-CBC&quot;);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_aesctrexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-ctr-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-ctr-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-ctr-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_aesctrhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-ctr.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-ctr.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-ctr.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test(&quot;AES-CTR&quot;);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failuresexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 25: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failureshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() for Failures&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;failures.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Bad Parameters&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test();
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESCBCexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CBC-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CBC-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CBC-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 25: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESCBChtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CBC.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CBC.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CBC.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() for Failures&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;failures.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Bad Parameters&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;AES-CBC&quot;]);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESCTRexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CTR-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CTR-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CTR-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 25: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESCTRhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CTR.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CTR.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CTR.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() for Failures&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;failures.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Bad Parameters&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;AES-CTR&quot;]);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESGCMexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-GCM-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-GCM-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-GCM-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 25: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESGCMhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-GCM.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-GCM.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-GCM.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() for Failures&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;failures.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Bad Parameters&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;AES-GCM&quot;]);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESKWexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-KW-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-KW-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-KW-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 25: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_AESKWhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-KW.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-KW.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-KW.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() for Failures&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;failures.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Bad Parameters&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;AES-KW&quot;]);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_ECDHexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDH-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDH-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDH-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 25: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_ECDHhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDH.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDH.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDH.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() for Failures&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;failures.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Bad Parameters&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;ECDH&quot;]);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_ECDSAexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDSA-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDSA-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDSA-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 25: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_ECDSAhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDSA.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDSA.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDSA.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() for Failures&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;failures.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Bad Parameters&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;ECDSA&quot;]);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_HMACexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_HMAC-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_HMAC-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_HMAC-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 25: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_HMAChtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_HMAC.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_HMAC.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_HMAC.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() for Failures&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;failures.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Bad Parameters&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;HMAC&quot;]);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_RSAOAEPexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-OAEP-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-OAEP-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-OAEP-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 25: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_RSAOAEPhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-OAEP.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-OAEP.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-OAEP.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() for Failures&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;failures.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Bad Parameters&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;RSA-OAEP&quot;]);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_RSAPSSexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-PSS-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-PSS-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-PSS-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 25: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_RSAPSShtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-PSS.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-PSS.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-PSS.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() for Failures&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;failures.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Bad Parameters&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;RSA-PSS&quot;]);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_RSASSAPKCS1v1_5expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 25: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_failures_RSASSAPKCS1v1_5html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() for Failures&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;failures.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Bad Parameters&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;RSASSA-PKCS1-v1_5&quot;]);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successeshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test();
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESCBCexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CBC-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CBC-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CBC-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESCBChtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CBC.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CBC.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CBC.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;AES-CBC&quot;]);
+&lt;/script&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESCTRexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CTR-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CTR-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CTR-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESCTRhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CTR.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CTR.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CTR.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;AES-CTR&quot;]);
+&lt;/script&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESGCMexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-GCM-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-GCM-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-GCM-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESGCMhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-GCM.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-GCM.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-GCM.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;AES-GCM&quot;]);
+&lt;/script&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESKWexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-KW-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-KW-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-KW-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_AESKWhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-KW.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-KW.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-KW.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;AES-KW&quot;]);
+&lt;/script&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_ECDHexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDH-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDH-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDH-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_ECDHhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDH.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDH.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDH.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;ECDH&quot;]);
+&lt;/script&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_ECDSAexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDSA-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDSA-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDSA-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_ECDSAhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDSA.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDSA.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDSA.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;ECDSA&quot;]);
+&lt;/script&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_HMACexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_HMAC-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_HMAC-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_HMAC-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_HMAChtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_HMAC.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_HMAC.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_HMAC.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;HMAC&quot;]);
+&lt;/script&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_RSAOAEPexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-OAEP-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-OAEP-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-OAEP-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_RSAOAEPhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-OAEP.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-OAEP.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-OAEP.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;RSA-OAEP&quot;]);
+&lt;/script&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_RSAPSSexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-PSS-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-PSS-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-PSS-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_RSAPSShtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-PSS.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-PSS.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-PSS.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;RSA-PSS&quot;]);
+&lt;/script&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_RSASSAPKCS1v1_5expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: CryptoKey
+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeytest_successes_RSASSAPKCS1v1_5html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([&quot;RSASSA-PKCS1-v1_5&quot;]);
+&lt;/script&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgenerateKeyw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/w3c-import.log (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/w3c-import.log        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+        https://github.com/w3c/csswg-test
+        https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-CBC.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-CTR.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-GCM.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_AES-KW.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_ECDH.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_ECDSA.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_HMAC.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSA-OAEP.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSA-PSS.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/failures_RSASSA-PKCS1-v1_5.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-CBC.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-CTR.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-GCM.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_AES-KW.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_ECDH.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_ECDSA.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_HMAC.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSA-OAEP.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSA-PSS.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/successes_RSASSA-PKCS1-v1_5.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-cbc.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_aes-ctr.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CBC.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-CTR.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-GCM.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_AES-KW.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDH.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_ECDSA.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_HMAC.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-OAEP.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSA-PSS.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CBC.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-CTR.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-GCM.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_AES-KW.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDH.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_ECDSA.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_HMAC.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-OAEP.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSA-PSS.html
+/LayoutTests/imported/w3c/WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5.html
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgetRandomValuesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/getRandomValues.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/getRandomValues.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/getRandomValues.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+function run_test() {
+    // Step 1.
+    test(function() {
+        assert_throws(&quot;TypeMismatchError&quot;, function() {
+            self.crypto.getRandomValues(new Float32Array(6))
+        }, &quot;Float32Array&quot;)
+        assert_throws(&quot;TypeMismatchError&quot;, function() {
+            self.crypto.getRandomValues(new Float64Array(6))
+        }, &quot;Float64Array&quot;)
+
+        assert_throws(&quot;TypeMismatchError&quot;, function() {
+            self.crypto.getRandomValues(new Float32Array(65537))
+        }, &quot;Float32Array (too long)&quot;)
+        assert_throws(&quot;TypeMismatchError&quot;, function() {
+            self.crypto.getRandomValues(new Float64Array(65537))
+        }, &quot;Float64Array (too long)&quot;)
+    }, &quot;Float arrays&quot;)
+
+    var arrays = {
+        'Int8Array': Int8Array,
+        'Int16Array': Int16Array,
+        'Int32Array': Int32Array,
+        'Uint8Array': Uint8Array,
+        'Uint8ClampedArray': Uint8ClampedArray,
+        'Uint16Array': Uint16Array,
+        'Uint32Array': Uint32Array,
+    };
+
+    test(function() {
+        for (var array in arrays) {
+            assert_equals(self.crypto.getRandomValues(new arrays[array](8)).constructor,
+                          arrays[array], &quot;crypto.getRandomValues(new &quot; + array + &quot;(8))&quot;)
+        }
+    }, &quot;Integer array&quot;)
+
+    test(function() {
+        for (var array in arrays) {
+            var maxlength = 65536 / (arrays[array].BYTES_PER_ELEMENT);
+            assert_throws(&quot;QuotaExceededError&quot;, function() {
+                self.crypto.getRandomValues(new arrays[array](maxlength + 1))
+            }, &quot;crypto.getRandomValues length over 65536&quot;)
+        }
+    }, &quot;Large length&quot;)
+
+    test(function() {
+        for (var array in arrays) {
+            assert_true(self.crypto.getRandomValues(new arrays[array](0)).length == 0)
+        }
+    }, &quot;Null arrays&quot;)
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIgetRandomValuesworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/getRandomValues.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/getRandomValues.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/getRandomValues.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;getRandomValues.js&quot;);
+run_test();
+done();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIidlharnessexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+FAIL: Timed out waiting for notifyDone to be called
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIidlharnesshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;IDL check of WebCrypto&lt;/title&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/webcrypto/Overview.html#crypto-interface&quot;&gt;
+
+&lt;script src=../../../resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=../../../resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script src=/resources/WebIDLParser.js&gt;&lt;/script&gt;
+&lt;script src=/resources/idlharness.js&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;h1 class=&quot;instructions&quot;&gt;Description&lt;/h1&gt;
+
+&lt;p class=&quot;instructions&quot;&gt;This test verifies that the implementations of the WebCrypto API match with its WebIDL definition.&lt;/p&gt;
+
+&lt;div id='log'&gt;&lt;/div&gt;
+
+&lt;script&gt;
+var file_input;
+setup(function() {
+    var idl_array = new IdlArray();
+
+    var request = new XMLHttpRequest();
+    request.open(&quot;GET&quot;, &quot;WebCryptoAPI.idl&quot;);
+    request.send();
+    request.onload = function() {
+        var idls = request.responseText;
+
+        idl_array.add_untested_idls(&quot;[PrimaryGlobal] interface Window { };&quot;);
+
+        idl_array.add_untested_idls(&quot;interface ArrayBuffer {};&quot;);
+        idl_array.add_untested_idls(&quot;interface ArrayBufferView {};&quot;);
+
+        idl_array.add_idls(idls);
+
+        idl_array.add_objects({&quot;Crypto&quot;:[&quot;crypto&quot;], &quot;SubtleCrypto&quot;:[&quot;crypto.subtle&quot;]});
+
+        idl_array.test();
+        done();
+  };
+}, {explicit_done: true});
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIidlharnessworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness.worker.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness.worker.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;/resources/WebIDLParser.js&quot;, &quot;/resources/idlharness.js&quot;);
+
+var request = new XMLHttpRequest();
+request.open(&quot;GET&quot;, &quot;WebCryptoAPI.idl&quot;);
+request.send();
+request.onload = function() {
+    var idl_array = new IdlArray();
+    var idls = request.responseText;
+
+    idl_array.add_untested_idls(&quot;[Global] interface Window { };&quot;);
+
+    idl_array.add_untested_idls(&quot;interface ArrayBuffer {};&quot;);
+    idl_array.add_untested_idls(&quot;interface ArrayBufferView {};&quot;);
+
+    idl_array.add_idls(idls);
+
+    idl_array.add_objects({&quot;Crypto&quot;:[&quot;crypto&quot;], &quot;SubtleCrypto&quot;:[&quot;crypto.subtle&quot;]});
+
+    idl_array.test();
+    done();
+};
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPItest_getRandomValuesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/test_getRandomValues-expected.txt (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/test_getRandomValues-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/test_getRandomValues-expected.txt        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+
+PASS Float arrays 
+PASS Integer array 
+PASS Large length 
+PASS Null arrays 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPItest_getRandomValueshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/test_getRandomValues.html (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/test_getRandomValues.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/test_getRandomValues.html        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;WebCryptoAPI: getRandomValues()&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Sunil Yoo&quot; href=&quot;mailto:usuanday83@gmail.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#dfn-Crypto-method-getRandomValues&quot;&gt;
+&lt;script src=&quot;../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;getRandomValues.js&quot;&gt;&lt;/script&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test();
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPItoolsgeneratepy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/tools/generate.py (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/tools/generate.py                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/tools/generate.py        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+# script to generate the generateKey tests
+
+import os
+
+here = os.path.dirname(__file__)
+
+successes_html = &quot;&quot;&quot;&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() Successful Calls&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;successes.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Good Parameters&lt;/h1&gt;
+&lt;p&gt;
+    &lt;strong&gt;Warning!&lt;/strong&gt; RSA key generation is intrinsically
+    very slow, so the related tests can take up to
+    several minutes to complete, depending on browser!
+&lt;/p&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([%s]);
+&lt;/script&gt;&quot;&quot;&quot;
+
+failures_html = &quot;&quot;&quot;&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
+&lt;title&gt;WebCryptoAPI: generateKey() for Failures&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Charles Engelke&quot; href=&quot;mailto:w3c@engelke.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto-method-generateKey&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+
+&lt;script src=&quot;/WebCryptoAPI/util/helpers.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;failures.js&quot;&gt;&lt;/script&gt;
+
+&lt;h1&gt;generateKey Tests for Bad Parameters&lt;/h1&gt;
+
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+run_test([%s]);
+&lt;/script&gt;
+&quot;&quot;&quot;
+
+successes_worker = &quot;&quot;&quot;// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;successes.js&quot;);
+
+run_test([%s]);
+done();&quot;&quot;&quot;
+
+failures_worker = &quot;&quot;&quot;// &lt;meta&gt; timeout=long
+importScripts(&quot;/resources/testharness.js&quot;);
+importScripts(&quot;../util/helpers.js&quot;);
+importScripts(&quot;failures.js&quot;);
+run_test([%s]);
+done();&quot;&quot;&quot;
+
+names = [&quot;AES-CTR&quot;, &quot;AES-CBC&quot;, &quot;AES-GCM&quot;, &quot;AES-KW&quot;, &quot;HMAC&quot;, &quot;RSASSA-PKCS1-v1_5&quot;,
+         &quot;RSA-PSS&quot;, &quot;RSA-OAEP&quot;, &quot;ECDSA&quot;, &quot;ECDH&quot;]
+
+for filename_pattern, template in [(&quot;test_successes_%s.html&quot;, successes_html),
+                                   (&quot;test_failures_%s.html&quot;, failures_html),
+                                   (&quot;successes_%s.worker.js&quot;, successes_worker),
+                                   (&quot;failures_%s.worker.js&quot;, failures_worker)]:
+    for name in names:
+        path = os.path.join(here, os.pardir, &quot;generateKey&quot;, filename_pattern % name)
+        with open(path, &quot;w&quot;) as f:
+            f.write(template % '&quot;%s&quot;' % name)
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPItoolsw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/tools/w3c-import.log (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/tools/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/tools/w3c-import.log        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+        https://github.com/w3c/csswg-test
+        https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/WebCryptoAPI/tools/generate.py
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIutilhelpersjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/util/helpers.js (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/util/helpers.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/util/helpers.js        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,230 @@
</span><ins>+//
+// helpers.js
+//
+// Helper functions used by several WebCryptoAPI tests
+//
+
+var registeredAlgorithmNames = [
+    &quot;RSASSA-PKCS1-v1_5&quot;,
+    &quot;RSA-PSS&quot;,
+    &quot;RSA-OAEP&quot;,
+    &quot;ECDSA&quot;,
+    &quot;ECDH&quot;,
+    &quot;AES-CTR&quot;,
+    &quot;AES-CBC&quot;,
+    &quot;AES-GCM&quot;,
+    &quot;AES-KW&quot;,
+    &quot;HMAC&quot;,
+    &quot;SHA-1&quot;,
+    &quot;SHA-256&quot;,
+    &quot;SHA-384&quot;,
+    &quot;SHA-512&quot;,
+    &quot;HKDF-CTR&quot;,
+    &quot;PBKDF2&quot;
+];
+
+
+// Treats an array as a set, and generates an array of all non-empty
+// subsets (which are themselves arrays).
+//
+// The order of members of the &quot;subsets&quot; is not guaranteed.
+function allNonemptySubsetsOf(arr) {
+    var results = [];
+    var firstElement;
+    var remainingElements;
+
+    for(var i=0; i&lt;arr.length; i++) {
+        firstElement = arr[i];
+        remainingElements = arr.slice(i+1);
+        results.push([firstElement]);
+
+        if (remainingElements.length &gt; 0) {
+            allNonemptySubsetsOf(remainingElements).forEach(function(combination) {
+                combination.push(firstElement);
+                results.push(combination);
+            });
+        }
+    }
+
+    return results;
+}
+
+
+// Create a string representation of keyGeneration parameters for
+// test names and labels.
+function objectToString(obj) {
+    var keyValuePairs = [];
+
+    if (Array.isArray(obj)) {
+        return &quot;[&quot; + obj.map(function(elem){return objectToString(elem);}).join(&quot;, &quot;) + &quot;]&quot;;
+    } else if (typeof obj === &quot;object&quot;) {
+        Object.keys(obj).sort().forEach(function(keyName) {
+            keyValuePairs.push(keyName + &quot;: &quot; + objectToString(obj[keyName]));
+        });
+        return &quot;{&quot; + keyValuePairs.join(&quot;, &quot;) + &quot;}&quot;;
+    } else if (typeof obj === &quot;undefined&quot;) {
+        return &quot;undefined&quot;;
+    } else {
+        return obj.toString();
+    }
+
+    var keyValuePairs = [];
+
+    Object.keys(obj).sort().forEach(function(keyName) {
+        var value = obj[keyName];
+        if (typeof value === &quot;object&quot;) {
+            value = objectToString(value);
+        } else if (typeof value === &quot;array&quot;) {
+            value = &quot;[&quot; + value.map(function(elem){return objectToString(elem);}).join(&quot;, &quot;) + &quot;]&quot;;
+        } else {
+            value = value.toString();
+        }
+
+        keyValuePairs.push(keyName + &quot;: &quot; + value);
+    });
+
+    return &quot;{&quot; + keyValuePairs.join(&quot;, &quot;) + &quot;}&quot;;
+}
+
+// Is key a CryptoKey object with correct algorithm, extractable, and usages?
+// Is it a secret, private, or public kind of key?
+function assert_goodCryptoKey(key, algorithm, extractable, usages, kind) {
+    var correctUsages = [];
+
+    var registeredAlgorithmName;
+    registeredAlgorithmNames.forEach(function(name) {
+        if (name.toUpperCase() === algorithm.name.toUpperCase()) {
+            registeredAlgorithmName = name;
+        }
+    });
+
+    assert_equals(key.constructor, CryptoKey, &quot;Is a CryptoKey&quot;);
+    assert_equals(key.type, kind, &quot;Is a &quot; + kind + &quot; key&quot;);
+    if (key.type === &quot;public&quot;) {
+        extractable = true; // public keys are always extractable
+    }
+    assert_equals(key.extractable, extractable, &quot;Extractability is correct&quot;);
+
+    assert_equals(key.algorithm.name, registeredAlgorithmName, &quot;Correct algorithm name&quot;);
+    assert_equals(key.algorithm.length, algorithm.length, &quot;Correct length&quot;);
+    if ([&quot;HMAC&quot;, &quot;RSASSA-PKCS1-v1_5&quot;, &quot;RSA-PSS&quot;].includes(registeredAlgorithmName)) {
+        assert_equals(key.algorithm.hash.name.toUpperCase(), algorithm.hash.toUpperCase(), &quot;Correct hash function&quot;);
+    }
+
+    // usages is expected to be provided for a key pair, but we are checking
+    // only a single key. The publicKey and privateKey portions of a key pair
+    // recognize only some of the usages appropriate for a key pair.
+    if (key.type === &quot;public&quot;) {
+        [&quot;encrypt&quot;, &quot;verify&quot;, &quot;wrapKey&quot;].forEach(function(usage) {
+            if (usages.includes(usage)) {
+                correctUsages.push(usage);
+            }
+        });
+    } else if (key.type === &quot;private&quot;) {
+        [&quot;decrypt&quot;, &quot;sign&quot;, &quot;unwrapKey&quot;, &quot;deriveKey&quot;, &quot;deriveBits&quot;].forEach(function(usage) {
+            if (usages.includes(usage)) {
+                correctUsages.push(usage);
+            }
+        });
+    } else {
+        correctUsages = usages;
+    }
+
+    assert_equals((typeof key.usages), &quot;object&quot;, key.type + &quot; key.usages is an object&quot;);
+    assert_not_equals(key.usages, null, key.type + &quot; key.usages isn't null&quot;);
+
+    // The usages parameter could have repeats, but the usages
+    // property of the result should not.
+    var usageCount = 0;
+    key.usages.forEach(function(usage) {
+        usageCount += 1;
+        assert_in_array(usage, correctUsages, &quot;Has &quot; + usage + &quot; usage&quot;);
+    });
+    assert_equals(key.usages.length, usageCount, &quot;usages property is correct&quot;);
+}
+
+
+// The algorithm parameter is an object with a name and other
+// properties. Given the name, generate all valid parameters.
+function allAlgorithmSpecifiersFor(algorithmName) {
+    var results = [];
+
+    // RSA key generation is slow. Test a minimal set of parameters
+    var hashes = [&quot;SHA-1&quot;, &quot;SHA-256&quot;];
+
+    // EC key generation is a lot faster. Check all curves in the spec
+    var curves = [&quot;P-256&quot;, &quot;P-384&quot;, &quot;P-521&quot;];
+
+    if (algorithmName.toUpperCase().substring(0, 3) === &quot;AES&quot;) {
+        // Specifier properties are name and length
+        [128, 192, 256].forEach(function(length) {
+            results.push({name: algorithmName, length: length});
+        });
+    } else if (algorithmName.toUpperCase() === &quot;HMAC&quot;) {
+        [
+            {name: &quot;SHA-1&quot;, length: 160},
+            {name: &quot;SHA-256&quot;, length: 256},
+            {name: &quot;SHA-384&quot;, length: 384},
+            {name: &quot;SHA-512&quot;, length: 512}
+        ].forEach(function(hashAlgorithm) {
+            results.push({name: algorithmName, hash: hashAlgorithm.name, length: hashAlgorithm.length});
+        });
+    } else if (algorithmName.toUpperCase().substring(0, 3) === &quot;RSA&quot;) {
+        hashes.forEach(function(hashName) {
+            results.push({name: algorithmName, hash: hashName, modulusLength: 2048, publicExponent: new Uint8Array([1,0,1])});
+        });
+    } else if (algorithmName.toUpperCase().substring(0, 2) === &quot;EC&quot;) {
+        curves.forEach(function(curveName) {
+            results.push({name: algorithmName, namedCurve: curveName});
+        });
+    }
+
+    return results;
+}
+
+
+// Create every possible valid usages parameter, given legal
+// usages. Note that an empty usages parameter is not always valid.
+//
+// There is an optional parameter - mandatoryUsages. If provided,
+// it should be an array containing those usages of which one must be
+// included.
+function allValidUsages(validUsages, emptyIsValid, mandatoryUsages) {
+    if (typeof mandatoryUsages === &quot;undefined&quot;) {
+        mandatoryUsages = [];
+    }
+
+    okaySubsets = [];
+    allNonemptySubsetsOf(validUsages).forEach(function(subset) {
+        if (mandatoryUsages.length === 0) {
+            okaySubsets.push(subset);
+        } else {
+            for (var i=0; i&lt;mandatoryUsages.length; i++) {
+                if (subset.includes(mandatoryUsages[i])) {
+                    okaySubsets.push(subset);
+                    return;
+                }
+            }
+        }
+    });
+
+    if (emptyIsValid) {
+        okaySubsets.push([]);
+    }
+
+    okaySubsets.push(validUsages.concat(mandatoryUsages).concat(validUsages)); // Repeated values are allowed
+    return okaySubsets;
+}
+
+
+// Algorithm name specifiers are case-insensitive. Generate several
+// case variations of a given name.
+function allNameVariants(name) {
+    var upCaseName = name.toUpperCase();
+    var lowCaseName = name.toLowerCase();
+    var mixedCaseName = upCaseName.substring(0, 1) + lowCaseName.substring(1);
+
+    return [upCaseName, lowCaseName, mixedCaseName];
+}
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIutilw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/util/w3c-import.log (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/util/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/util/w3c-import.log        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+        https://github.com/w3c/csswg-test
+        https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/WebCryptoAPI/util/helpers.js
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/WebCryptoAPI/w3c-import.log (0 => 203201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/w3c-import.log                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/w3c-import.log        2016-07-14 00:08:29 UTC (rev 203201)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+        https://github.com/w3c/csswg-test
+        https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/WebCryptoAPI/OWNERS
+/LayoutTests/imported/w3c/WebCryptoAPI/README.md
+/LayoutTests/imported/w3c/WebCryptoAPI/WebCryptoAPI.idl
+/LayoutTests/imported/w3c/WebCryptoAPI/getRandomValues.js
+/LayoutTests/imported/w3c/WebCryptoAPI/getRandomValues.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/idlharness.html
+/LayoutTests/imported/w3c/WebCryptoAPI/idlharness.worker.js
+/LayoutTests/imported/w3c/WebCryptoAPI/test_getRandomValues.html
</ins></span></pre>
</div>
</div>

</body>
</html>