 |
AM64x MCU+ SDK
11.01.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)
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)
425 uint32_t keybitsize);
442 uint32_t keybitsize);
550 const uint8_t *ptrData,
551 const uint32_t dataSizeByte,
573 const uint8_t *ptrData,
574 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:357
uint32_t d[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:309
uint32_t n[ASYM_CRYPT_LEN(RSA_KEY_N_MAXLEN)]
Definition: asym_crypt.h:186
uint32_t e[ASYM_CRYPT_LEN(RSA_KEY_E_MAXLEN)]
Definition: asym_crypt.h:188
uint32_t b[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:233
#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.
AsymCrypt_Return_t AsymCrypt_ECDSAKeyGenPrivate(AsymCrypt_Handle handle, const struct AsymCrypt_ECPrimeCurveP *cp, uint32_t priv[ECDSA_MAX_LENGTH])
ECDSA KeyGen Private Key function.
@ ASYM_CRYPT_RETURN_SUCCESS
Definition: asym_crypt.h:89
uint32_t n[ASYM_CRYPT_LEN(RSA_KEY_N_MAXLEN)]
Definition: asym_crypt.h:166
uint8_t R[EDDSA_MAX_KEY_LEN]
Definition: asym_crypt.h:322
uint32_t s[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:273
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:227
uint32_t prime[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:301
uint32_t order[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:229
uint32_t B[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:258
uint32_t coefficient[ASYM_CRYPT_LEN(RSA_KEY_PQ_MAXLEN)]
Definition: asym_crypt.h:200
uint32_t prime[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:250
This file contains the prototype of crypto_util driver APIs.
uint32_t r[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:271
uint32_t x[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:211
#define RSA_KEY_E_MAXLEN
Definition: asym_crypt.h:127
uint8_t s[EDDSA_MAX_KEY_LEN]
Definition: asym_crypt.h:324
RSA public key. All values are in biginteger format (size followed by word value array,...
Definition: asym_crypt.h:164
uint32_t a[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:231
uint32_t q[ASYM_CRYPT_LEN(RSA_KEY_PQ_MAXLEN)]
Definition: asym_crypt.h:194
Point on Eddsa Elliptical Curve.
Definition: asym_crypt.h:282
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)
ECDSA 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.
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)
ECDSA sign primitive function.
uint32_t x[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:284
#define RSA_KEY_PQ_MAXLEN
Definition: asym_crypt.h:131
uint32_t A[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:256
uint32_t order[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:303
void * AsymCrypt_Handle
Handle to the AsymCrypt driver.
Definition: asym_crypt.h:107
AsymCrypt_Return_t AsymCrypt_ECDSAKeyGenPublic(AsymCrypt_Handle handle, const struct AsymCrypt_ECPrimeCurveP *cp, struct AsymCrypt_ECPoint *pub, const uint32_t priv[ECDSA_MAX_LENGTH])
ECDSA KeyGen Public Key function.
struct AsymCrypt_ECPoint g
Definition: asym_crypt.h:260
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:192
EC Point, also the public key.
Definition: asym_crypt.h:209
@ ASYM_CRYPT_CURVE_TYPE_EDDSA_448
Definition: asym_crypt.h:103
uint8_t pubKey[EDDSA_MAX_KEY_LEN]
Definition: asym_crypt.h:337
struct AsymCrypt_EddsaPoint g
Definition: asym_crypt.h:311
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:286
uint32_t order[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:252
#define EDDSA_MAX_KEY_LEN
Definition: asym_crypt.h:136
uint32_t e[ASYM_CRYPT_LEN(RSA_KEY_E_MAXLEN)]
Definition: asym_crypt.h:168
uint8_t privKey[EDDSA_MAX_KEY_LEN]
Definition: asym_crypt.h:335
uint32_t cofactor[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:305
uint32_t y[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:213
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:333
struct AsymCrypt_ECPoint g
Definition: asym_crypt.h:235
uint32_t dq[ASYM_CRYPT_LEN(RSA_KEY_PQ_MAXLEN)]
Definition: asym_crypt.h:198
RSA private key. All values are in biginteger format (size followed by word value array,...
Definition: asym_crypt.h:184
uint32_t cofactor[ASYM_CRYPT_LEN(EC_PARAM_MAXLEN)]
Definition: asym_crypt.h:254
Eddsa EDDSA signature.
Definition: asym_crypt.h:320
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:299
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])
ECDSA verify primitive function.
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:225
EC Montogomery curve parameters.
Definition: asym_crypt.h:248
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:196
@ ASYM_CRYPT_RETURN_FAILURE
Definition: asym_crypt.h:90
#define RSA_MAX_LENGTH
Definition: asym_crypt.h:110
ECDSA signature.
Definition: asym_crypt.h:269
#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:190
uint32_t a[ASYM_CRYPT_LEN(EDDSA_MAX_KEY_LEN)]
Definition: asym_crypt.h:307