| M480 BSP V3.05.001 The Board Support Package for M480 Series

Macros | Enumerations | Functions
crypto.h File Reference

Cryptographic Accelerator driver header file. More...

Go to the source code of this file.

## Macros
#define | PRNG_KEY_SIZE_64
#define | PRNG_KEY_SIZE_128
#define | PRNG_KEY_SIZE_192
#define | PRNG_KEY_SIZE_256
#define | PRNG_SEED_CONT
#define | PRNG_SEED_RELOAD
#define | AES_KEY_SIZE_128
#define | AES_KEY_SIZE_192
#define | AES_KEY_SIZE_256
#define | AES_MODE_ECB
#define | AES_MODE_CBC
#define | AES_MODE_CFB
#define | AES_MODE_OFB
#define | AES_MODE_CTR
#define | AES_MODE_CBC_CS1
#define | AES_MODE_CBC_CS2
#define | AES_MODE_CBC_CS3
#define | AES_NO_SWAP
#define | AES_OUT_SWAP
#define | AES_IN_SWAP
#define | AES_IN_OUT_SWAP
#define | DES_MODE_ECB
#define | DES_MODE_CBC
#define | DES_MODE_CFB
#define | DES_MODE_OFB
#define | DES_MODE_CTR
#define | TDES_MODE_ECB
#define | TDES_MODE_CBC
#define | TDES_MODE_CFB
#define | TDES_MODE_OFB
#define | TDES_MODE_CTR
#define | TDES_NO_SWAP
#define | TDES_WHL_SWAP
#define | TDES_OUT_SWAP
#define | TDES_OUT_WHL_SWAP
#define | TDES_IN_SWAP
#define | TDES_IN_WHL_SWAP
#define | TDES_IN_OUT_SWAP
#define | TDES_IN_OUT_WHL_SWAP
#define | SHA_MODE_SHA1
#define | SHA_MODE_SHA224
#define | SHA_MODE_SHA256
#define | SHA_MODE_SHA384
#define | SHA_MODE_SHA512
#define | SHA_NO_SWAP
#define | SHA_OUT_SWAP
#define | SHA_IN_SWAP
#define | SHA_IN_OUT_SWAP
#define | CRYPTO_DMA_FIRST
#define | CRYPTO_DMA_ONE_SHOT
#define | CRYPTO_DMA_CONTINUE
#define | CRYPTO_DMA_LAST
#define | PRNG_ENABLE_INT(crpt)
| This macro enables PRNG interrupt. More...
#define | PRNG_DISABLE_INT(crpt)
| This macro disables PRNG interrupt. More...
#define | PRNG_GET_INT_FLAG(crpt)
| This macro gets PRNG interrupt flag. More...
#define | PRNG_CLR_INT_FLAG(crpt)
| This macro clears PRNG interrupt flag. More...
#define | AES_ENABLE_INT(crpt)
| This macro enables AES interrupt. More...
#define | AES_DISABLE_INT(crpt)
| This macro disables AES interrupt. More...
#define | AES_GET_INT_FLAG(crpt)
| This macro gets AES interrupt flag. More...
#define | AES_CLR_INT_FLAG(crpt)
| This macro clears AES interrupt flag. More...
#define | AES_ENABLE_KEY_PROTECT(crpt)
| This macro enables AES key protection. More...
#define | AES_DISABLE_KEY_PROTECT(crpt)
| This macro disables AES key protection. More...
#define | TDES_ENABLE_INT(crpt)
| This macro enables TDES interrupt. More...
#define | TDES_DISABLE_INT(crpt)
| This macro disables TDES interrupt. More...
#define | TDES_GET_INT_FLAG(crpt)
| This macro gets TDES interrupt flag. More...
#define | TDES_CLR_INT_FLAG(crpt)
| This macro clears TDES interrupt flag. More...
#define | TDES_ENABLE_KEY_PROTECT(crpt)
| This macro enables TDES key protection. More...
#define | TDES_DISABLE_KEY_PROTECT(crpt)
| This macro disables TDES key protection. More...
#define | SHA_ENABLE_INT(crpt)
| This macro enables SHA interrupt. More...
#define | SHA_DISABLE_INT(crpt)
| This macro disables SHA interrupt. More...
#define | SHA_GET_INT_FLAG(crpt)
| This macro gets SHA interrupt flag. More...
#define | SHA_CLR_INT_FLAG(crpt)
| This macro clears SHA interrupt flag. More...
#define | ECC_ENABLE_INT(crpt)
| This macro enables ECC interrupt. More...
#define | ECC_DISABLE_INT(crpt)
| This macro disables ECC interrupt. More...
#define | ECC_GET_INT_FLAG(crpt)
| This macro gets ECC interrupt flag. More...
#define | ECC_CLR_INT_FLAG(crpt)
| This macro clears ECC interrupt flag. More...

## Enumerations
enum | E_ECC_CURVE { CURVE_P_192, CURVE_P_224, CURVE_P_256, CURVE_P_384, CURVE_P_521, CURVE_K_163, CURVE_K_233, CURVE_K_283, CURVE_K_409, CURVE_K_571, CURVE_B_163, CURVE_B_233, CURVE_B_283, CURVE_B_409, CURVE_B_571, CURVE_KO_192, CURVE_KO_224, CURVE_KO_256, CURVE_BP_256, CURVE_BP_384, CURVE_BP_512, CURVE_UNDEF }

## 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...

## Detailed Description

Cryptographic Accelerator driver header file.

Version
  V1.10 SPDX-License-Identifier: Apache-2.0

Copyright
  (C) 2016-2020 Nuvoton Technology Corp. All rights reserved.

Definition in file crypto.h.