39 #ifndef ti_drivers_cryptoutils_ecc_ECCParams__include 40 #define ti_drivers_cryptoutils_ecc_ECCParams__include 47 #include <ti/devices/DeviceFamily.h> 49 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) 65 #define ECCParams_STATUS_SUCCESS (0) 73 #define ECCParams_STATUS_ERROR (-1) 103 #define ECCParams_CURVE_TYPE_NONE 0U 104 #define ECCParams_CURVE_TYPE_SHORT_WEIERSTRASS_AN3 1U 105 #define ECCParams_CURVE_TYPE_SHORT_WEIERSTRASS_GEN 2U 106 #define ECCParams_CURVE_TYPE_MONTGOMERY 3U 107 #define ECCParams_CURVE_TYPE_EDWARDS 4U 135 #if (TFM_ENABLED == 0) || defined(TFM_BUILD) 164 ECCParams_SecureCurve secureCurve;
169 #if defined(TFM_BUILD) 176 typedef struct ECCParams_ns_CurveParams
178 ECCParams_SecureCurve secureCurve;
179 } ECCParams_ns_CurveParams;
264 #define ECC_LENGTH_PREFIX_BYTES 4 266 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC23X0) || (DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) 277 #define ECCParams_NISTP256_LENGTH 32 283 #define ECC_NISTP256_PARAM_LENGTH_WITH_PREFIX_BYTES (ECCParams_NISTP256_LENGTH + ECC_LENGTH_PREFIX_BYTES) 351 #define ECCParams_NISTP224_LENGTH 28 357 #define ECC_NISTP224_PARAM_LENGTH_WITH_PREFIX_BYTES (ECCParams_NISTP224_LENGTH + ECC_LENGTH_PREFIX_BYTES) 418 #define OCTET_STRING_OFFSET 1 421 #define OCTET_STRING_PREFIX 0x04 424 #define ECC_LENGTH_OFFSET_BYTES 4 427 #define ECC_PARAM_LENGTH_WITH_OFFSET_BYTES (ECCParams_NISTP256_LENGTH + ECC_LENGTH_OFFSET_BYTES) 444 #define ECCParams_CURVE25519_LENGTH 32 455 #define ECC_CURVE25519_LENGTH_WITH_PREFIX_BYTES (ECCParams_CURVE25519_LENGTH + ECC_LENGTH_PREFIX_BYTES) 503 #define ECCParams_FormatCurve25519PrivateKey ECCParams_formatCurve25519PrivateKey Union to access ECC_NISTP256 curve params in bytes or words.
Definition: ECCParams.h:288
uint32_t ECCParams_CurveType
Enumeration of curve equations supported.
Definition: ECCParams.h:101
The CryptoKey type is an opaque representation of a cryptographic key.
const uint8_t cofactor
Definition: ECCParams.h:150
ECCParams_SecureCurve
Enumeration of ECC curve names supported by TF-M.
Definition: ECCParams.h:112
Union to access ECC_NISTP256 curve params in bytes or words.
Definition: ECCParams.h:362
const ECC_NISTP224_Param ECC_NISTP224_b_mont
'b' in Montgomery domain of the ECC_NISTP224 curve.
const uint8_t * prime
Definition: ECCParams.h:146
const ECC_NISTP224_Param ECC_NISTP224_a
'a' constant of the ECC_NISTP224 curve when expressed in short Weierstrass form (y^2 = x^3 + a*x + b)...
Definition: ECCParams.h:123
const ECCParams_CurveType curveType
Definition: ECCParams.h:145
Definition: ECCParams.h:127
const ECC_NISTP256_Param ECC_NISTP256_generatorY
Y coordinate of the generator point of the ECC_NISTP256 curve.
const ECCParams_CurveParams ECCParams_BrainpoolP512R1
The BrainpoolP512R1 curve in short Weierstrass form.
const ECCParams_CurveParams ECCParams_Wei25519
A short Weierstrass equivalent representation of Ed25519.
const ECCParams_CurveParams ECCParams_NISTP384
The NISTP384 curve in short Weierstrass form.
CryptoKey datastructure.
Definition: CryptoKey.h:208
const uint8_t * order
Definition: ECCParams.h:149
const ECCParams_CurveParams ECCParams_NISTP192
The NISTP192 curve in short Weierstrass form.
const ECC_Curve25519_Param ECC_Curve25519_generatorX
X coordinate of the generator point of the ECC_Curve25519 curve.
const ECCParams_CurveParams ECCParams_BrainpoolP256R1
The BrainpoolP256R1 curve in short Weierstrass form.
const uint8_t * b
Definition: ECCParams.h:148
const ECC_NISTP256_Param ECC_NISTP256_a
'a' constant of the ECC_NISTP256 curve when expressed in short Weierstrass form (y^2 = x^3 + a*x + b)...
const ECCParams_CurveParams ECCParams_NISTP256
The NISTP256 curve in short Weierstrass form.
const ECC_NISTP256_Param ECC_NISTP256_generatorX
X coordinate of the generator point of the ECC_NISTP256 curve.
const ECC_Curve25519_Param ECC_Curve25519_prime
Prime of the generator point of the ECC_Curve25519 curve.
const ECC_Curve25519_Param ECC_Curve25519_b
'b' constant of the ECC_Curve25519 curve when expressed in short Weierstrass form (y^2 = x^3 + a*x + ...
const ECC_NISTP224_Param ECC_NISTP224_prime
Prime of the generator point of the ECC_NISTP224 curve.
#define ECC_PARAM_LENGTH_WITH_OFFSET_BYTES
Definition: ECCParams.h:427
const ECC_NISTP256_Param ECC_NISTP256_prime
Prime of the generator point of the ECC_NISTP256 curve.
Definition: ECCParams.h:119
const ECC_NISTP224_Param ECC_NISTP224_a_mont
'a' in Montgomery domain of the ECC_NISTP224 curve.
int_fast16_t ECCParams_getUncompressedGeneratorPoint(const ECCParams_CurveParams *curveParams, uint8_t *buffer, size_t length)
Extracts the curve generator point from an ecliptic curve description.
int_fast16_t ECCParams_formatCurve25519PrivateKey(CryptoKey *myPrivateKey)
Formats a CryptoKey to conform to Curve25519 private key requirements.
const uint8_t * generatorX
Definition: ECCParams.h:152
const ECC_NISTP256_Param ECC_NISTP256_order
Order of the generator point of the ECC_NISTP256 curve.
Definition: ECCParams.h:126
Definition: ECCParams.h:121
Definition: ECCParams.h:118
const ECC_NISTP224_Param ECC_NISTP224_b
'b' constant of the ECC_NISTP224 curve when expressed in short Weierstrass form (y^2 = x^3 + a*x + b)...
const uint8_t * a
Definition: ECCParams.h:147
Definition: ECCParams.h:128
const ECC_Curve25519_Param ECC_Curve25519_order
Order of the generator point of the ECC_Curve25519 curve.
Union to access ECC_Curve25519 curve params in bytes or words.
Definition: ECCParams.h:460
const ECCParams_CurveParams ECCParams_Curve25519
The Curve25519 curve in Montgomery form.
Union to format inputs to ECC library.
Definition: ECCParams.h:432
const ECC_NISTP224_Param ECC_NISTP224_k_mont
'k' in Montgomery domain of the ECC_NISTP224 curve.
const ECC_NISTP256_Param ECC_NISTP256_k_mont
'k' in Montgomery domain of the ECC_NISTP256 curve.
#define ECC_NISTP224_PARAM_LENGTH_WITH_PREFIX_BYTES
Length in bytes of NISTP256 curve parameters including the prepended length word. ...
Definition: ECCParams.h:357
const size_t length
Definition: ECCParams.h:151
A structure containing the parameters of an elliptic curve.
Definition: ECCParams.h:143
Definition: ECCParams.h:125
const ECC_NISTP256_Param ECC_NISTP256_b
'b' constant of the ECC_NISTP256 curve when expressed in short Weierstrass form (y^2 = x^3 + a*x + b)...
const ECCParams_CurveParams ECCParams_BrainpoolP384R1
The BrainpoolP384R1 curve in short Weierstrass form.
const ECC_NISTP224_Param ECC_NISTP224_generatorX
X coordinate of the generator point of the ECC_NISTP224 curve.
Definition: ECCParams.h:120
const ECC_Curve25519_Param ECC_Curve25519_a
'a' constant of the ECC_Curve25519 curve when expressed in short Weierstrass form (y^2 = x^3 + a*x + ...
const ECCParams_CurveParams ECCParams_NISTP224
The NISTP224 curve in short Weierstrass form.
const ECCParams_CurveParams ECCParams_Ed25519
The Ed25519 curve in Edwards form.
struct ECCParams_CurveParams ECCParams_CurveParams
A structure containing the parameters of an elliptic curve.
#define ECC_CURVE25519_LENGTH_WITH_PREFIX_BYTES
Length in bytes of Curve25519 curve parameters including the prepended length word.
Definition: ECCParams.h:455
Definition: ECCParams.h:122
Definition: ECCParams.h:124
#define ECC_NISTP256_PARAM_LENGTH_WITH_PREFIX_BYTES
Length in bytes of NISTP256 curve parameters including the prepended length word. ...
Definition: ECCParams.h:283
const ECC_NISTP256_Param ECC_NISTP256_b_mont
'b' in Montgomery domain of the ECC_NISTP256 curve.
const ECC_NISTP224_Param ECC_NISTP224_generatorY
Y coordinate of the generator point of the ECC_NISTP224 curve.
const uint8_t * generatorY
Definition: ECCParams.h:153
const ECC_NISTP224_Param ECC_NISTP224_order
Order of the generator point of the ECC_NISTP224 curve.
const ECC_Curve25519_Param ECC_Curve25519_generatorY
Y coordinate of the generator point of the ECC_Curve25519 curve.
const ECC_NISTP256_Param ECC_NISTP256_a_mont
'a' in Montgomery domain of the ECC_NISTP256 curve.
const ECCParams_CurveParams ECCParams_NISTP521
The NISTP521 curve in short Weierstrass form.