blob: 7d31caa91b771f3da841755eed3ce44eb808634f [file] [log] [blame]
Vadim Bendebury56797522015-05-20 10:32:25 -07001// 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//
13typedef 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;
22typedef 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;
30extern const ECC_CURVE_DATA SM2_P256;
31extern const ECC_CURVE_DATA NIST_P256;
32extern const ECC_CURVE_DATA BN_P256;
33extern const ECC_CURVE eccCurves[];
34extern const UINT16 ECC_CURVE_COUNT;
35#endif