You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6217745
Browse filesBrowse the repository at this point in the historyBrowse files
Add notes about non-integer numbers of bytes for cSHAKE and KMAC (#84)
Note that using cSHAKE and KMAC with inputs or outputs with a
non-integer number of bytes may not be supported, and may lead to
surprising results in the case of `deriveKey`.
Co-authored-by: Filip Skokan <panva.ip@gmail.com>
<p>The <dfndata-dfn-for=CShakeParamsid=dfn-CShakeParams-outputLength>outputLength</dfn> member represents the requested output length in bits.</p>
7056
+
<pclass="note">
7057
+
Byte-oriented implementations of cSHAKE may not support outputting a
7058
+
non-integer number of bytes. In that case, the implementation should
7059
+
throw a {{NotSupportedError}} in the Digest operation
7060
+
(and return `false` from {{SubtleCrypto/supports()}})
7061
+
when {{CShakeParams/outputLength}} is not a multiple of 8.
7062
+
</p>
7056
7063
<p>The <dfndata-dfn-for=CShakeParamsid=dfn-CShakeParams-functionName>functionName</dfn> member represents the function name, used by NIST to define functions based on cSHAKE. When used, it should only be set to values defined by NIST.</p>
7057
7064
<p>The <dfndata-dfn-for=CShakeParamsid=dfn-CShakeParams-customization>customization</dfn> member represents the customization string. The application selects this string to define a variant of the function.</p>
<p>The <dfndata-dfn-for=KmacKeyGenParamsid=dfn-KmacKeyGenParams-length>length</dfn> member represents the length (in bits) of the key to generate. If unspecified, the recommended length will be used, which is 128 for KMAC128 and 256 for KMAC256.</p>
7472
+
<pclass="note">
7473
+
Byte-oriented implementations of KMAC may not support keys with a
7474
+
non-integer number of bytes. In that case, the implementation should
7475
+
throw a {{NotSupportedError}} in the Generate Key operation
7476
+
(and return `false` from {{SubtleCrypto/supports()}})
7477
+
when {{KmacKeyGenParams/length}} is not a multiple of 8.
<p>The <dfndata-dfn-for=KmacParamsid=dfn-KmacParams-outputLength>outputLength</dfn> member represents the requested output length in bits.</p>
7523
+
<pclass="note">
7524
+
Byte-oriented implementations of KMAC may not support outputting a
7525
+
non-integer number of bytes. In that case, the implementation should
7526
+
throw a {{NotSupportedError}} in the Sign and Verify operations
7527
+
(and return `false` from {{SubtleCrypto/supports()}})
7528
+
when {{KmacParams/outputLength}} is not a multiple of 8.
7529
+
</p>
7493
7530
<p>The <dfndata-dfn-for=KmacParamsid=dfn-KmacParams-customization>customization</dfn> member represents the customization string. The application selects this string to define a variant of the function.</p>
0 commit comments