Skip to content

Commit 9241c40

Browse files
authored
Allow using KMAC with an empty key (#55)
The requirement that the key length is non-zero was copied from HMAC, but NIST SP 800-185 section 4.2 explicitly says: > K is a key bit string of any length, including zero. (with a caveat about the security strength depending on the length of the key, of course). So, match the underlying spec and allow using KMAC with an empty key.
1 parent 696b345 commit 9241c40

1 file changed

Lines changed: 3 additions & 18 deletions

File tree

‎index.html‎

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6352,17 +6352,9 @@ <h5>Generate Key</h5>
63526352
|normalizedAlgorithm| is present:
63536353
</dt>
63546354
<dd>
6355-
<ol>
6356-
<li>
6357-
Let |length| be equal to the
6358-
{{KmacKeyGenParams/length}}
6359-
member of |normalizedAlgorithm|.
6360-
</li>
6361-
<li>
6362-
If |length| is zero, then [= exception/throw =] an
6363-
{{OperationError}}.
6364-
</li>
6365-
</ol>
6355+
Let |length| be equal to the
6356+
{{KmacKeyGenParams/length}}
6357+
member of |normalizedAlgorithm|.
63666358
</dd>
63676359
<dt>
63686360
Otherwise, if the {{Algorithm/name}} member of
@@ -6570,13 +6562,6 @@ <h5>Import Key</h5>
65706562
Let |length| be the length in bits of |data|.
65716563
</p>
65726564
</li>
6573-
<li>
6574-
<p>
6575-
If |length| is zero
6576-
then [= exception/throw =] a
6577-
{{DataError}}.
6578-
</p>
6579-
</li>
65806565
<li>
65816566
<dl class="switch">
65826567
<dt>

0 commit comments

Comments
 (0)