Skip to content

Commit f6ce844

Browse files
committed
Text reflow
Signed-off-by: Simo Sorce <[email protected]>
1 parent 46f6c63 commit f6ce844

File tree

3 files changed

+75
-30
lines changed

3 files changed

+75
-30
lines changed

working/doc/spec/digests.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ Mechanisms:
6464

6565
### Digest
6666

67-
The digest mechanism, denoted **CKM_\<hash\>** where \<hash\> identifies a hash function as per table 137, is a mechanism for message
68-
digesting, following the hash function as per table 137,
69-
defined in [FIPS PUB 180-4]^1^, [FIPS PUB 202]^2^ or [RFC 7693]^3^ respectively.
67+
The digest mechanism, denoted **CKM_\<hash\>** where \<hash\> identifies a hash
68+
function as per table 137, is a mechanism for message digesting, following the
69+
hash function as per table 137, defined in [FIPS PUB 180-4]^1^, [FIPS PUB
70+
202]^2^ or [RFC 7693]^3^ respectively.
7071

7172
+------------------+----------------------------+-------------------------+-------------------------+
7273
| Mechanism | Hash function | Digest length in bits | Digest length in bytes |
@@ -112,9 +113,12 @@ table 138: Digest: Data Length
112113

113114
### Truncated Digest
114115

115-
The truncated digest mechanism, denoted **CKM_SHA512_\<t\>**, is a mechanism for message
116-
digesting, following the Secure Hash Algorithm
117-
defined in [FIPS PUB 180-4] section 5.3.6. It is based on a 512-bit message digest with a distinct initial hash value and truncated to \<t\> bits as per table 139. **CKM_SHA512_\<t\>** is the same as **CKM_SHA512_T** with a parameter value of \<t\>.
116+
The truncated digest mechanism, denoted **CKM_SHA512_\<t\>**, is a mechanism for
117+
message digesting, following the Secure Hash Algorithm defined in [FIPS PUB
118+
180-4] section 5.3.6. It is based on a 512-bit message digest with a distinct
119+
initial hash value and truncated to \<t\> bits as per table 139.
120+
**CKM_SHA512_\<t\>** is the same as **CKM_SHA512_T** with a parameter value of
121+
\<t\>.
118122

119123
+------------------+-----------------+-------------------------+-------------------------+
120124
| Mechanism | Hash function | Truncated digest length | Truncated digest length |
@@ -130,7 +134,9 @@ table 139: Truncated digest: mechanisms and hash functions
130134

131135
**CKM_SHA512_224** and **CKM_SHA512_256** do not have a parameter.
132136

133-
**CKM_SHA512_T** has a parameter, a **CK_MAC_GENERAL_PARAMS**, which holds the value of t in bits. The length in bytes of the desired output should be in the range of 0-⌈t/8⌉, where 0 < t < 512, and t <> 384.
137+
**CKM_SHA512_T** has a parameter, a **CK_MAC_GENERAL_PARAMS**, which holds the
138+
value of t in bits. The length in bytes of the desired output should be in the
139+
range of 0-⌈t/8⌉, where 0 < t < 512, and t <> 384.
134140

135141
Constraints on the length of input and output data are summarized in the
136142
following table. For single-part digesting, the data and the digest may begin at

working/doc/spec/hash_based_key_derivations.md

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ Mechanisms:
7070

7171
### Hash-based key derivation
7272

73-
The hash-based key derivation mechanism, denoted **CKM_**\<hash\>**\_KEY_DERIVATION** or **CKM_**\<hash\>**\_KEY_DERIVE** where \<hash\> identifies a hash function or expansion function as per table 142 and as defined in [FIPS PUB 180-4]^1^, [FIPS PUB 202]^2^ or [RFC 7693]^3^ respectively, is a mechanism which provides the capability of deriving a secret key by digesting the value of another secret key with function \<hash\>.
73+
The hash-based key derivation mechanism, denoted
74+
**CKM_**\<hash\>**\_KEY_DERIVATION** or **CKM_**\<hash\>**\_KEY_DERIVE** where
75+
\<hash\> identifies a hash function or expansion function as per table 142 and
76+
as defined in [FIPS PUB 180-4]^1^, [FIPS PUB 202]^2^ or [RFC 7693]^3^
77+
respectively, is a mechanism which provides the capability of deriving a secret
78+
key by digesting the value of another secret key with function \<hash\>.
7479

