Bug 24410 - Add derive bits description for CONCAT KDF
authorMark Watson <watsonm@netflix.com>
Wed, 26 Feb 2014 18:27:46 -0800
changeset 132 7514a1c66a70
parent 131 417988dd96f7
child 133 db46aff4baa1
Bug 24410 - Add derive bits description for CONCAT KDF
spec/Overview-WebCryptoAPI.xml
spec/Overview.html
--- a/spec/Overview-WebCryptoAPI.xml	Wed Feb 26 17:56:54 2014 -0800
+++ b/spec/Overview-WebCryptoAPI.xml	Wed Feb 26 18:27:46 2014 -0800
@@ -10077,14 +10077,9 @@
               </thead>
               <tbody>
                 <tr>
-                  <td>deriveKey</td>
-                  <td><a href="#dfn-ConcatParams">ConcatParams</a></td>
-                  <td><a href="#dfn-Key">Key</a></td>
-                </tr>
-                <tr>
                   <td>deriveBits</td>
                   <td><a href="#dfn-ConcatParams">ConcatParams</a></td>
-                  <td><a href="#dfn-ArrayBuffer">ArrayBuffer</a></td>
+                  <td>Octet string</td>
                 </tr>
               </tbody>
             </table>
@@ -10094,30 +10089,75 @@
             <x:codeblock language="idl">
 dictionary <dfn id="dfn-ConcatParams">ConcatParams</dfn> : <a href="#dfn-Algorithm">Algorithm</a> {
   <span class="comment">// The digest method to use to derive the keying material.</span>
-  AlgorithmIdentifier hash;
+  AlgorithmIdentifier <dfn id="dfn-ConcatParams-hash">hash</dfn>;
 
   <span class="comment">// A bit string corresponding to the AlgorithmId field of the OtherInfo parameter.</span>
   <span class="comment">// The AlgorithmId indicates how the derived keying material will be parsed and for which</span>
   <span class="comment">// algorithm(s) the derived secret keying material will be used.</span>
-  CryptoOperationData algorithmId;
-
+  CryptoOperationData <dfn id="dfn-ConcatParams-algorithmId">algorithmId</dfn>;
   <span class="comment">// A bit string that corresponds to the PartyUInfo field of the OtherInfo parameter.</span>
-  CryptoOperationData partyUInfo;
+  CryptoOperationData <dfn id="dfn-ConcatParams-partyUInfo">partyUInfo</dfn>;
   <span class="comment">// A bit string that corresponds to the PartyVInfo field of the OtherInfo parameter.</span>
-  CryptoOperationData partyVInfo;
+  CryptoOperationData <dfn id="dfn-ConcatParams-partyVInfo">partyVInfo</dfn>;
   <span class="comment">// An optional bit string that corresponds to the SuppPubInfo field of the OtherInfo parameter.</span>
-  CryptoOperationData? publicInfo;
+  CryptoOperationData? <dfn id="dfn-ConcatParams-publicInfo">publicInfo</dfn>;
   <span class="comment">// An optional bit string that corresponds to the SuppPrivInfo field of the OtherInfo parameter.</span>
-  CryptoOperationData? privateInfo;
+  CryptoOperationData? <dfn id="dfn-ConcatParams-privateInfo">privateInfo</dfn>;
 };
             </x:codeblock>
           </div>
           <div id="concat-operations" class="section">
             <h4>Operations</h4>
