1 // This file was extracted from the TCG Published
2 // Trusted Platform Module Library
3 // Part 4: Supporting Routines
4 // Family "2.0"
5 // Level 00 Revision 01.16
6 // October 30, 2014
7 
8 #ifndef        _CRYPTDATAECC_H_
9 #define        _CRYPTDATAECC_H_
10 //
11 //     Structure for the curve parameters. This is an analog to the TPMS_ALGORITHM_DETAIL_ECC
12 //
13 typedef struct {
14    const TPM2B     *p;         // a prime number
15    const TPM2B     *a;         // linear coefficient
16    const TPM2B     *b;         // constant term
17    const TPM2B     *x;         // generator x coordinate
18    const TPM2B     *y;         // generator y coordinate
19    const TPM2B     *n;         // the order of the curve
20    const TPM2B     *h;         // cofactor
21 } ECC_CURVE_DATA;
22 typedef struct
23 {
24    TPM_ECC_CURVE            curveId;
25    UINT16                   keySizeBits;
26    TPMT_KDF_SCHEME          kdf;
27    TPMT_ECC_SCHEME          sign;
28    const ECC_CURVE_DATA    *curveData; // the address of the curve data
29 } ECC_CURVE;
30 extern const ECC_CURVE_DATA SM2_P256;
31 extern const ECC_CURVE_DATA NIST_P256;
32 extern const ECC_CURVE_DATA BN_P256;
33 extern const ECC_CURVE eccCurves[];
34 extern const UINT16 ECC_CURVE_COUNT;
35 #endif
36