7580
+-------------------------------+----------------------------+-------------------------+
7681
| Mechanism | Hash function | Digest length in bytes |
@@ -113,20 +118,40 @@ The hash-based key derivation mechanism, denoted **CKM_**\<hash\>**\_KEY_DERIVAT
113118
+-------------------------------+----------------------------+-------------------------+
114119
table 142: Hash-based key derivation: mechanisms and hash / expansion functions
115120

116-
The value of the base key is digested once, and the result is used to make the value of the derived secret key.
121+
The value of the base key is digested once, and the result is used to make the
122+
value of the derived secret key.
117123

118-
* If no length or key type is provided in the template, then the key produced by this mechanism will be a generic secret key. Its length will be the digest length in bytes as per table 142.
119-
* If no key type is provided in the template, but a length is, then the key produced by this mechanism will be a generic secret key of the specified length.
120-
* If no length was provided in the template, but a key type is, then that key type must have a well-defined length. If it does, then the key produced by this mechanism will be of the type specified in the template. If it doesn’t, an error will be returned.
121-
* If both a key type and a length are provided in the template, the length must be compatible with that key type. The key produced by this mechanism will be of the specified type and length.
124+
* If no length or key type is provided in the template, then the key produced by
125+
this mechanism will be a generic secret key. Its length will be the digest
126+
length in bytes as per table 142.
127+
* If no key type is provided in the template, but a length is, then the key
128+
produced by this mechanism will be a generic secret key of the specified
129+
length.
130+
* If no length was provided in the template, but a key type is, then that key
131+
type must have a well-defined length. If it does, then the key produced by
132+
this mechanism will be of the type specified in the template. If it doesn’t, an
133+
error will be returned.
134+
* If both a key type and a length are provided in the template, the length must
135+
be compatible with that key type. The key produced by this mechanism will be
136+
of the specified type and length.
122137

123-
If a DES, DES2, or CDMF key is derived with this mechanism, the parity bits of the key will be set properly.
124-
If the requested type of key requires more than the digest length in bytes, an error is generated.
138+
If a DES, DES2, or CDMF key is derived with this mechanism, the parity bits of
139+
the key will be set properly. If the requested type of key requires more than
140+
the digest length in bytes, an error is generated.
125141

126142
This mechanism has the following rules about key sensitivity and extractability:
127143

128-
* The **CKA_SENSITIVE** and **CKA_EXTRACTABLE** attributes in the template for the new key can both be specified to be either CK_TRUE or CK_FALSE. If omitted, these attributes each take on some default value.
129-
* If the base key has its **CKA_ALWAYS_SENSITIVE** attribute set to CK_FALSE, then the derived key will as well. If the base key has its **CKA_ALWAYS_SENSITIVE** attribute set to CK_TRUE, then the derived key has its **CKA_ALWAYS_SENSITIVE** attribute set to the same value as its **CKA_SENSITIVE attribute**.
130-
* Similarly, if the base key has its **CKA_NEVER_EXTRACTABLE** attribute set to CK_FALSE, then the derived key will, too.
144+
* The **CKA_SENSITIVE** and **CKA_EXTRACTABLE** attributes in the template for
145+
the new key can both be specified to be either CK_TRUE or CK_FALSE. If
146+
omitted, these attributes each take on some default value.
147+
* If the base key has its **CKA_ALWAYS_SENSITIVE** attribute set to CK_FALSE,
148+
then the derived key will as well. If the base key has its
149+
**CKA_ALWAYS_SENSITIVE** attribute set to CK_TRUE, then the derived key has
150+
its **CKA_ALWAYS_SENSITIVE** attribute set to the same value as its
151+
**CKA_SENSITIVE** attribute.
152+
* Similarly, if the base key has its **CKA_NEVER_EXTRACTABLE** attribute set to
153+
CK_FALSE, then the derived key will, too.
131154

132-
If the base key has its **CKA_NEVER_EXTRACTABLE** attribute set to CK_TRUE, then the derived key has its **CKA_NEVER_EXTRACTABLE** attribute set to the opposite value from its **CKA_EXTRACTABLE** attribute.
155+
If the base key has its **CKA_NEVER_EXTRACTABLE** attribute set to CK_TRUE, then
156+
the derived key has its **CKA_NEVER_EXTRACTABLE** attribute set to the opposite
157+
value from its **CKA_EXTRACTABLE** attribute.

working/doc/spec/hash_based_message_authentication_codes.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
## Hash-Based Message Authentication Codes (HMAC)
22

