This module contains APIs to program and use the PKA.
|
file | crypto_util.h |
| This file contains the prototype of crypto_util driver APIs.
|
|
|
void | Crypto_Uint8ToUint32 (const uint8_t *source, uint32_t sourceLengthInBytes, uint32_t *dest) |
| Function to convert uint8_t to uint32_t format. More...
|
|
void | Crypto_Uint32ToUint8 (const uint32_t *src, uint32_t sourceLengthInBytes, uint8_t *dest) |
| Function to convert uint32_t to uint8_t format. More...
|
|
void | Crypto_Uint32ToBigInt (uint32_t *source, uint32_t sourceLengthInWords, uint32_t *dest) |
| Function to convert uint32_t to Bigint format. More...
|
|
void | Crypto_bigIntToUint32 (uint32_t *source, uint32_t sourceLengthInWords, uint32_t *dest) |
| Function to convert Bigint to uint32_t format. More...
|
|
void | Crypto_PKCSPaddingForSign (const uint8_t *shaHash, uint32_t keyLengthInBytes, uint32_t typeOfAlgo, uint8_t *output) |
| Padding function for sign. More...
|
|
void | Crypto_PKCSPaddingForMessage (const uint8_t *message, uint32_t msgLengthInBytes, uint32_t keyLengthInBytes, uint8_t *output) |
| Padding function for Message. More...
|
|
◆ HASH_ALG_SHA1
#define HASH_ALG_SHA1 (0x0U) |
◆ HASH_ALG_SHA2_256
#define HASH_ALG_SHA2_256 (0x1U) |
◆ HASH_ALG_SHA2_512
#define HASH_ALG_SHA2_512 (0x2U) |
◆ Crypto_Uint8ToUint32()
void Crypto_Uint8ToUint32 |
( |
const uint8_t * |
source, |
|
|
uint32_t |
sourceLengthInBytes, |
|
|
uint32_t * |
dest |
|
) |
| |
Function to convert uint8_t to uint32_t format.
- Parameters
-
source | Uint8_t type buffer for conversion |
sourceLengthInBytes | Length of source buffer in bytes |
dest | Resultant uint32_t buffer stored in dest |
◆ Crypto_Uint32ToUint8()
void Crypto_Uint32ToUint8 |
( |
const uint32_t * |
src, |
|
|
uint32_t |
sourceLengthInBytes, |
|
|
uint8_t * |
dest |
|
) |
| |
Function to convert uint32_t to uint8_t format.
- Parameters
-
src | Uint32_t type buffer for conversion |
sourceLengthInBytes | Length of source buffer in bytes |
dest | Resultant uint8_t buffer stored in dest |
◆ Crypto_Uint32ToBigInt()
void Crypto_Uint32ToBigInt |
( |
uint32_t * |
source, |
|
|
uint32_t |
sourceLengthInWords, |
|
|
uint32_t * |
dest |
|
) |
| |
Function to convert uint32_t to Bigint format.
- Parameters
-
source | uint32_t type buffer for conversion |
sourceLengthInWords | length of source buffer in words |
dest | Resultant bigint buffer stored in dest |
◆ Crypto_bigIntToUint32()
void Crypto_bigIntToUint32 |
( |
uint32_t * |
source, |
|
|
uint32_t |
sourceLengthInWords, |
|
|
uint32_t * |
dest |
|
) |
| |
Function to convert Bigint to uint32_t format.
- Parameters
-
source | Uint32_t type buffer for conversion |
sourceLengthInWords | Length of source buffer in words |
dest | Resultant uint32 buffer stored in dest |
◆ Crypto_PKCSPaddingForSign()
void Crypto_PKCSPaddingForSign |
( |
const uint8_t * |
shaHash, |
|
|
uint32_t |
keyLengthInBytes, |
|
|
uint32_t |
typeOfAlgo, |
|
|
uint8_t * |
output |
|
) |
| |
Padding function for sign.
- Parameters
-
shaHash | Calculated Hash of the message for padding |
keyLengthInBytes | Used while padding to match key and padded mesage size |
typeOfAlgo | Used while padding to check sha length, refer Crypto_AlgoTypes |
output | Resultant padded buffer stored in dest |
◆ Crypto_PKCSPaddingForMessage()
void Crypto_PKCSPaddingForMessage |
( |
const uint8_t * |
message, |
|
|
uint32_t |
msgLengthInBytes, |
|
|
uint32_t |
keyLengthInBytes, |
|
|
uint8_t * |
output |
|
) |
| |
Padding function for Message.
- Parameters
-
message | Message for padding |
msgLengthInBytes | Used while padding to match key and padded mesage size |
keyLengthInBytes | Used while padding to check key length |
output | Resultant padded buffer stored in dest |