NUC472_NUC442_BSP V3.03.004
The Board Support Package for NUC472/NUC442
Macros | Functions
Collaboration diagram for CRYPTO Exported Functions:

Macros

#define PRNG_ENABLE_INT()
 This macro enables PRNG interrupt. More...
 
#define PRNG_DISABLE_INT()
 This macro disables PRNG interrupt. More...
 
#define PRNG_GET_INT_FLAG()
 This macro gets PRNG interrupt flag. More...
 
#define PRNG_CLR_INT_FLAG()
 This macro clears PRNG interrupt flag. More...
 
#define AES_ENABLE_INT()
 This macro enables AES interrupt. More...
 
#define AES_DISABLE_INT()
 This macro disables AES interrupt. More...
 
#define AES_GET_INT_FLAG()
 This macro gets AES interrupt flag. More...
 
#define AES_CLR_INT_FLAG()
 This macro clears AES interrupt flag. More...
 
#define AES_ENABLE_KEY_PROTECT()
 This macro enables AES key protection. More...
 
#define AES_DISABLE_KEY_PROTECT()
 This macro disables AES key protection. More...
 
#define TDES_ENABLE_INT()
 This macro enables TDES interrupt. More...
 
#define TDES_DISABLE_INT()
 This macro disables TDES interrupt. More...
 
#define TDES_GET_INT_FLAG()
 This macro gets TDES interrupt flag. More...
 
#define TDES_CLR_INT_FLAG()
 This macro clears TDES interrupt flag. More...
 
#define TDES_ENABLE_KEY_PROTECT()
 This macro enables TDES key protection. More...
 
#define TDES_DISABLE_KEY_PROTECT()
 This macro disables TDES key protection. More...
 
#define SHA_ENABLE_INT()
 This macro enables SHA interrupt. More...
 
#define SHA_DISABLE_INT()
 This macro disables SHA interrupt. More...
 
#define SHA_GET_INT_FLAG()
 This macro gets SHA interrupt flag. More...
 
#define SHA_CLR_INT_FLAG()
 This macro clears SHA interrupt flag. More...
 

Functions

void PRNG_Open (uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed)
 Open PRNG function. More...
 
void PRNG_Start (void)
 Start to generate one PRNG key. More...
 
void PRNG_Read (uint32_t u32RandKey[])
 Read the PRNG key. More...
 
void AES_Open (uint32_t u32Channel, uint32_t u32EncDec, uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType)
 Open AES encrypt/decrypt function. More...
 
void AES_Start (int32_t u32Channel, uint32_t u32DMAMode)
 Start AES encrypt/decrypt. More...
 
void AES_SetKey (uint32_t u32Channel, uint32_t au32Keys[], uint32_t u32KeySize)
 Set AES keys. More...
 
void AES_SetInitVect (uint32_t u32Channel, uint32_t au32IV[])
 Set AES initial vectors. More...
 
void AES_SetDMATransfer (uint32_t u32Channel, uint32_t u32SrcAddr, uint32_t u32DstAddr, uint32_t u32TransCnt)
 Set AES DMA transfer configuration. More...
 
