Modules | |
CryptoCell CHACHA specific errors | |
Data Structures | |
struct | CRYS_CHACHAUserContext_t |
Macros | |
#define | CRYS_CHACHA_USER_CTX_SIZE_IN_WORDS 17 |
#define | CRYS_CHACHA_BLOCK_SIZE_IN_WORDS 16 |
#define | CRYS_CHACHA_BLOCK_SIZE_IN_BYTES (CRYS_CHACHA_BLOCK_SIZE_IN_WORDS * sizeof(uint32_t)) |
#define | CRYS_CHACHA_NONCE_MAX_SIZE_IN_WORDS 3 |
#define | CRYS_CHACHA_NONCE_MAX_SIZE_IN_BYTES (CRYS_CHACHA_NONCE_MAX_SIZE_IN_WORDS * sizeof(uint32_t)) |
#define | CRYS_CHACHA_KEY_MAX_SIZE_IN_WORDS 8 |
#define | CRYS_CHACHA_KEY_MAX_SIZE_IN_BYTES (CRYS_CHACHA_KEY_MAX_SIZE_IN_WORDS * sizeof(uint32_t)) |
Typedefs | |
typedef uint8_t | CRYS_CHACHA_Nonce_t[(3 *sizeof(uint32_t))] |
typedef uint8_t | CRYS_CHACHA_Key_t[(8 *sizeof(uint32_t))] |
typedef struct CRYS_CHACHAUserContext_t | CRYS_CHACHAUserContext_t |
Enumerations |
Functions | |
CRYSError_t | CRYS_CHACHA_Init (CRYS_CHACHAUserContext_t *pContextID, CRYS_CHACHA_Nonce_t pNonce, CRYS_CHACHA_NonceSize_t nonceSize, CRYS_CHACHA_Key_t pKey, uint32_t initialCounter, CRYS_CHACHA_EncryptMode_t EncryptDecryptFlag) |
This function is used to initialize the context for CHACHA operations. More... | |
CRYSError_t | CRYS_CHACHA_Block (CRYS_CHACHAUserContext_t *pContextID, uint8_t *pDataIn, uint32_t dataInSize, uint8_t *pDataOut) |
This function is used to process aligned blocks of CHACHA. The data in size should be a multiple of chacha block size. More... | |
CRYSError_t | CRYS_CHACHA_Finish (CRYS_CHACHAUserContext_t *pContextID, uint8_t *pDataIn, uint32_t dataInSize, uint8_t *pDataOut) |
This function is used to process the remaining data of CHACHA. The data in size should be smaller than chacha block size. More... | |
CRYSError_t | CRYS_CHACHA_Free (CRYS_CHACHAUserContext_t *pContextID) |
This function is used to free the context of CHACHA operations. More... | |
CRYSError_t | CRYS_CHACHA (CRYS_CHACHA_Nonce_t pNonce, CRYS_CHACHA_NonceSize_t nonceSize, CRYS_CHACHA_Key_t pKey, uint32_t initialCounter, CRYS_CHACHA_EncryptMode_t encryptDecryptFlag, uint8_t *pDataIn, uint32_t dataInSize, uint8_t *pDataOut) |
This function is used to perform the CHACHA operation in one integrated process. More... | |
#define CRYS_CHACHA_BLOCK_SIZE_IN_BYTES (CRYS_CHACHA_BLOCK_SIZE_IN_WORDS * sizeof(uint32_t)) |
CHACHA block size in bytes.
Definition at line 64 of file crys_chacha.h.
#define CRYS_CHACHA_BLOCK_SIZE_IN_WORDS 16 |
CHACHA block size in words.
Definition at line 62 of file crys_chacha.h.
#define CRYS_CHACHA_KEY_MAX_SIZE_IN_BYTES (CRYS_CHACHA_KEY_MAX_SIZE_IN_WORDS * sizeof(uint32_t)) |
CHACHA KEY maximal size in bytes.
Definition at line 74 of file crys_chacha.h.
#define CRYS_CHACHA_KEY_MAX_SIZE_IN_WORDS 8 |
CHACHA KEY maximal size in words.
Definition at line 72 of file crys_chacha.h.
#define CRYS_CHACHA_NONCE_MAX_SIZE_IN_BYTES (CRYS_CHACHA_NONCE_MAX_SIZE_IN_WORDS * sizeof(uint32_t)) |
Nonce buffer max size in bytes.
Definition at line 69 of file crys_chacha.h.
#define CRYS_CHACHA_NONCE_MAX_SIZE_IN_WORDS 3 |
Nonce buffer max size in words.
Definition at line 67 of file crys_chacha.h.
#define CRYS_CHACHA_USER_CTX_SIZE_IN_WORDS 17 |
CHACHA user's context size in words.
Definition at line 59 of file crys_chacha.h.
typedef uint8_t CRYS_CHACHA_Key_t[(8 *sizeof(uint32_t))] |
Defines the CHACHA key buffer.
Definition at line 111 of file crys_chacha.h.
typedef uint8_t CRYS_CHACHA_Nonce_t[(3 *sizeof(uint32_t))] |
Defines the Nonce buffer 12 bytes array.
Definition at line 108 of file crys_chacha.h.
typedef struct CRYS_CHACHAUserContext_t CRYS_CHACHAUserContext_t |
The user's context prototype - the argument type that is passed by the user to the CHACHA API. The context saves the state of the operation and must be saved by the user till the end of the APIs flow (for example till CRYS_CHACHA_Free is called).
Enum defining the CHACHA Encrypt or Decrypt operation mode.
Definition at line 79 of file crys_chacha.h.
Enum defining the CHACHA Nonce size in bits.
Definition at line 93 of file crys_chacha.h.
CRYSError_t CRYS_CHACHA | ( | CRYS_CHACHA_Nonce_t | pNonce, |
CRYS_CHACHA_NonceSize_t | nonceSize, | ||
CRYS_CHACHA_Key_t | pKey, | ||
uint32_t | initialCounter, | ||
CRYS_CHACHA_EncryptMode_t | encryptDecryptFlag, | ||
uint8_t * | pDataIn, | ||
uint32_t | dataInSize, | ||
uint8_t * | pDataOut | ||
) |
This function is used to perform the CHACHA operation in one integrated process.
[in] | pNonce | A buffer containing an nonce. |
[in] | nonceSize | Enumerator defining the nonce size (only 64 and 96 bit are valid). |
[in] | pKey | A pointer to the user's key buffer. |
[in] | initialCounter | An initial counter. |
[in] | encryptDecryptFlag | A flag specifying whether the CHACHA should perform an Encrypt operation or a Decrypt operation. |
[in] | pDataIn | A pointer to the buffer of the input data to the CHACHA. The pointer does not need to be aligned. must not be null. |
[in] | dataInSize | The size of the input data. must not be 0. |
[out] | pDataOut | A pointer to the buffer of the output data from the CHACHA. The pointer does not need to be aligned. must not be null. |
CRYSError_t CRYS_CHACHA_Block | ( | CRYS_CHACHAUserContext_t * | pContextID, |
uint8_t * | pDataIn, | ||
uint32_t | dataInSize, | ||
uint8_t * | pDataOut | ||
) |
This function is used to process aligned blocks of CHACHA. The data in size should be a multiple of chacha block size.
[in] | pContextID | Pointer to the context buffer. |
[in] | pDataIn | A pointer to the buffer of the input data to the CHACHA. The pointer does not need to be aligned. must not be null. |
[in] | dataInSize | The size of the input data. Must be a multiple of CRYS_CHACHA_BLOCK_SIZE_IN_BYTES bytes and must not be 0. |
[out] | pDataOut | A pointer to the buffer of the output data from the CHACHA. The pointer does not need to be aligned. must not be null. |
CRYSError_t CRYS_CHACHA_Finish | ( | CRYS_CHACHAUserContext_t * | pContextID, |
uint8_t * | pDataIn, | ||
uint32_t | dataInSize, | ||
uint8_t * | pDataOut | ||
) |
This function is used to process the remaining data of CHACHA. The data in size should be smaller than chacha block size.
[in] | pContextID | Pointer to the context buffer. |
[in] | pDataIn | A pointer to the buffer of the input data to the CHACHA. The pointer does not need to be aligned. If dataInSize = 0, input buffer is not required. |
[in] | dataInSize | The size of the input data. zero and non multiple of CRYS_CHACHA_BLOCK_SIZE_IN_BYTES are valid. |
[out] | pDataOut | A pointer to the buffer of the output data from the CHACHA. The pointer does not need to be aligned. If dataInSize = 0, output buffer is not required. |
CRYSError_t CRYS_CHACHA_Free | ( | CRYS_CHACHAUserContext_t * | pContextID | ) |
This function is used to free the context of CHACHA operations.
[in] | pContextID | Pointer to the context buffer. |
CRYSError_t CRYS_CHACHA_Init | ( | CRYS_CHACHAUserContext_t * | pContextID, |
CRYS_CHACHA_Nonce_t | pNonce, | ||
CRYS_CHACHA_NonceSize_t | nonceSize, | ||
CRYS_CHACHA_Key_t | pKey, | ||
uint32_t | initialCounter, | ||
CRYS_CHACHA_EncryptMode_t | EncryptDecryptFlag | ||
) |
This function is used to initialize the context for CHACHA operations.
[in] | pContextID | Pointer to the CHACHA context buffer that is allocated by the user and is used for the CHACHA operation. |
[in] | pNonce | A buffer containing an nonce. |
[in] | nonceSize | Enumerator defining the nonce size (only 64 and 96 bit are valid). |
[in] | pKey | A pointer to the user's key buffer. |
[in] | initialCounter | An initial counter. |
[in] | EncryptDecryptFlag | A flag specifying whether the CHACHA should perform an Encrypt operation or a Decrypt operation. |