AM263Px MCU+ SDK: APIs for DTHE SHA

| AM263Px MCU+ SDK 26.00.00 |

Files | Data Structures | Functions | Enumerations | Macros
APIs for DTHE SHA
APIs for Security Drivers

## Introduction

This module contains APIs to program and use the DTHE SHA.

## Files
file | dthe_sha.h
| This file contains the prototype of DTHE SHA driver APIs.

## Data Structures
struct | DTHE_SHA_Params
| Parameters required for SHA Driver. More...

## Functions
DTHE_SHA_Return_t | DTHE_SHA_open (DTHE_Handle handle)
| Function to Open DTHE SHA Driver. More...
DTHE_SHA_Return_t | DTHE_SHA_compute (DTHE_Handle handle, DTHE_SHA_Params *ptrShaParams, Bool isLastBlock)
| The function is used to execute the SHA Driver with the specified parameters. More...
DTHE_SHA_Return_t | DTHE_HMACSHA_compute (DTHE_Handle handle, DTHE_SHA_Params *ptrShaParams)
| The function is used to execute the HMAC SHA Operations with the specified parameters. More...
DTHE_SHA_Return_t | DTHE_SHA_close (DTHE_Handle handle)
| Function to close DTHE SHA Driver. More...

## Enumerations
enum | DTHE_SHA_Return_t { DTHE_SHA_RETURN_SUCCESS = 0x67A42DD1U, DTHE_SHA_RETURN_FAILURE = 0x06C2B483U }
| DTHE SHA Driver Error code. More...

## Macros
#define | DTHE_SHA_ALGO_MD5 (0x1U)
| MD5 Flag. More...
#define | DTHE_SHA_ALGO_SHA384 (0x2U)
| SHA-384 Flag. More...
#define | DTHE_SHA_ALGO_SHA1 (0x3U)
| SHA-1 Flag. More...
#define | DTHE_SHA_ALGO_SHA512 (0x4U)
| SHA-512 Flag. More...
#define | DTHE_SHA_ALGO_SHA224 (0x5U)
| SHA-224 Flag. More...
#define | DTHE_SHA_ALGO_SHA256 (0x6U)
| SHA-256 Flag. More...
#define | DTHE_SHA_MAX_DIGEST_SIZE_BYTES (64U)
| The Maximum Digest Size is 64bytes for the SHA512. More...

## Macro Definition Documentation

## ◆ DTHE_SHA_ALGO_MD5

#define DTHE_SHA_ALGO_MD5 (0x1U)

MD5 Flag.

< SHA Algorithms

## ◆ DTHE_SHA_ALGO_SHA384

#define DTHE_SHA_ALGO_SHA384 (0x2U)

SHA-384 Flag.

## ◆ DTHE_SHA_ALGO_SHA1

#define DTHE_SHA_ALGO_SHA1 (0x3U)

SHA-1 Flag.

## ◆ DTHE_SHA_ALGO_SHA512

#define DTHE_SHA_ALGO_SHA512 (0x4U)

SHA-512 Flag.

## ◆ DTHE_SHA_ALGO_SHA224

#define DTHE_SHA_ALGO_SHA224 (0x5U)

SHA-224 Flag.

## ◆ DTHE_SHA_ALGO_SHA256

#define DTHE_SHA_ALGO_SHA256 (0x6U)

SHA-256 Flag.

## ◆ DTHE_SHA_MAX_DIGEST_SIZE_BYTES

#define DTHE_SHA_MAX_DIGEST_SIZE_BYTES (64U)

The Maximum Digest Size is 64bytes for the SHA512.

## Enumeration Type Documentation

## ◆ DTHE_SHA_Return_t

enum DTHE_SHA_Return_t

DTHE SHA Driver Error code.

The enumeration describes all the possible return and error codes which the DTHE SHA Driver can return

Enumerator
DTHE_SHA_RETURN_SUCCESS | Success/pass return code
DTHE_SHA_RETURN_FAILURE | General or unspecified failure/error

## Function Documentation

## ◆ DTHE_SHA_open()

DTHE_SHA_Return_t DTHE_SHA_open | ( | DTHE_Handle | handle | ) |

Function to Open DTHE SHA Driver.

Parameters

  handle | DTHE_Handle returned from DTHE_open().

Returns
  DTHE_SHA_RETURN_SUCCESS if requested operation completed. DTHE_SHA_RETURN_FAILURE if requested operation not completed.

## ◆ DTHE_SHA_compute()

DTHE_SHA_Return_t DTHE_SHA_compute | ( | DTHE_Handle | handle,
|  | DTHE_SHA_Params * | ptrShaParams,
|  | Bool | isLastBlock
| ) |  |

The function is used to execute the SHA Driver with the specified parameters.

Parameters

  handle | DTHE_Handle returned from DTHE_open().
  ptrShaParams | Pointer to the parameters to be used to execute the driver.
  isLastBlock | Used for singleshot and multishot sha.

Returns
  DTHE_SHA_RETURN_SUCCESS if requested operation completed. DTHE_SHA_RETURN_FAILURE if requested operation not completed.

## ◆ DTHE_HMACSHA_compute()

DTHE_SHA_Return_t DTHE_HMACSHA_compute | ( | DTHE_Handle | handle,
|  | DTHE_SHA_Params * | ptrShaParams
| ) |  |

The function is used to execute the HMAC SHA Operations with the specified parameters.

Parameters

  handle | DTHE_Handle returned from DTHE_open().
  ptrShaParams | Pointer to the parameters to be used to execute the driver.

Returns
  DTHE_SHA_RETURN_SUCCESS if requested operation completed. DTHE_SHA_RETURN_FAILURE if requested operation not completed.

## ◆ DTHE_SHA_close()

DTHE_SHA_Return_t DTHE_SHA_close | ( | DTHE_Handle | handle | ) |

Function to close DTHE SHA Driver.

Parameters

  handle | DTHE_Handle returned from DTHE_open().

Returns
  DTHE_SHA_RETURN_SUCCESS if requested operation completed. DTHE_SHA_RETURN_FAILURE if requested operation not completed.