 |
AM64x MCU+ SDK
12.00.00
|
|
Go to the documentation of this file.
59 #if defined (SOC_AM64X) || defined (SOC_AM243X)\
60 || defined(SOC_AM263X) || defined(SOC_AM263PX)\
61 || defined (SOC_AM273X) || defined (SOC_AWR294X)
62 #include <security_common/drivers/crypto/pka/pka.h>
65 #if defined(SOC_F29H85X) || defined (SOC_AM261X) || defined(SOC_F29P32X)
66 #include <security_common/drivers/crypto/pke/hw_include/pke_hw/inc/pke.h>
67 #include <security_common/drivers/crypto/pke/hw_include/pke_hw/src/pke4_driver.h>
68 #include <security_common/drivers/crypto/pke/hw_include/pke_hw/inc/pke_dpasl.h>
87 typedef enum AsymCrypt_Return_e
100 typedef enum AsymCrypt_EdCurve_e
110 #define RSA_MAX_LENGTH (130U)
113 #define ECDSA_MAX_LENGTH (18U)
119 #define EC_PARAM_MAXLEN (68U)
124 #define ASYM_CRYPT_LEN(bytelen) (((bytelen) / 4U) + 1U)
127 #define RSA_KEY_E_MAXLEN (8U)
129 #define RSA_KEY_N_MAXLEN (520U)
131 #define RSA_KEY_PQ_MAXLEN ((RSA_KEY_N_MAXLEN / 2U) + 4U)
133 #define RSA_SIG_MAXLEN (RSA_KEY_N_MAXLEN)
136 #define EDDSA_MAX_KEY_LEN (57U)
139 #define EDDSA_MAX_BIGINT_LEN (ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN - 1U))
142 #define EDDSA_ED25519_KEY_LEN (32U)
145 #define EDDSA_ED448_KEY_LEN (57U)
148 #define EDDSA_ED25519_HASH_LEN (64U)
151 #define EDDSA_ED448_HASH_LEN (114U)
154 #define DEVTYPE_HSSE (0x0AU)
441 uint32_t keybitsize);
458 uint32_t keybitsize);
574 const uint8_t *ptrData,
575 const uint32_t dataSizeByte,
597 const uint8_t *ptrData,
598 const uint32_t dataSizeByte,
AsymCrypt_Return_t(* AsymCrypt_ExecuteShaCallback)(uint8_t *in_addr, uint32_t length, uint8_t *sha_addr)
This callback implemented to configure a SHA for EDDSA algorithms.
Definition: asym_crypt.h:373
AsymCrypt_Return_t AsymCrypt_EcdhGenSharedSecret(AsymCrypt_Handle handle, const struct AsymCrypt_ECPrimeCurveP *cp, const uint32_t priv[ECDSA_MAX_LENGTH], const struct AsymCrypt_ECPoint *pubKey, struct AsymCrypt_ECPoint *ecShSecret, uint32_t curveType)
ECDH shared secret generation function.
uint32_t d[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:312
uint32_t n[ASYM_CRYPT_LEN(RSA_KEY_N_MAXLEN)]
Definition: asym_crypt.h:189
uint32_t e[ASYM_CRYPT_LEN(RSA_KEY_E_MAXLEN)]
Definition: asym_crypt.h:191
uint32_t b[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:236
#define RSA_KEY_N_MAXLEN
Definition: asym_crypt.h:129
AsymCrypt_Return_t AsymCrypt_close(AsymCrypt_Handle handle)
Function to close a AsymCrypt module specified by the AsymCrypt handle.
@ ASYM_CRYPT_RETURN_SUCCESS
Definition: asym_crypt.h:89
uint32_t n[ASYM_CRYPT_LEN(RSA_KEY_N_MAXLEN)]
Definition: asym_crypt.h:169
uint8_t R[EDDSA_MAX_KEY_LEN]
Definition: asym_crypt.h:325
uint32_t s[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:276
uint16_t index
Definition: tisci_rm_proxy.h:3
#define ECDSA_MAX_LENGTH
Definition: asym_crypt.h:113
uint32_t prime[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:230
uint32_t prime[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:304
uint32_t order[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:232
SM2DSA signature.
Definition: asym_crypt.h:349
AsymCrypt_Return_t AsymCrypt_ECDSAKeyGenPublic(AsymCrypt_Handle handle, const struct AsymCrypt_ECPrimeCurveP *cp, struct AsymCrypt_ECPoint *pub, const uint32_t priv[ECDSA_MAX_LENGTH], uint32_t curveType)
ECDSA KeyGen Public Key function.
uint32_t B[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:261
uint32_t coefficient[ASYM_CRYPT_LEN(RSA_KEY_PQ_MAXLEN)]
Definition: asym_crypt.h:203
uint32_t prime[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:253
This file contains the prototype of crypto_util driver APIs.
uint32_t r[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:274
uint32_t x[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:214
#define RSA_KEY_E_MAXLEN
Definition: asym_crypt.h:127
uint8_t s[EDDSA_MAX_KEY_LEN]
Definition: asym_crypt.h:327
RSA public key. All values are in biginteger format (size followed by word value array,...
Definition: asym_crypt.h:167
uint32_t a[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:234
uint32_t q[ASYM_CRYPT_LEN(RSA_KEY_PQ_MAXLEN)]
Definition: asym_crypt.h:197
Point on Eddsa Elliptical Curve.
Definition: asym_crypt.h:285
AsymCrypt_Return_t AsymCrypt_SM2DSAKeyGenPublic(AsymCrypt_Handle handle, struct AsymCrypt_ECPoint *pub, const uint32_t priv[ECDSA_MAX_LENGTH])
SM2DSA KeyGen Public Key function.
AsymCrypt_Return_t AsymCrypt_SM2DSAVerify(AsymCrypt_Handle handle, const struct AsymCrypt_ECPoint *pub, const struct AsymCrypt_SM2DSASig *sig, const uint32_t h[ECDSA_MAX_LENGTH])
SM2DSA verify primitive function.
AsymCrypt_Return_t AsymCrypt_RSAKeyGenPublic(AsymCrypt_Handle handle, const struct AsymCrypt_RSAPrivkey *privKey, struct AsymCrypt_RSAPubkey *pubKey, uint32_t keybitsize)
This Function performs Encryption or Verification operations.
AsymCrypt_Return_t AsymCrypt_EddsaSign(AsymCrypt_Handle handle, AsymCrypt_ExecuteShaCallback shaCbFxn, const struct AsymCrypt_EddsaKey *key, const uint8_t *ptrData, const uint32_t dataSizeByte, struct AsymCrypt_EddsaSig *sig, AsymCrypt_EdCurveType_t input_curve)
EDDSA Signing primitive function.
uint32_t x[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:287
#define RSA_KEY_PQ_MAXLEN
Definition: asym_crypt.h:131
uint32_t A[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:259
uint32_t order[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:306
void * AsymCrypt_Handle
Handle to the AsymCrypt driver.
Definition: asym_crypt.h:107
AsymCrypt_Return_t AsymCrypt_SM2DSASign(AsymCrypt_Handle handle, const uint32_t priv[ECDSA_MAX_LENGTH], const uint32_t k[ECDSA_MAX_LENGTH], const uint32_t h[ECDSA_MAX_LENGTH], struct AsymCrypt_SM2DSASig *sig)
SM2DSA sign primitive function.
uint32_t s[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:353
struct AsymCrypt_ECPoint g
Definition: asym_crypt.h:263
AsymCrypt_Return_t AsymCrypt_EddsaVerify(AsymCrypt_Handle handle, AsymCrypt_ExecuteShaCallback shaCbFxn, const uint8_t pubKey[EDDSA_MAX_KEY_LEN], const uint8_t *ptrData, const uint32_t dataSizeByte, const struct AsymCrypt_EddsaSig *sig, AsymCrypt_EdCurveType_t input_curve)
ECDSA verify primitive function.
AsymCrypt_Return_t AsymCrypt_RSAKeyGenPrivate(AsymCrypt_Handle handle, struct AsymCrypt_RSAPrivkey *k, uint32_t keybitsize)
This Function performs Encryption or Verification operations.
uint32_t p[ASYM_CRYPT_LEN(RSA_KEY_PQ_MAXLEN)]
Definition: asym_crypt.h:195
EC Point, also the public key.
Definition: asym_crypt.h:212
@ ASYM_CRYPT_CURVE_TYPE_EDDSA_448
Definition: asym_crypt.h:103
uint8_t pubKey[EDDSA_MAX_KEY_LEN]
Definition: asym_crypt.h:340
uint32_t r[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:351
struct AsymCrypt_EddsaPoint g
Definition: asym_crypt.h:314
AsymCrypt_Return_t AsymCrypt_ECDSASign(AsymCrypt_Handle handle, const struct AsymCrypt_ECPrimeCurveP *cp, const uint32_t priv[ECDSA_MAX_LENGTH], const uint32_t k[ECDSA_MAX_LENGTH], const uint32_t h[ECDSA_MAX_LENGTH], struct AsymCrypt_ECDSASig *sig, uint32_t curveId)
ECDSA sign primitive function.
AsymCrypt_Return_t AsymCrypt_RSAPublic(AsymCrypt_Handle handle, const uint32_t m[RSA_MAX_LENGTH], const struct AsymCrypt_RSAPubkey *k, uint32_t result[RSA_MAX_LENGTH])
This Function performs Encryption or Verification operations.
uint32_t y[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:289
uint32_t order[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:255
AsymCrypt_Return_t AsymCrypt_SM2DSAKeyGenPrivate(AsymCrypt_Handle handle, uint32_t priv[ECDSA_MAX_LENGTH])
SM2DSA KeyGen Private Key function.
#define EDDSA_MAX_KEY_LEN
Definition: asym_crypt.h:136
uint32_t e[ASYM_CRYPT_LEN(RSA_KEY_E_MAXLEN)]
Definition: asym_crypt.h:171
uint8_t privKey[EDDSA_MAX_KEY_LEN]
Definition: asym_crypt.h:338
uint32_t cofactor[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:308
uint32_t y[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:216
AsymCrypt_Return_t
ASYM CRYPTO Driver Error code.
Definition: asym_crypt.h:88
Eddsa EDDSA Private key - Public key pair in uint8 array form.
Definition: asym_crypt.h:336
struct AsymCrypt_ECPoint g
Definition: asym_crypt.h:238
uint32_t dq[ASYM_CRYPT_LEN(RSA_KEY_PQ_MAXLEN)]
Definition: asym_crypt.h:201
RSA private key. All values are in biginteger format (size followed by word value array,...
Definition: asym_crypt.h:187
uint32_t cofactor[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:257
AsymCrypt_Return_t AsymCrypt_ECDSAVerify(AsymCrypt_Handle handle, const struct AsymCrypt_ECPrimeCurveP *cp, const struct AsymCrypt_ECPoint *pub, const struct AsymCrypt_ECDSASig *sig, const uint32_t h[ECDSA_MAX_LENGTH], uint32_t curveId)
ECDSA verify primitive function.
Eddsa EDDSA signature.
Definition: asym_crypt.h:323
AsymCrypt_Handle AsymCrypt_open(uint32_t index)
Function to Open AsymCrypt instance, enable AsymCrypt engine, Initialize clocks.
#define ASYM_CRYPT_LEN(bytelen)
Definition: asym_crypt.h:124
Structure to hold Edward Curve Eddsa parameters.
Definition: asym_crypt.h:302
AsymCrypt_Return_t AsymCrypt_EddsaGetPubKey(AsymCrypt_Handle handle, AsymCrypt_ExecuteShaCallback shaCbFxn, uint8_t privKey[EDDSA_MAX_KEY_LEN], uint8_t pubKey[EDDSA_MAX_KEY_LEN], AsymCrypt_EdCurveType_t input_curve)
ECDSA KeyGen Public Key function.
@ ASYM_CRYPT_CURVE_TYPE_EDDSA_25519
Definition: asym_crypt.h:102
EC prime curve parameters.
Definition: asym_crypt.h:228
EC Montogomery curve parameters.
Definition: asym_crypt.h:251
AsymCrypt_Return_t AsymCrypt_RSAPrivate(AsymCrypt_Handle handle, const uint32_t m[RSA_MAX_LENGTH], const struct AsymCrypt_RSAPrivkey *k, uint32_t result[RSA_MAX_LENGTH])
This Function performs Decryption or Signing operations.
uint32_t dp[ASYM_CRYPT_LEN(RSA_KEY_PQ_MAXLEN)]
Definition: asym_crypt.h:199
@ ASYM_CRYPT_RETURN_FAILURE
Definition: asym_crypt.h:90
#define RSA_MAX_LENGTH
Definition: asym_crypt.h:110
ECDSA signature.
Definition: asym_crypt.h:272
#define EC_PARAM_MAXLEN
Definition: asym_crypt.h:119
AsymCrypt_EdCurveType_t
ASYM EDDSA Curve Type.
Definition: asym_crypt.h:101
uint32_t d[ASYM_CRYPT_LEN(RSA_KEY_N_MAXLEN)]
Definition: asym_crypt.h:193
AsymCrypt_Return_t AsymCrypt_ECDSAKeyGenPrivate(AsymCrypt_Handle handle, const struct AsymCrypt_ECPrimeCurveP *cp, uint32_t priv[ECDSA_MAX_LENGTH], uint32_t curveType)
ECDSA KeyGen Private Key function.
uint32_t a[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:310