Partager via


BCRYPT_MLKEM_KEY_BLOB structure

Note

Certaines informations concernent un produit de préversion qui peut être sensiblement modifié avant sa publication commerciale. Microsoft n’offre aucune garantie, expresse ou implicite, en ce qui concerne les informations fournies ici. La fonctionnalité décrite dans cette rubrique est disponible dans les versions préliminaires du Windows Insider Preview.

The BCRYPT_MLKEM_KEY_BLOB structure is used as a header for an ML-KEM public key (byte-encoded encapsulation key) or private keyBLOB in memory.

Syntax

typedef struct _BCRYPT_MLKEM_KEY_BLOB {
  ULONG dwMagic;
  ULONG cbParameterSet;             // Byte size of parameterSet[]
  ULONG cbKey;                      // Byte size of key[]
  // WCHAR parameterSet[cbParameterSet / sizeof(WCHAR)];  // Including \0-terminated
  // BYTE key[cbKey];                                     // Key material
} BCRYPT_MLKEM_KEY_BLOB, *PBCRYPT_MLKEM_KEY_BLOB;

Fields

dwMagic

The dwMagic field is a 4-byte value that indicates the format of the key being used. Les valeurs suivantes sont définies :

Value Meaning
BCRYPT_MLKEM_PUBLIC_MAGIC0x504B4C4D La structure représente une clé publique.
BCRYPT_MLKEM_PRIVATE_MAGIC0x524B4C4D La structure représente une clé privée développée.
BCRYPT_MLKEM_PRIVATE_SEED_MAGIC0x534B4C4D La structure représente une valeur initiale privée.

cbParameterSet

The length, in bytes, of the buffer parameterSet directly following the struct. Cette mémoire tampon contient une chaîne Unicode terminée par null qui identifie le jeu de paramètres de la clé. The following values (per FIPS 203) are currently supported:

parameterSet cbParameterSet Meaning
BCRYPT_MLKEM_PARAMETER_SET_512L"512" 8 ML-KEM-512, catégorie de sécurité 1.
BCRYPT_MLKEM_PARAMETER_SET_768L"768" 8 ML-KEM-768, catégorie de sécurité 3.
BCRYPT_MLKEM_PARAMETER_SET_1024L"1024" 10 ML-KEM-1024, catégorie de sécurité 5.

cbKey

The length, in bytes, of the buffer key directly following parameterSet. Cette taille est statique et dépend du format de clé et du jeu de paramètres en cours d’utilisation.

Remarks

BCRYPT_MLKEM_PRIVATE_SEED_BLOB supports import and export of ML-KEM seeds. The blob has dwMagic value BCRYPT_MLKEM_PRIVATE_SEED_MAGIC and the key field contains the KEM seed (defined as the 64-byte concatenation of d || z per FIPS 203), so cbKey is currently always 64.

BCRYPT_MLKEM_PRIVATE_BLOB (also aliased as BCRYPT_MLKEM_DECAPSULATION_BLOB) supports import and export of standard byte-encoded ML-KEM decapsulation keys per FIPS 203. The blob has dwMagic value BCRYPT_MLKEM_PRIVATE_MAGIC and the key field contains the byte-encoded key.

BCRYPT_MLKEM_PUBLIC_BLOB (also aliased as BCRYPT_MLKEM_ENCAPSULATION_BLOB) supports import and export of standard byte-encoded ML-KEM encapsulation keys per FIPS 203. The blob has dwMagic value BCRYPT_MLKEM_PUBLIC_MAGIC and the key field contains the byte-encoded key.

The byte sizes of the byte-encoded keys can be found in FIPS 203 Section 8 Table 3. Many callers can instead dynamically query the required blob sizes using BCryptExportKey with NULLpbOutput.

Requirements

Requirement Value
Client minimum requis Windows Insiders (build 27843) : La prise en charge de ML-KEM commence. [Applications de bureau uniquement]
Serveur minimal pris en charge Windows Insiders (build 27843) : La prise en charge de ML-KEM commence. [Applications de bureau uniquement]
Header bcrypt.h

See also

BCryptGenerateKeyPair

BCryptImportKeyPair

BCryptFinalizeKeyPair

BCryptExportKey

BCryptGetProperty

BCryptSetProperty

BCryptEncapsulate

BCryptDecapsulate