3-
HMAC mechanisms are mechanisms for signatures and verification, and for generation of HMAC keys.
4-
Refer to [RFC 2104] and [FIPS 198] for HMAC algorithm description. The HMAC secret key shall correspond to the PKCS #11 generic secret key type or the mechanism specific key types (see mechanism definition). Such keys for use with HMAC operations can be created using **C_CreateObject**, **C_GenerateKey**, or **C_UnwrapKey**.
5-
The RFC also specifies test vectors for the various hash function based HMAC mechanisms described in the respective hash mechanism descriptions. The RFC should be consulted to obtain these test vectors.
3+
HMAC mechanisms are mechanisms for signatures and verification, and for
4+
generation of HMAC keys. Refer to [RFC 2104] and [FIPS 198] for HMAC algorithm
5+
description. The HMAC secret key shall correspond to the PKCS #11 generic secret
6+
key type or the mechanism specific key types (see mechanism definition). Such
7+
keys for use with HMAC operations can be created using **C_CreateObject**,
8+
**C_GenerateKey**, or **C_UnwrapKey**. The RFC also specifies test vectors for
9+
the various hash function based HMAC mechanisms described in the respective hash
10+
mechanism descriptions. The RFC should be consulted to obtain these test
11+
vectors.
612

713
+--------------------------------------+---------------------------------------------------+
814
| | Functions |
@@ -184,12 +190,18 @@ Mechanisms:
184190

185191
### General-length HMAC
186192

187-
The general-length HMAC mechanism, denoted **CKM_**\<hash>**\_HMAC_GENERAL**, where \<hash\> identifies a hash function or truncated hash function as per table 144 and as defined in [FIPS PUB 180-4]^1^, [FIPS PUB 202]^2^ or [RFC 7693]^3^ respectively, is a mechanism for signatures and verification. It uses the HMAC construction, based on the \<hash\> hash function. The keys it uses are generic secret keys and **CKK_**\<hash>**\_HMAC** keys.
193+
The general-length HMAC mechanism, denoted **CKM_**\<hash>**\_HMAC_GENERAL**,
194+
where \<hash\> identifies a hash function or truncated hash function as per
195+
table 144 and as defined in [FIPS PUB 180-4]^1^, [FIPS PUB 202]^2^ or [RFC
196+
7693]^3^ respectively, is a mechanism for signatures and verification. It uses
197+
the HMAC construction, based on the \<hash\> hash function. The keys it uses are
198+
generic secret keys and **CKK_**\<hash>**\_HMAC** keys.
188199

189200
It has a parameter, a **CK_MAC_GENERAL_PARAMS**, which holds the length in bytes
190-
of the desired output. This length should be in the range 1-n, where len is the output size of the hash function in bytes as per table 144. Signatures (MACs)
191-
produced by this mechanism will be taken from the start of the full len-byte HMAC
192-
output.
201+
of the desired output. This length should be in the range 1-n, where len is the
202+
output size of the hash function in bytes as per table 144. Signatures (MACs)
203+
produced by this mechanism will be taken from the start of the full len-byte
204+
HMAC output.
193205

194206
+-------------------------------+----------------------------+--------------------------+
195207
| Mechanism | Hash function | Digest length in bytes |
@@ -238,8 +250,9 @@ table 145: General-length HMAC: Key And Data Length
238250

239251
### HMAC
240252

241-
The full-length HMAC mechanism, denoted **CKM_**\<hash\>**\_HMAC**, is a special case of
242-
the respective general-length **CKM_**\<hash\>**\_HMAC_GENERAL** mechanism in section 6.22.2.
253+
The full-length HMAC mechanism, denoted **CKM_**\<hash\>**\_HMAC**, is a special
254+
case of the respective general-length **CKM_**\<hash\>**\_HMAC_GENERAL**
255+
mechanism in section 6.22.2.
243256

244257
It has no parameter, and always produces an output of length as per table 144.
245258

@@ -250,8 +263,9 @@ key generation mechanism for NIST’s \<hash\>-HMAC.
250263

251264
It does not have a parameter.
252265

253-
The mechanism generates HMAC keys of key type **CKK_**\<hash\>**\_HMAC** with a particular length in bytes, as
254-
specified in the **CKA_VALUE_LEN** attribute of the template for the key.
266+
The mechanism generates HMAC keys of key type **CKK_**\<hash\>**\_HMAC** with a
267+
particular length in bytes, as specified in the **CKA_VALUE_LEN** attribute of
268+
the template for the key.
255269

256270
The mechanism contributes the **CKA_CLASS**, **CKA_KEY_TYPE**, and **CKA_VALUE**
257271
attributes to the new key. Other attributes supported by the HMAC key

0 commit comments

Comments
 (0)