libtpmtss: Support for TSS2 v2 libraries
[strongswan.git] / src / libtpmtss / tpm_tss_tss2_names_v2.c
1 /*
2 * Copyright (C) 2018 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 #ifdef TSS_TSS2_V2
17
18 #include "tpm_tss_tss2_names.h"
19
20 #include <tss2/tss2_sys.h>
21
22 /**
23 * TPM 2.0 algorithm ID names
24 */
25 ENUM_BEGIN(tpm_alg_id_names, TPM2_ALG_ERROR, TPM2_ALG_RSA,
26 "ERROR",
27 "RSA"
28 );
29 ENUM_NEXT(tpm_alg_id_names, TPM2_ALG_SHA1, TPM2_ALG_KEYEDHASH, TPM2_ALG_RSA,
30 "SHA1",
31 "HMAC",
32 "AES",
33 "MGF1",
34 "KEYEDHASH"
35 );
36 ENUM_NEXT(tpm_alg_id_names, TPM2_ALG_XOR, TPM2_ALG_SHA512, TPM2_ALG_KEYEDHASH,
37 "XOR",
38 "SHA256",
39 "SHA384",
40 "SHA512"
41 );
42 ENUM_NEXT(tpm_alg_id_names, TPM2_ALG_NULL, TPM2_ALG_NULL, TPM2_ALG_SHA512,
43 "NULL"
44 );
45 ENUM_NEXT(tpm_alg_id_names, TPM2_ALG_SM3_256, TPM2_ALG_ECMQV, TPM2_ALG_NULL,
46 "SM3_256",
47 "SM4",
48 "RSASSA",
49 "RSAES",
50 "RSAPSS",
51 "OAEP",
52 "ECDSA",
53 "ECDH",
54 "SM2",
55 "ECSCHNORR",
56 "ECMQV"
57 );
58 ENUM_NEXT(tpm_alg_id_names, TPM2_ALG_KDF1_SP800_56A, TPM2_ALG_ECC, TPM2_ALG_ECMQV,
59 "KDF1_SP800_56A",
60 "KDF2",
61 "KDF1_SP800_108",
62 "ECC"
63 );
64 ENUM_NEXT(tpm_alg_id_names, TPM2_ALG_SYMCIPHER, TPM2_ALG_CAMELLIA, TPM2_ALG_ECC,
65 "SYMCIPHER",
66 "CAMELLIA"
67 );
68 ENUM_NEXT(tpm_alg_id_names, TPM2_ALG_CTR, TPM2_ALG_ECB, TPM2_ALG_CAMELLIA,
69 "CTR",
70 "OFB",
71 "CBC",
72 "CFB",
73 "ECB"
74 );
75 ENUM_END(tpm_alg_id_names, TPM2_ALG_ECB);
76
77 /**
78 * TPM 2.0 ECC curve names
79 */
80 ENUM_BEGIN(tpm_ecc_curve_names, TPM2_ECC_NONE, TPM2_ECC_NIST_P521,
81 "NONE",
82 "NIST_P192",
83 "NIST_P224",
84 "NIST_P256",
85 "NIST_P384",
86 "NIST_P521"
87 );
88 ENUM_NEXT(tpm_ecc_curve_names, TPM2_ECC_BN_P256, TPM2_ECC_BN_P638, TPM2_ECC_NIST_P521,
89 "BN_P256",
90 "BN_P638"
91 );
92 ENUM_NEXT(tpm_ecc_curve_names, TPM2_ECC_SM2_P256, TPM2_ECC_SM2_P256, TPM2_ECC_BN_P638,
93 "SM2_P256"
94 );
95 ENUM_END(tpm_ecc_curve_names, TPM2_ECC_SM2_P256);
96
97 #endif /* TSS_TSS2_V2 */
98