From: Dmitry Eremin-Solenikov Date: Mon, 7 Oct 2019 13:17:53 +0000 (+0300) Subject: common: add Russian PKCS#11 extensions to pkcs11x.h header X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b33efaa82848bac7fd73888963a106cf4c03151;p=p11-kit common: add Russian PKCS#11 extensions to pkcs11x.h header Add values defined to support Russian GOST cryptography to pkcs11x.h header. Signed-off-by: Dmitry Eremin-Solenikov --- diff --git a/common/pkcs11x.h b/common/pkcs11x.h index d5e1d74..b6cd909 100644 --- a/common/pkcs11x.h +++ b/common/pkcs11x.h @@ -143,6 +143,42 @@ typedef CK_ULONG CK_TRUST; #endif /* CRYPTOKI_X_VENDOR_DEFINED */ +/* Define this if you want the vendor specific symbols */ +#define CRYPTOKI_RU_TEAM_TC26_VENDOR_DEFINED 1 +#ifdef CRYPTOKI_RU_TEAM_TC26_VENDOR_DEFINED + +/* See https://tc26.ru/standarts/perevody/guidelines-the-pkcs-11-extensions-for-implementing-the-gost-r-34-10-2012-and-gost-r-34-11-2012-russian-standards-.html */ + +#define NSSCK_VENDOR_PKCS11_RU_TEAM 0xD4321000 /* 0x80000000 | 0x54321000 */ +#define CK_VENDOR_PKCS11_RU_TEAM_TC26 NSSCK_VENDOR_PKCS11_RU_TEAM + +/* GOST KEY TYPES */ +#define CKK_GOSTR3410_512 (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x003) +#define CKK_KUZNECHIK (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x004) +#define CKK_MAGMA (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x005) + +/* PKCS #5 PRF Functions */ +#define CKP_PKCS5_PBKD2_HMAC_GOSTR3411_2012_512 (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x003) + +/* GOST MECHANISMS */ +#define CKM_GOSTR3410_512_KEY_PAIR_GEN (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x005) +#define CKM_GOSTR3410_512 (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x006) +#define CKM_GOSTR3410_2012_DERIVE (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x007) +#define CKM_GOSTR3410_WITH_GOSTR3411_2012_256 (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x008) +#define CKM_GOSTR3410_WITH_GOSTR3411_2012_512 (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x009) +#define CKM_GOSTR3410_PUBLIC_KEY_DERIVE (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x00A) +#define CKM_GOSTR3411_2012_256 (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x012) +#define CKM_GOSTR3411_2012_512 (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x013) +#define CKM_GOSTR3411_2012_256_HMAC (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x014) +#define CKM_GOSTR3411_2012_512_HMAC (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x015) +#define CKM_TLS_GOST_PRF_2012_256 (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x016) +#define CKM_TLS_GOST_PRF_2012_512 (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x017) +#define CKM_TLS_GOST_MASTER_KEY_DERIVE_2012_256 (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x018) +#define CKM_KDF_4357 (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x025) +#define CKM_KDF_GOSTR3411_2012_256 (CK_VENDOR_PKCS11_RU_TEAM_TC26 |0x026) + +#endif /* CRYPTOKI_RU_TEAM_TC26_VENDOR_DEFINED */ + #if defined(__cplusplus) } #endif