#include "dinamo.h"
Data Fields | |
BYTE | bOp |
char | szDst[MAX_OBJ_ID_FQN_LEN] |
BYTE | bCtxLen |
BYTE | pbCtx[DN_KEM_D_MAX_CTX_LEN] |
DWORD | dwType |
DWORD | dwAttr |
Information on the shared secret KEM (Key Encapsulation Mechanism).
It currently supports the ML-KEM standard according to FIPS-203.
BYTE bOp |
Operation to be carried out with shared secret.
Value | Meaning |
---|---|
DN_KEM_OP_SHARED_SECRET | Returns the shared secret, without creating a key. The other members of the structure must be set to zero. The return is the shared secret with size DN_KEM_D_ML_KEM_SS_LEN for ML-KEM keys. |
DN_KEM_OP_DIRECT_KEY | Create a key in the HSM using the shared secret. The size of the selected key must be less than or equal to the size of the shared secret. For ML-KEM the size is DN_KEM_D_ML_KEM_SS_LEN. If the key is larger, use DN_KEM_OP_X9_63_SHA256. Fill in the other fields in the structure, you don't need to fill in pbCtx and bCtxLen. |
DN_KEM_OP_X9_63_SHA256 | Creates a key in the HSM using the KDF (Key Derivation Function) x9.63 SHA256 using the shared secret and the context entered in pbCtx as parameters (optional). The shared secret is stretched to the size required for the key. Fill in all the other fields of the structure, pbCtx (optional). |
char szDst[MAX_OBJ_ID_FQN_LEN] |
Name of the destination key, generated from the shared secret. See DN_KEM_OP_DIRECT_KEY and DN_KEM_OP_X9_63_SHA256 operations. If not used, fill in with zeros.
BYTE bCtxLen |
Size of pbCtx. If not used, it must be zero.
BYTE pbCtx[DN_KEM_D_MAX_CTX_LEN] |
Optional key derivation context when using the DN_KEM_OP_X9_63_SHA256 operation. The maximum size of this buffer is DN_KEM_D_MAX_CTX_LEN. If not used, fill with zeros.
DWORD dwType |
Type of key generated in the HSM. Select if you are using DN_KEM_OP_DIRECT_KEY or DN_KEM_OP_X9_63_SHA256. The key can be symmetric, HMAC or CSP (Critical Security Parameter). In the case of CSP (Critical Security Parameter) it will have the size of the shared secret, see bOp. See options in DGenerateKey(). If not used, it should be 0.
DWORD dwAttr |
Attributes of the created key. See DGenerateKey(). If not used, must be 0.