A Example header file¶
The API elements in this specification, once finalized, will be defined in psa/crypto.h
.
This is an example of the header file definition of the PAKE API elements. This can be used as a starting point or reference for an implementation.
Note
Not all of the API elements are fully defined. An implementation must provide the full definition.
The header will not compile without these missing definitions, and might require reordering to satisfy C compilation rules.
A.1 psa/crypto.h¶
/* This file contains reference definitions for implementation of the * PSA Certified Crypto API v1.3 PQC Extension beta * * These definitions must be embedded in, or included by, psa/crypto.h */ #define PSA_ALG_SHA_256_192 ((psa_algorithm_t)0x0200000E) #define PSA_ALG_SHAKE128_256 ((psa_algorithm_t)0x02000016) #define PSA_ALG_SHAKE256_192 ((psa_algorithm_t)0x02000017) #define PSA_ALG_SHAKE256_256 ((psa_algorithm_t)0x02000018) #define PSA_KEY_TYPE_ML_KEM_KEY_PAIR ((psa_key_type_t)0x7004) #define PSA_KEY_TYPE_ML_KEM_PUBLIC_KEY ((psa_key_type_t)0x4004) #define PSA_KEY_TYPE_IS_ML_KEM(type) /* specification-defined value */ #define PSA_ALG_ML_KEM ((psa_algorithm_t)0x0c000200) #define PSA_KEY_TYPE_ML_DSA_KEY_PAIR ((psa_key_type_t)0x7002) #define PSA_KEY_TYPE_ML_DSA_PUBLIC_KEY ((psa_key_type_t)0x4002) #define PSA_KEY_TYPE_IS_ML_DSA(type) /* specification-defined value */ #define PSA_ALG_ML_DSA ((psa_algorithm_t) 0x06004400) #define PSA_ALG_DETERMINISTIC_ML_DSA ((psa_algorithm_t) 0x06004500) #define PSA_ALG_HASH_ML_DSA(hash_alg) /* specification-defined value */ #define PSA_ALG_DETERMINISTIC_HASH_ML_DSA(hash_alg) \ /* specification-defined value */ #define PSA_ALG_IS_ML_DSA(alg) /* specification-defined value */ #define PSA_ALG_IS_HASH_ML_DSA(alg) /* specification-defined value */ #define PSA_ALG_IS_DETERMINISTIC_HASH_ML_DSA(alg) \ /* specification-defined value */ #define PSA_ALG_IS_HEDGED_HASH_ML_DSA(alg) /* specification-defined value */ typedef uint8_t psa_slh_dsa_family_t; #define PSA_KEY_TYPE_SLH_DSA_KEY_PAIR(set) /* specification-defined value */ #define PSA_KEY_TYPE_SLH_DSA_PUBLIC_KEY(set) /* specification-defined value */ #define PSA_SLH_DSA_FAMILY_SHA2_S ((psa_slh_dsa_family_t) 0x02) #define PSA_SLH_DSA_FAMILY_SHA2_F ((psa_slh_dsa_family_t) 0x04) #define PSA_SLH_DSA_FAMILY_SHAKE_S ((psa_slh_dsa_family_t) 0x0b) #define PSA_SLH_DSA_FAMILY_SHAKE_F ((psa_slh_dsa_family_t) 0x0d) #define PSA_KEY_TYPE_IS_SLH_DSA(type) /* specification-defined value */ #define PSA_KEY_TYPE_IS_SLH_DSA_KEY_PAIR(type) \ /* specification-defined value */ #define PSA_KEY_TYPE_IS_SLH_DSA_PUBLIC_KEY(type) \ /* specification-defined value */ #define PSA_KEY_TYPE_SLH_DSA_GET_FAMILY(type) /* specification-defined value */ #define PSA_ALG_SLH_DSA ((psa_algorithm_t) 0x06004000) #define PSA_ALG_DETERMINISTIC_SLH_DSA ((psa_algorithm_t) 0x06004100) #define PSA_ALG_HASH_SLH_DSA(hash_alg) /* specification-defined value */ #define PSA_ALG_DETERMINISTIC_HASH_SLH_DSA(hash_alg) \ /* specification-defined value */ #define PSA_ALG_IS_SLH_DSA(alg) /* specification-defined value */ #define PSA_ALG_IS_HASH_SLH_DSA(alg) /* specification-defined value */ #define PSA_ALG_IS_DETERMINISTIC_HASH_SLH_DSA(alg) \ /* specification-defined value */ #define PSA_ALG_IS_HEDGED_HASH_SLH_DSA(alg) /* specification-defined value */ #define PSA_KEY_TYPE_LMS_PUBLIC_KEY ((psa_key_type_t)0x4007) #define PSA_KEY_TYPE_HSS_PUBLIC_KEY ((psa_key_type_t)0x4008) #define PSA_ALG_LMS ((psa_algorithm_t) 0x06004800) #define PSA_ALG_HSS ((psa_algorithm_t) 0x06004900) #define PSA_KEY_TYPE_XMSS_PUBLIC_KEY ((psa_key_type_t)0x400B) #define PSA_KEY_TYPE_XMSS_MT_PUBLIC_KEY ((psa_key_type_t)0x400D) #define PSA_ALG_XMSS ((psa_algorithm_t) 0x06004A00) #define PSA_ALG_XMSS_MT ((psa_algorithm_t) 0x06004B00)