File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / strongswan / src / libtpmtss / tpm_tss_tss2_names_v1.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 17 00:20:08 2021 UTC (3 years, 5 months ago) by misho
Branches: strongswan, MAIN
CVS tags: v5_9_2p0, HEAD
strongswan 5.9.2

    1: /*
    2:  * Copyright (C) 2016-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: #include "tpm_tss_tss2_names.h"
   17: 
   18: #ifdef TSS_TSS2_V1
   19: 
   20: #include <tpm20.h>
   21: 
   22: #ifndef TPM_ALG_ECMQV
   23: #define TPM_ALG_ECMQV		(TPM_ALG_ID)0x001D
   24: #endif
   25: 
   26: #ifndef TPM_ALG_CAMELLIA
   27: #define TPM_ALG_CAMELLIA	(TPM_ALG_ID)0x0026
   28: #endif
   29: 
   30: /**
   31:  * TPM 2.0 algorithm ID names
   32:  */
   33: ENUM_BEGIN(tpm_alg_id_names, TPM_ALG_ERROR, TPM_ALG_RSA,
   34: 	"ERROR",
   35: 	"RSA"
   36: );
   37: ENUM_NEXT(tpm_alg_id_names, TPM_ALG_SHA1, TPM_ALG_KEYEDHASH, TPM_ALG_RSA,
   38: 	"SHA1",
   39: 	"HMAC",
   40: 	"AES",
   41: 	"MGF1",
   42: 	"KEYEDHASH"
   43: );
   44: ENUM_NEXT(tpm_alg_id_names, TPM_ALG_XOR, TPM_ALG_SHA512, TPM_ALG_KEYEDHASH,
   45: 	"XOR",
   46: 	"SHA256",
   47: 	"SHA384",
   48: 	"SHA512"
   49: );
   50: ENUM_NEXT(tpm_alg_id_names, TPM_ALG_NULL, TPM_ALG_NULL, TPM_ALG_SHA512,
   51: 	"NULL"
   52: );
   53: ENUM_NEXT(tpm_alg_id_names, TPM_ALG_SM3_256, TPM_ALG_ECMQV, TPM_ALG_NULL,
   54: 	"SM3_256",
   55: 	"SM4",
   56: 	"RSASSA",
   57: 	"RSAES",
   58: 	"RSAPSS",
   59: 	"OAEP",
   60: 	"ECDSA",
   61: 	"ECDH",
   62: 	"ECDAA",
   63: 	"SM2",
   64: 	"ECSCHNORR",
   65: 	"ECMQV"
   66: );
   67: ENUM_NEXT(tpm_alg_id_names, TPM_ALG_KDF1_SP800_56A, TPM_ALG_ECC, TPM_ALG_ECMQV,
   68: 	"KDF1_SP800_56A",
   69: 	"KDF2",
   70: 	"KDF1_SP800_108",
   71: 	"ECC"
   72: );
   73: ENUM_NEXT(tpm_alg_id_names, TPM_ALG_SYMCIPHER, TPM_ALG_CAMELLIA, TPM_ALG_ECC,
   74: 	"SYMCIPHER",
   75: 	"CAMELLIA"
   76: );
   77: ENUM_NEXT(tpm_alg_id_names, TPM_ALG_CTR, TPM_ALG_ECB, TPM_ALG_CAMELLIA,
   78: 	"CTR",
   79: 	"OFB",
   80: 	"CBC",
   81: 	"CFB",
   82: 	"ECB"
   83: );
   84: ENUM_END(tpm_alg_id_names, TPM_ALG_ECB);
   85: 
   86: /**
   87:  * TPM 2.0 ECC curve names
   88:  */
   89: ENUM_BEGIN(tpm_ecc_curve_names, TPM_ECC_NONE, TPM_ECC_NIST_P521,
   90: 	"NONE",
   91: 	"NIST_P192",
   92: 	"NIST_P224",
   93: 	"NIST_P256",
   94: 	"NIST_P384",
   95: 	"NIST_P521"
   96: );
   97: ENUM_NEXT(tpm_ecc_curve_names, TPM_ECC_BN_P256, TPM_ECC_BN_P638, TPM_ECC_NIST_P521,
   98: 	"BN_P256",
   99: 	"BN_P638"
  100: );
  101: ENUM_NEXT(tpm_ecc_curve_names, TPM_ECC_SM2_P256, TPM_ECC_SM2_P256, TPM_ECC_BN_P638,
  102: 	"SM2_P256"
  103: );
  104: ENUM_END(tpm_ecc_curve_names, TPM_ECC_SM2_P256);
  105: 
  106: #else /* TSS_TSS2_V1 */
  107: 
  108: #ifndef TSS_TSS2_V2
  109: 
  110: /**
  111:  * TPM 2.0 algorithm ID names
  112:  */
  113: ENUM(tpm_alg_id_names, 0, 0,
  114: 	"ERROR"
  115: );
  116: 
  117: /**
  118:  * TPM 2.0 ECC curve names
  119:  */
  120: ENUM(tpm_ecc_curve_names, 0, 0,
  121: 	"NONE"
  122: );
  123: 
  124: #endif /* !TSS_TSS2_V2 */
  125: 
  126: #endif /* TSS_TSS2_V1 */
  127: 
  128: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>