-            <ul>
-              <li>Derive Key</li>
-              <li>Derive Bits</li>
-            </ul>
+            <dl>
+              <dt>Derive Bits</dt>
+              <dd>
+                <ol>
+                  <li>
+                    <p>
+                      If any of the
+                      <a href="#dfn-ConcatParams-hash">hash</a>,
+                      <a href="#dfn-ConcatParams-algorithmId">algorithmId</a>,
+                      <a href="#dfn-ConcatParams-partyUInfo">partyUInfo</a> or
+                      <a href="#dfn-ConcatParams-partyVInfo">partyVInfo</a> properties are not
+                      present in <var>normalizedAlgorithm</var>, terminate this algorithm with an
+                      error.
+                    </p>
+                  </li>
+                  <li>
+                    <p>
+                      Let <var>secret</var> be the result of performing the Concatenation Key
+                      Derivation Funtion defined in Section 5.8.1 of
+                      [<a href="#SP800-56A">SP800-56A</a>] with <var>length</var> as
+                      <var>keydatalen</var>, the hash function identified by the
+                      <a href="#dfn-ConcatParams-hash">hash</a> property of
+                      <var>normalizedAlgorithm</var> as <var>H</var>, the
+                      <a href="#dfn-ConcatParams-algorithmId">algorithmId</a> property of
+                      <var>normalizedAlgorithm</var> as <var>AlgorithmID</var>, the
+                      <a href="#dfn-ConcatParams-partyUInfo">partyUInfo</a> property of
+                      <var>normalizedAlgorithm</var> as <var>PartyUInfo</var>, the
+                      <a href="#dfn-ConcatParams-partyVInfo">partyVInfo</a> property of
+                      <var>normalizedAlgorithm</var> as <var>PartyVInfo</var>, the
+                      <a href="#dfn-ConcatParams-pubicInfo">publicInfo</a> property of
+                      <var>normalizedAlgorithm</var>, if present and not null, as
+                      <var>publicInfo</var> and the
+                      <a href="#dfn-ConcatParams-privateInfo">privateInfo</a> property of
+                      <var>normalizedAlgorithm</var>, if present and not null, as
+                      <var>privateInfo</var>.
+                    </p>
+                  </li>
+                  <li>
+                    <p>
+                      If the operation fails, terminate this algorithm with an error.
+                    </p>
+                  </li>
+                  <li>
+                    <p>
+                      Return <var>secret</var>
+                    </p>
+                  </li>
+                </ol>
+              </dd>
+            </dl>
           </div>
         </div>
         <div id="hkdf-ctr" class="section">
--- a/spec/Overview.html	Wed Feb 26 17:56:54 2014 -0800
+++ b/spec/Overview.html	Wed Feb 26 18:27:46 2014 -0800
@@ -2042,6 +2042,7 @@
                   Let <var>result</var> be the result of executing the import key operation
                   specified by <var>normalizedDerivedKeyAlgorithm</var> using <code>"raw"</code> as
                   <var>format</var>, <var>secret</var> as <var>keyData</var>,
+                  <var>normalizedDerivedKeyAlgorithm</var> as <var>normalizedAlgorithm</var>,
                   <var>extractable</var> and <var>usages</var>.
                 </p>
               </li>
@@ -10068,14 +10069,9 @@
               </thead>
               <tbody>
                 <tr>
-                  <td>deriveKey</td>
-                  <td><a href="#dfn-ConcatParams">ConcatParams</a></td>
-                  <td><a href="#dfn-Key">Key</a></td>
-                </tr>
-                <tr>
                   <td>deriveBits</td>
                   <td><a href="#dfn-ConcatParams">ConcatParams</a></td>
-                  <td><a href="#dfn-ArrayBuffer">ArrayBuffer</a></td>
+                  <td>Octet string</td>
                 </tr>
               </tbody>
             </table>