void TDES_Open (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 (int32_t u32Channel, uint32_t u32DMAMode)
 Start TDES encrypt/decrypt. More...
 
void TDES_SetKey (uint32_t u32Channel, uint32_t au32Keys[3][2])
 Set TDES keys. More...
 
void TDES_SetInitVect (uint32_t u32Channel, uint32_t u32IVH, uint32_t u32IVL)
 Set TDES initial vectors. More...
 
void TDES_SetDMATransfer (uint32_t u32Channel, uint32_t u32SrcAddr, uint32_t u32DstAddr, uint32_t u32TransCnt)
 Set TDES DMA transfer configuration. More...
 
void SHA_Open (uint32_t u32OpMode, uint32_t u32SwapType)
 Open SHA encrypt function. More...
 
void SHA_Start (uint32_t u32DMAMode)
 Start SHA encrypt. More...
 
void SHA_SetDMATransfer (uint32_t u32SrcAddr, uint32_t u32TransCnt)
 Set SHA DMA transfer. More...
 
void SHA_Read (uint32_t u32Digest[])
 Read the SHA digest. More...
 

Detailed Description

Macro Definition Documentation

◆ AES_CLR_INT_FLAG

#define AES_CLR_INT_FLAG ( )

This macro clears AES interrupt flag.

Parameters
None
Returns
None

Definition at line 167 of file crypto.h.

◆ AES_DISABLE_INT

#define AES_DISABLE_INT ( )

This macro disables AES interrupt.

Parameters
None
Returns
None

Definition at line 151 of file crypto.h.

◆ AES_DISABLE_KEY_PROTECT

#define AES_DISABLE_KEY_PROTECT ( )

This macro disables AES key protection.

Parameters
None
Returns
None

Definition at line 183 of file crypto.h.

◆ AES_ENABLE_INT

#define AES_ENABLE_INT ( )

This macro enables AES interrupt.

Parameters
None
Returns
None

Definition at line 143 of file crypto.h.

◆ AES_ENABLE_KEY_PROTECT

#define AES_ENABLE_KEY_PROTECT ( )

This macro enables AES key protection.

Parameters
None
Returns
None

Definition at line 175 of file crypto.h.

◆ AES_GET_INT_FLAG

#define AES_GET_INT_FLAG ( )

This macro gets AES interrupt flag.

Parameters
None
Returns
AES interrupt flag.

Definition at line 159 of file crypto.h.

◆ PRNG_CLR_INT_FLAG

#define PRNG_CLR_INT_FLAG ( )

This macro clears PRNG interrupt flag.

Parameters
None
Returns
None

Definition at line 135 of file crypto.h.

◆ PRNG_DISABLE_INT

#define PRNG_DISABLE_INT ( )

This macro disables PRNG interrupt.

Parameters
None
Returns
None

Definition at line 119 of file crypto.h.

◆ PRNG_ENABLE_INT

#define PRNG_ENABLE_INT ( )

This macro enables PRNG interrupt.

Parameters
None
Returns
None

Definition at line 111 of file crypto.h.

◆ PRNG_GET_INT_FLAG

#define PRNG_GET_INT_FLAG ( )

This macro gets PRNG interrupt flag.

Parameters
None
Returns
PRNG interrupt flag.

Definition at line 127 of file crypto.h.

◆ SHA_CLR_INT_FLAG

#define SHA_CLR_INT_FLAG ( )

This macro clears SHA interrupt flag.

Parameters
None
Returns
None

Definition at line 263 of file crypto.h.

◆ SHA_DISABLE_INT

#define SHA_DISABLE_INT ( )

This macro disables SHA interrupt.

Parameters
None
Returns
None

Definition at line 247 of file crypto.h.

◆ SHA_ENABLE_INT

#define SHA_ENABLE_INT ( )

This macro enables SHA interrupt.

Parameters
None
Returns
None

Definition at line 239 of file crypto.h.

◆ SHA_GET_INT_FLAG

#define SHA_GET_INT_FLAG ( )

This macro gets SHA interrupt flag.

Parameters
None
Returns
SHA interrupt flag.

Definition at line 255 of file crypto.h.

◆ TDES_CLR_INT_FLAG

#define TDES_CLR_INT_FLAG ( )

This macro clears TDES interrupt flag.

Parameters
None
Returns
None

Definition at line 215 of file crypto.h.

◆ TDES_DISABLE_INT

#define TDES_DISABLE_INT ( )

This macro disables TDES interrupt.

Parameters
None
Returns
None

Definition at line 199 of file crypto.h.

◆ TDES_DISABLE_KEY_PROTECT

#define TDES_DISABLE_KEY_PROTECT ( )

This macro disables TDES key protection.

Parameters
None
Returns
None

Definition at line 231 of file crypto.h.

◆ TDES_ENABLE_INT

#define TDES_ENABLE_INT ( )

This macro enables TDES interrupt.

Parameters
None
Returns
None

Definition at line 191 of file crypto.h.

◆ TDES_ENABLE_KEY_PROTECT

#define TDES_ENABLE_KEY_PROTECT ( )

This macro enables TDES key protection.

Parameters
None
Returns
None

Definition at line 223 of file crypto.h.

◆ TDES_GET_INT_FLAG

#define TDES_GET_INT_FLAG ( )

This macro gets TDES interrupt flag.

Parameters
None
Returns
TDES interrupt flag.

Definition at line 207 of file crypto.h.

Function Documentation

◆ AES_Open()

void AES_Open ( uint32_t  u32Channel,
uint32_t  u32EncDec,
uint32_t  u32OpMode,
uint32_t  u32KeySize,
uint32_t  u32SwapType 
)

Open AES encrypt/decrypt function.

Parameters
[in]u32ChannelAES channel. Must be 0~3.
[in]u32EncDec1: AES encode; 0: AES decode
[in]u32OpModeAES operation mode, including:
[in]u32KeySizeis AES key size, including:
[in]u32SwapTypeis AES input/output data swap control, including:
Returns
None

Definition at line 107 of file crypto.c.

◆ AES_SetDMATransfer()

void AES_SetDMATransfer ( uint32_t  u32Channel,
uint32_t  u32SrcAddr,
uint32_t  u32DstAddr,
uint32_t  u32TransCnt 
)

Set AES DMA transfer configuration.

Parameters
[in]u32ChannelAES channel. Must be 0~3.
[in]u32SrcAddrAES DMA source address
[in]u32DstAddrAES DMA destination address
[in]u32TransCntAES DMA transfer byte count
Returns
None

Definition at line 184 of file crypto.c.

◆ AES_SetInitVect()

void AES_SetInitVect ( uint32_t  u32Channel,
uint32_t  au32IV[] 
)

Set AES initial vectors.

Parameters
[in]u32ChannelAES channel. Must be 0~3.
[in]au32IVA four entry word array contains AES initial vectors.
Returns
None

Definition at line 163 of file crypto.c.

◆ AES_SetKey()

void AES_SetKey ( uint32_t  u32Channel,
uint32_t  au32Keys[],
uint32_t  u32KeySize 
)

Set AES keys.

Parameters
[in]u32ChannelAES channel. Must be 0~3.
[in]au32KeysAn word array contains AES keys.
[in]u32KeySizeis AES key size, including:
Returns
None

Definition at line 143 of file crypto.c.

◆ AES_Start()

void AES_Start ( int32_t  u32Channel,
uint32_t  u32DMAMode 
)

Start AES encrypt/decrypt.

Parameters
[in]u32ChannelAES channel. Must be 0~3.
[in]u32DMAModeAES DMA control, including:
Returns
None

Definition at line 127 of file crypto.c.

◆ PRNG_Open()

HIDDEN_SYMBOLS void PRNG_Open ( uint32_t  u32KeySize,
uint32_t  u32SeedReload,
uint32_t  u32Seed 
)

Open PRNG function.

Parameters
[in]u32KeySizeis PRNG key size, including:
[in]u32SeedReloadis PRNG seed reload or not, including:
[in]u32SeedThe new seed. Only valid when u32SeedReload is PRNG_SEED_RELOAD.
Returns
None

Definition at line 49 of file crypto.c.

◆ PRNG_Read()

void PRNG_Read ( uint32_t  u32RandKey[])

Read the PRNG key.

Parameters
[out]u32RandKeyThe key buffer to store newly generated PRNG key.
Returns
None

Definition at line 73 of file crypto.c.

◆ PRNG_Start()

void PRNG_Start ( void  )

Start to generate one PRNG key.

Parameters
None
Returns
None

Definition at line 63 of file crypto.c.

◆ SHA_Open()

void SHA_Open ( uint32_t  u32OpMode,
uint32_t  u32SwapType 
)

Open SHA encrypt function.

Parameters
[in]u32OpModeSHA operation mode, including:
[in]u32SwapTypeis SHA input/output data swap control, including:
Returns
None

Definition at line 328 of file crypto.c.

◆ SHA_Read()

void SHA_Read ( uint32_t  u32Digest[])

Read the SHA digest.

Parameters
[out]u32DigestThe SHA encrypt output digest.
Returns
None

Definition at line 365 of file crypto.c.

◆ SHA_SetDMATransfer()

void SHA_SetDMATransfer ( uint32_t  u32SrcAddr,
uint32_t  u32TransCnt 
)

Set SHA DMA transfer.

Parameters
[in]u32SrcAddrSHA DMA source address
[in]u32TransCntSHA DMA transfer byte count
Returns
None

Definition at line 354 of file crypto.c.

◆ SHA_Start()

void SHA_Start ( uint32_t  u32DMAMode)

Start SHA encrypt.

Parameters
[in]u32DMAModeTDES DMA control, including:
Returns
None

Definition at line 342 of file crypto.c.

◆ TDES_Open()

void TDES_Open ( uint32_t  u32Channel,
uint32_t  u32EncDec,
int32_t  Is3DES,
int32_t  Is3Key,
uint32_t  u32OpMode,
uint32_t  u32SwapType 
)

Open TDES encrypt/decrypt function.

Parameters
[in]u32ChannelTDES channel. Must be 0~3.
[in]u32EncDec1: TDES encode; 0: TDES decode
[in]Is3DES1: TDES; 0: DES
[in]Is3Key1: TDES 3 key mode; 0: TDES 2 key mode
[in]u32OpModeTDES operation mode, including:
[in]u32SwapTypeis TDES input/output data swap control and word swap control, including:
Returns
None

Definition at line 222 of file crypto.c.

◆ TDES_SetDMATransfer()

void TDES_SetDMATransfer ( uint32_t  u32Channel,
uint32_t  u32SrcAddr,
uint32_t  u32DstAddr,
uint32_t  u32TransCnt 
)

Set TDES DMA transfer configuration.

Parameters
[in]u32ChannelTDES channel. Must be 0~3.
[in]u32SrcAddrTDES DMA source address
[in]u32DstAddrTDES DMA destination address
[in]u32TransCntTDES DMA transfer byte count
Returns
None

Definition at line 300 of file crypto.c.

◆ TDES_SetInitVect()

void TDES_SetInitVect ( uint32_t  u32Channel,
uint32_t  u32IVH,
uint32_t  u32IVL 
)

Set TDES initial vectors.

Parameters
[in]u32ChannelTDES channel. Must be 0~3.
[in]u32IVHTDES initial vector high word.
[in]u32IVLTDES initial vector low word.
Returns
None

Definition at line 281 of file crypto.c.

◆ TDES_SetKey()

void TDES_SetKey ( uint32_t  u32Channel,
uint32_t  au32Keys[3][2] 
)

Set TDES keys.

Parameters
[in]u32ChannelTDES channel. Must be 0~3.
[in]au32KeysThe TDES keys. au32Keys[0][0] is Key0 high word and au32Keys[0][1] is key0 low word.
Returns
None

Definition at line 259 of file crypto.c.

◆ TDES_Start()

void TDES_Start ( int32_t  u32Channel,
uint32_t  u32DMAMode 
)

Start TDES encrypt/decrypt.

Parameters
[in]u32ChannelTDES channel. Must be 0~3.
[in]u32DMAModeTDES DMA control, including:
Returns
None

Definition at line 247 of file crypto.c.