This module contains APIs to program and use the ASYMMETRIC CRYPTOGRAPHY.
|
file | asym_crypt.h |
| This file contains the prototype of ASYMMETRIC CRYPTOGRAPHY driver APIs.
|
|
|
AsymCrypt_Handle | AsymCrypt_open (uint32_t index) |
| Function to Open AsymCrypt instance, enable AsymCrypt engine, Initialize clocks. More...
|
|
AsymCrypt_Return_t | AsymCrypt_close (AsymCrypt_Handle handle) |
| Function to close a AsymCrypt module specified by the AsymCrypt handle. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
◆ RSA_MAX_LENGTH
#define RSA_MAX_LENGTH (130U) |
Max size of AsymCrypt Data in words - for RSA
◆ ECDSA_MAX_LENGTH
#define ECDSA_MAX_LENGTH (18U) |
Max size of AsymCrypt Data in words - for ECDSA
◆ EC_PARAM_MAXLEN
#define EC_PARAM_MAXLEN (68U) |
Maximum length of a AsymCrypt data used in EC crypto in bytes, enough to accommodate 521-bit prime curves
◆ ASYM_CRYPT_LEN
#define ASYM_CRYPT_LEN |
( |
|
bytelen | ) |
(((bytelen) / 4U) + 1U) |
Length of a data array in words
◆ RSA_KEY_E_MAXLEN
#define RSA_KEY_E_MAXLEN (8U) |
◆ RSA_KEY_N_MAXLEN
#define RSA_KEY_N_MAXLEN (520U) |
◆ RSA_KEY_PQ_MAXLEN
RSA KEY PQ maximun length
◆ RSA_SIG_MAXLEN
RSA KEY SIG maximun length
◆ AsymCrypt_Handle
Handle to the AsymCrypt driver.
◆ AsymCrypt_Return_t
ASYM CRYPTO Driver Error code.
The enumeration describes all the possible return and error codes which the ASYM CRYPTO Driver can return
Enumerator |
---|
ASYM_CRYPT_RETURN_SUCCESS | Success/pass return code
|
ASYM_CRYPT_RETURN_FAILURE | General or unspecified failure/error
|
◆ AsymCrypt_open()
Function to Open AsymCrypt instance, enable AsymCrypt engine, Initialize clocks.
- Returns
- A AsymCrypt_Handle on success or a NULL on an error or if it has been opened already
◆ AsymCrypt_close()
Function to close a AsymCrypt module specified by the AsymCrypt handle.
- Parameters
-
◆ AsymCrypt_RSAPrivate()
This Function performs Decryption or Signing operations.
- Parameters
-
handle | AsymCrypt_Handle returned from AsymCrypt_open() |
m | m value in bigint format. |
k | RSA private key |
result | Result of the operation in bigint format. caller must allocate memory size of (2 * sizeof(p)) for the result. |
- Returns
- ASYM_CRYPT_RETURN_SUCCESS if requested operation completed. ASYM_CRYPT_RETURN_FAILURE if requested operation not completed.
◆ AsymCrypt_RSAPublic()
This Function performs Encryption or Verification operations.
- Parameters
-
handle | AsymCrypt_Handle returned from AsymCrypt_open() |
m | m value in bigint format. |
k | RSA public key |
result | Result of the operation in bigint format. caller must allocate the same memory as s and n for this array. |
- Returns
- ASYM_CRYPT_RETURN_SUCCESS if requested operation completed. ASYM_CRYPT_RETURN_FAILURE if requested operation not completed.
◆ AsymCrypt_ECDSASign()
◆ AsymCrypt_ECDSAVerify()