Cryptographic Token Interface Standard

PKCS#11


General-length SHA-256-HMAC

The general-length SHA-256-HMAC mechanism, denoted CKM_SHA256_HMAC_GENERAL, is the same as the general-length SHA-1-HMAC mechanism in Section 12.21.3, except that it uses the HMAC construction based on the SHA-256 hash function and length of the output should be in the range 0-32. The keys it uses are generic secret keys. FIPS-198 compliant tokens may require the key length to be at least 16 bytes; that is, half the size of the SHA-256 hash output.

It has a parameter, a CK_MAC_GENERAL_PARAMS, which holds the length in bytes of the desired output. This length should be in the range 0-32 (the output size of SHA-256 is 32 bytes). FIPS-198 compliant tokens may constrain the output length to be at least 4 or 16 (half the maximum length). Signatures (MACs) produced by this mechanism will be taken from the start of the full 32-byte HMAC output.

Table 133, General-length SHA-256-HMAC: Key And Data Length
Function Key type
Data length
Signature length
C_Sign
generic secret
Any
0-32, depending on parameters
C_Verify
generic secret
Any
0-32, depending on parameters


RSA Security Inc. Public-Key Cryptography Standards - PKCS#11 - v220