@@ -10085,30 +10081,75 @@
             <div class="block"><div class="blockTitleDiv"><span class="blockTitle">IDL</span></div><div class="blockContent"><pre class="code"><code class="idl-code">
 dictionary <dfn id="dfn-ConcatParams">ConcatParams</dfn> : <a href="#dfn-Algorithm">Algorithm</a> {
   <span class="comment">// The digest method to use to derive the keying material.</span>
-  AlgorithmIdentifier hash;
+  AlgorithmIdentifier <dfn id="dfn-ConcatParams-hash">hash</dfn>;
 
   <span class="comment">// A bit string corresponding to the AlgorithmId field of the OtherInfo parameter.</span>
   <span class="comment">// The AlgorithmId indicates how the derived keying material will be parsed and for which</span>
   <span class="comment">// algorithm(s) the derived secret keying material will be used.</span>
-  CryptoOperationData algorithmId;
-
+  CryptoOperationData <dfn id="dfn-ConcatParams-algorithmId">algorithmId</dfn>;
   <span class="comment">// A bit string that corresponds to the PartyUInfo field of the OtherInfo parameter.</span>
-  CryptoOperationData partyUInfo;
+  CryptoOperationData <dfn id="dfn-ConcatParams-partyUInfo">partyUInfo</dfn>;
   <span class="comment">// A bit string that corresponds to the PartyVInfo field of the OtherInfo parameter.</span>
-  CryptoOperationData partyVInfo;
+  CryptoOperationData <dfn id="dfn-ConcatParams-partyVInfo">partyVInfo</dfn>;
   <span class="comment">// An optional bit string that corresponds to the SuppPubInfo field of the OtherInfo parameter.</span>
-  CryptoOperationData? publicInfo;
+  CryptoOperationData? <dfn id="dfn-ConcatParams-publicInfo">publicInfo</dfn>;
   <span class="comment">// An optional bit string that corresponds to the SuppPrivInfo field of the OtherInfo parameter.</span>
-  CryptoOperationData? privateInfo;
+  CryptoOperationData? <dfn id="dfn-ConcatParams-privateInfo">privateInfo</dfn>;
 };
             </code></pre></div></div>
           </div>
           <div id="concat-operations" class="section">
             <h4>18.19.4. Operations</h4>
-            <ul>
-              <li>Derive Key</li>
-              <li>Derive Bits</li>
-            </ul>
+            <dl>
+              <dt>Derive Bits</dt>
+              <dd>
+                <ol>
+                  <li>
+                    <p>
+                      If any of the
+                      <a href="#dfn-ConcatParams-hash">hash</a>,
+                      <a href="#dfn-ConcatParams-algorithmId">algorithmId</a>,
+                      <a href="#dfn-ConcatParams-partyUInfo">partyUInfo</a> or
+                      <a href="#dfn-ConcatParams-partyVInfo">partyVInfo</a> properties are not
+                      present in <var>normalizedAlgorithm</var>, terminate this algorithm with an
+                      error.
+                    </p>
+                  </li>
+                  <li>
+                    <p>
+                      Let <var>secret</var> be the result of performing the Concatenation Key
+                      Derivation Funtion defined in Section 5.8.1 of
+                      [<a href="#SP800-56A">SP800-56A</a>] with <var>length</var> as
+                      <var>keydatalen</var>, the hash function identifier by the
+                      <a href="#dfn-ConcatParams-hash">hash</a> property of
+                      <var>normalizedAlgorithm</var> as <var>H</var>, the
+                      <a href="#dfn-ConcatParams-algorithmId">algorithmId</a> property of
+                      <var>normalizedAlgorithm</var> as <var>AlgorithmID</var>, the
+                      <a href="#dfn-ConcatParams-partyUInfo">partyUInfo</a> property of
+                      <var>normalizedAlgorithm</var> as <var>PartyUInfo</var>, the
+                      <a href="#dfn-ConcatParams-partyVInfo">partyVInfo</a> property of
+                      <var>normalizedAlgorithm</var> as <var>PartyVInfo</var>, the
+                      <a href="#dfn-ConcatParams-pubicInfo">publicInfo</a> property of
+                      <var>normalizedAlgorithm</var>, if present and not null, as
+                      <var>publicInfo</var> and the
+                      <a href="#dfn-ConcatParams-privateInfo">privateInfo</a> property of
+                      <var>normalizedAlgorithm</var>, if present and not null, as
+                      <var>privateInfo</var>.
+                    </p>
+                  </li>
+                  <li>
+                    <p>
+                      If the operation fails, terminate this algorithm with an error.
+                    </p>
+                  </li>
+                  <li>
+                    <p>
+                      Return <var>secret</var>
+                    </p>
+                  </li>
+                </ol>
+              </dd>
+            </dl>
           </div>
         </div>
         <div id="hkdf-ctr" class="section">