Skip to content

Commit 69904bb

Browse files
authored
Throw for KMAC key generation with length=0 (#24)
This is already handled in import with DataError (much like in HMAC), but 0-length key generation wasn't rejected with OperationError, unlike in HMAC. This patch fixes that.
1 parent 8e38fae commit 69904bb

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

index.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6308,9 +6308,17 @@ <h5>Generate Key</h5>
63086308
|normalizedAlgorithm| is present:
63096309
</dt>
63106310
<dd>
6311-
Let |length| be equal to the
6312-
{{KmacKeyGenParams/length}}
6313-
member of |normalizedAlgorithm|.
6311+
<ol>
6312+
<li>
6313+
Let |length| be equal to the
6314+
{{KmacKeyGenParams/length}}
6315+
member of |normalizedAlgorithm|.
6316+
</li>
6317+
<li>
6318+
If |length| is zero, then [= exception/throw =] an
6319+
{{OperationError}}.
6320+
</li>
6321+
</ol>
63146322
</dd>
63156323
<dt>
63166324
Otherwise, if the {{Algorithm/name}} member of

0 commit comments

Comments
 (0)