![]() |
M480 BSP V3.05.005
The Board Support Package for M480 Series
|
Functions | |
void | PRNG_Open (CRPT_T *crpt, uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed) |
Open PRNG function. More... | |
void | PRNG_Start (CRPT_T *crpt) |
Start to generate one PRNG key. More... | |
void | PRNG_Read (CRPT_T *crpt, uint32_t u32RandKey[]) |
Read the PRNG key. More... | |
void | AES_Open (CRPT_T *crpt, uint32_t u32Channel, uint32_t u32EncDec, uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType) |
Open AES encrypt/decrypt function. More... | |
void | AES_Start (CRPT_T *crpt, uint32_t u32Channel, uint32_t u32DMAMode) |
Start AES encrypt/decrypt. More... | |
void | AES_SetKey (CRPT_T *crpt, uint32_t u32Channel, uint32_t au32Keys[], uint32_t u32KeySize) |
Set AES keys. More... | |
void | AES_SetInitVect (CRPT_T *crpt, uint32_t u32Channel, uint32_t au32IV[]) |
Set AES initial vectors. More... | |
void | AES_SetDMATransfer (CRPT_T *crpt, uint32_t u32Channel, uint32_t u32SrcAddr, uint32_t u32DstAddr, uint32_t u32TransCnt) |
Set AES DMA transfer configuration. More... | |
void | TDES_Open (CRPT_T *crpt, uint32_t u32Channel, uint32_t u32EncDec, int32_t Is3DES, int32_t Is3Key, uint32_t u32OpMode, uint32_t u32SwapType) |
Open TDES encrypt/decrypt function. More... | |
void | TDES_Start (CRPT_T *crpt, int32_t u32Channel, uint32_t u32DMAMode) |
Start TDES encrypt/decrypt. More... | |
void | TDES_SetKey (CRPT_T *crpt, uint32_t u32Channel, uint32_t au32Keys[3][2]) |
Set TDES keys. More... | |
void | TDES_SetInitVect (CRPT_T *crpt, uint32_t u32Channel, uint32_t u32IVH, uint32_t u32IVL) |
Set TDES initial vectors. More... | |
void | TDES_SetDMATransfer (CRPT_T *crpt, uint32_t u32Channel, uint32_t u32SrcAddr, uint32_t u32DstAddr, uint32_t u32TransCnt) |
Set TDES DMA transfer configuration. More... | |
void | SHA_Open (CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32SwapType, uint32_t hmac_key_len) |
Open SHA encrypt function. More... | |
void | SHA_Start (CRPT_T *crpt, uint32_t u32DMAMode) |
Start SHA encrypt. More... | |
void | SHA_SetDMATransfer (CRPT_T *crpt, uint32_t u32SrcAddr, uint32_t u32TransCnt) |
Set SHA DMA transfer. More... | |
void | SHA_Read (CRPT_T *crpt, uint32_t u32Digest[]) |
Read the SHA digest. More... | |
void | ECC_Complete (CRPT_T *crpt) |
ECC interrupt service routine. User application must invoke this function in his CRYPTO_IRQHandler() to let Crypto driver know ECC processing was done. More... | |
int | ECC_IsPrivateKeyValid (CRPT_T *crpt, E_ECC_CURVE ecc_curve, char private_k[]) |
Check if the private key is located in valid range of curve. More... | |
int32_t | ECC_GeneratePublicKey (CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[]) |
Given a private key and curve to generate the public key pair. More... | |
int32_t | ECC_Mutiply (CRPT_T *crpt, E_ECC_CURVE ecc_curve, char x1[], char y1[], char *k, char x2[], char y2[]) |
Given a private key and curve to generate the public key pair. More... | |
int32_t | ECC_GenerateSecretZ (CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[], char secret_z[]) |
Given a curve parameter, the other party's public key, and one's own private key to generate the secret Z. More... | |
int32_t | ECC_GenerateSignature (CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, char *d, char *k, char *R, char *S) |
ECDSA digital signature generation. More... | |
int32_t | ECC_VerifySignature (CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, char *public_k1, char *public_k2, char *R, char *S) |
ECDSA dogotal signature verification. More... | |
void AES_Open | ( | CRPT_T * | crpt, |
uint32_t | u32Channel, | ||
uint32_t | u32EncDec, | ||
uint32_t | u32OpMode, | ||
uint32_t | u32KeySize, | ||
uint32_t | u32SwapType | ||
) |
Open AES encrypt/decrypt function.
[in] | crpt | Reference to Crypto module. |
[in] | u32Channel | AES channel. Must be 0~3. |
[in] | u32EncDec | 1: AES encode; 0: AES decode |
[in] | u32OpMode | AES operation mode, including: |
[in] | u32KeySize | is AES key size, including: |
[in] | u32SwapType | is AES input/output data swap control, including: |
void AES_SetDMATransfer | ( | CRPT_T * | crpt, |
uint32_t | u32Channel, | ||
uint32_t | u32SrcAddr, | ||
uint32_t | u32DstAddr, | ||
uint32_t | u32TransCnt | ||
) |
void AES_SetInitVect | ( | CRPT_T * | crpt, |
uint32_t | u32Channel, | ||
uint32_t | au32IV[] | ||
) |
void AES_SetKey | ( | CRPT_T * | crpt, |
uint32_t | u32Channel, | ||
uint32_t | au32Keys[], | ||
uint32_t | u32KeySize | ||
) |
Set AES keys.
[in] | crpt | Reference to Crypto module. |
[in] | u32Channel | AES channel. Must be 0~3. |
[in] | au32Keys | An word array contains AES keys. |
[in] | u32KeySize | is AES key size, including: |
void AES_Start | ( | CRPT_T * | crpt, |
uint32_t | u32Channel, | ||
uint32_t | u32DMAMode | ||
) |
Start AES encrypt/decrypt.
[in] | crpt | Reference to Crypto module. |
[in] | u32Channel | AES channel. Must be 0~3. |
[in] | u32DMAMode | AES DMA control, including:
|
void ECC_Complete | ( | CRPT_T * | crpt | ) |
int32_t ECC_GeneratePublicKey | ( | CRPT_T * | crpt, |
E_ECC_CURVE | ecc_curve, | ||
char * | private_k, | ||
char | public_k1[], | ||
char | public_k2[] | ||
) |
Given a private key and curve to generate the public key pair.
[in] | crpt | Reference to Crypto module. |
[in] | private_k | The input private key. |
[in] | ecc_curve | The pre-defined ECC curve. |
[out] | public_k1 | The output public key 1. |
[out] | public_k2 | The output public key 2. |
int32_t ECC_GenerateSecretZ | ( | CRPT_T * | crpt, |
E_ECC_CURVE | ecc_curve, | ||
char * | private_k, | ||
char | public_k1[], | ||
char | public_k2[], | ||
char | secret_z[] | ||
) |
Given a curve parameter, the other party's public key, and one's own private key to generate the secret Z.
[in] | crpt | Reference to Crypto module. |
[in] | ecc_curve | The pre-defined ECC curve. |
[in] | private_k | One's own private key. |
[in] | public_k1 | The other party's publick key 1. |
[in] | public_k2 | The other party's publick key 2. |
[out] | secret_z | The ECC CDH secret Z. |
int32_t ECC_GenerateSignature | ( | CRPT_T * | crpt, |
E_ECC_CURVE | ecc_curve, | ||
char * | message, | ||
char * | d, | ||
char * | k, | ||
char * | R, | ||
char * | S | ||
) |
ECDSA digital signature generation.
HIDDEN_SYMBOLS
[in] | crpt | Reference to Crypto module. |
[in] | ecc_curve | The pre-defined ECC curve. |
[in] | message | The hash value of source context. |
[in] | d | The private key. |
[in] | k | The selected random integer. |
[out] | R | R of the (R,S) pair digital signature |
[out] | S | S of the (R,S) pair digital signature |
int ECC_IsPrivateKeyValid | ( | CRPT_T * | crpt, |
E_ECC_CURVE | ecc_curve, | ||
char | private_k[] | ||
) |
int32_t ECC_Mutiply | ( | CRPT_T * | crpt, |
E_ECC_CURVE | ecc_curve, | ||
char | x1[], | ||
char | y1[], | ||
char * | k, | ||
char | x2[], | ||
char | y2[] | ||
) |
Given a private key and curve to generate the public key pair.
[in] | crpt | Reference to Crypto module. |
[out] | x1 | The x-coordinate of input point. |
[out] | y1 | The y-coordinate of input point. |
[in] | k | The private key |
[in] | ecc_curve | The pre-defined ECC curve. |
[out] | x2 | The x-coordinate of output point. |
[out] | y2 | The y-coordinate of output point. |
int32_t ECC_VerifySignature | ( | CRPT_T * | crpt, |
E_ECC_CURVE | ecc_curve, | ||
char * | message, | ||
char * | public_k1, | ||
char * | public_k2, | ||
char * | R, | ||
char * | S | ||
) |
ECDSA dogotal signature verification.
[in] | crpt | Reference to Crypto module. |
[in] | ecc_curve | The pre-defined ECC curve. |
[in] | message | The hash value of source context. |
[in] | public_k1 | The public key 1. |
[in] | public_k2 | The public key 2. |
[in] | R | R of the (R,S) pair digital signature |
[in] | S | S of the (R,S) pair digital signature |
void PRNG_Open | ( | CRPT_T * | crpt, |
uint32_t | u32KeySize, | ||
uint32_t | u32SeedReload, | ||
uint32_t | u32Seed | ||
) |
Open PRNG function.
HIDDEN_SYMBOLS
[in] | crpt | Reference to Crypto module. |
[in] | u32KeySize | is PRNG key size, including: |
[in] | u32SeedReload | is PRNG seed reload or not, including: |
[in] | u32Seed | The new seed. Only valid when u32SeedReload is PRNG_SEED_RELOAD. |
void PRNG_Read | ( | CRPT_T * | crpt, |
uint32_t | u32RandKey[] | ||
) |
void PRNG_Start | ( | CRPT_T * | crpt | ) |
void SHA_Open | ( | CRPT_T * | crpt, |
uint32_t | u32OpMode, | ||
uint32_t | u32SwapType, | ||
uint32_t | hmac_key_len | ||
) |
Open SHA encrypt function.
[in] | crpt | Reference to Crypto module. |
[in] | u32OpMode | SHA operation mode, including: |
[in] | u32SwapType | is SHA input/output data swap control, including: |
[in] | hmac_key_len | HMAC key byte count |
void SHA_Read | ( | CRPT_T * | crpt, |
uint32_t | u32Digest[] | ||
) |
void SHA_SetDMATransfer | ( | CRPT_T * | crpt, |
uint32_t | u32SrcAddr, | ||
uint32_t | u32TransCnt | ||
) |
void SHA_Start | ( | CRPT_T * | crpt, |
uint32_t | u32DMAMode | ||
) |
Start SHA encrypt.
[in] | crpt | Reference to Crypto module. |
[in] | u32DMAMode | TDES DMA control, including:
|
void TDES_Open | ( | CRPT_T * | crpt, |
uint32_t | u32Channel, | ||
uint32_t | u32EncDec, | ||
int32_t | Is3DES, | ||
int32_t | Is3Key, | ||
uint32_t | u32OpMode, | ||
uint32_t | u32SwapType | ||
) |
Open TDES encrypt/decrypt function.
[in] | crpt | Reference to Crypto module. |
[in] | u32Channel | TDES channel. Must be 0~3. |
[in] | u32EncDec | 1: TDES encode; 0: TDES decode |
[in] | Is3DES | 1: TDES; 0: DES |
[in] | Is3Key | 1: TDES 3 key mode; 0: TDES 2 key mode |
[in] | u32OpMode | TDES operation mode, including: |
[in] | u32SwapType | is TDES input/output data swap control and word swap control, including: |
void TDES_SetDMATransfer | ( | CRPT_T * | crpt, |
uint32_t | u32Channel, | ||
uint32_t | u32SrcAddr, | ||
uint32_t | u32DstAddr, | ||
uint32_t | u32TransCnt | ||
) |
Set TDES DMA transfer configuration.
[in] | crpt | Reference to Crypto module. |
[in] | u32Channel | TDES channel. Must be 0~3. |
[in] | u32SrcAddr | TDES DMA source address |
[in] | u32DstAddr | TDES DMA destination address |
[in] | u32TransCnt | TDES DMA transfer byte count |
void TDES_SetInitVect | ( | CRPT_T * | crpt, |
uint32_t | u32Channel, | ||
uint32_t | u32IVH, | ||
uint32_t | u32IVL | ||
) |
void TDES_SetKey | ( | CRPT_T * | crpt, |
uint32_t | u32Channel, | ||
uint32_t | au32Keys[3][2] | ||
) |
void TDES_Start | ( | CRPT_T * | crpt, |
int32_t | u32Channel, | ||
uint32_t | u32DMAMode | ||
) |
Start TDES encrypt/decrypt.
[in] | crpt | Reference to Crypto module. |
[in] | u32Channel | TDES channel. Must be 0~3. |
[in] | u32DMAMode | TDES DMA control, including:
|