CKM_AES_GCM
GCM is the Galois/Counter Mode of operation of the AES algorithm for symmetric key encryption.
Usage Notes
Initialization Vector
If the HSM is in FIPS mode
Using the GCM method, encrypted data is the same size as the clear data. The IV generated by the HSM is concatenated at the end -- to determine the IV, find the last 16 bytes of the encrypted data.
If the HSM is not in FIPS mode, you must specify an IV. Random IV is supported and recommended for GCM and GMAC. If you are not using random IV, then the most efficient IV value length is 12 bytes; any other size reduces performance and requires more work (per NIST SP-800-38D).
The internal IV is a randomly generated 16-byte IV.
Performance
For authentication, it is possible to use CKM_AES_GCM mechanism, when passing no data to encrypt (for strict compliance with NIST specification), and performance in that mode is better than in previous Luna releases.
The correlation is not exact but, as a general rule for a given mechanism, invocation by PKCS#11 API always provides the best performance, JSP performance is close but lower due to Java architecture, and JCPROV performance is somewhat lower still than PKCS#11 and JSP performance levels.
JCPROV
AES-GMAC and AES-GCM are supported in JCPROV. Use CK_AES_GCM_PARAMS.java to define the GMAC operation. Implementation is the same as for PKCS#11.
Java Provider (JSP)
Both GMC and GMAC are supported. "GmacAesDemo.java" provides a sample for using GMAC with Java.
Java Parameter Specification class LunaGmacParameterSpec.java defines default values recommended by the NIST specification.
Accumulating Data
Our GMAC and GCM are single part operations, so even if they are called using multi-part API, we accumulate the data (up to a maximum) and return data only on the “final” operation. That is the meaning of "Accumulating" in the table, below.
Summary
FIPS approved? | Yes |
Supported functions | Encrypt | Decrypt | Wrap | Unwrap |
Functions restricted from FIPS use | None |
Minimum key length (bits) | 128 |
Minimum key length for FIPS use (bits) | 128 |
Minimum legacy key length for FIPS use (bits) | N/A |
Maximum key length (bits) | 256 |
Block size | 16 |
Digest size | 0 |
Key types | AES |
Algorithms | AES |
Modes | GCM |
Flags | Extractable | Accumulating |