Skip to content

Commit f869c81

Browse files
committed
Clarify HMAC key definition
* Use standard terminology for hash block size * Indicate that long HMAC keys might not be supported
1 parent d0bac28 commit f869c81

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

doc/crypto/api/keys/types.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,18 @@ Symmetric keys
135135

136136
The bit size of an HMAC key must be a non-zero multiple of 8.
137137
An HMAC key is typically the same size as the output of the underlying hash algorithm.
138-
An HMAC key that is longer than the input-block size of the underlying hash algorithm will be hashed before use, see :RFC-title:`2104#2`.
138+
An HMAC key that is longer than the block size of the underlying hash algorithm will be hashed before use, see :RFC-title:`2104#2`.
139139

140-
It is recommended that an application does not construct HMAC keys that are longer than the input block size of the hash algorithm that will be used.
140+
It is recommended that an application does not construct HMAC keys that are longer than the block size of the hash algorithm that will be used.
141+
It is :scterm:`implementation defined` whether an HMAC key that is longer than the hash block size is supported.
141142

142-
If the application does not control the length of the data used to construct the HMAC key, it is recommended that the application hashes the key data, when it exceeds the hash input-block length, before constructing the HMAC key.
143-
This will reduce the size of the stored HMAC key.
143+
If the application does not control the length of the data used to construct the HMAC key, it is recommended that the application hashes the key data, when it exceeds the hash block length, before constructing the HMAC key.
144144

145145
.. note::
146146

147147
:code:`PSA_HASH_LENGTH(alg)` provides the output size of hash algorithm ``alg``, in bytes.
148148

149-
:code:`PSA_HASH_BLOCK_LENGTH(alg)` provides the input-block size of hash algorithm ``alg``, in bytes.
149+
:code:`PSA_HASH_BLOCK_LENGTH(alg)` provides the block size of hash algorithm ``alg``, in bytes.
150150

151151
.. subsection:: Compatible algorithms
152152

0 commit comments

Comments
 (0)