CC26xx Driver Library
rom_sha256.h File Reference
#include <stdint.h>
#include "rom.h"

Macros

#define ECC_NISTP256_PARAM_LENGTH_BYTES   32
 Length in bytes of NISTP256 curve parameters excluding the prepended length word. More...
 
#define ECC_LENGTH_OFFSET_BYTES   4
 Number of bytes for the length word prepended before all parameters passed into the ECC functions. More...
 
#define ECC_NISTP256_PARAM_LENGTH_WITH_OFFSET_BYTES   (ECC_NISTP256_PARAM_LENGTH_BYTES + ECC_LENGTH_OFFSET_BYTES)
 Length in bytes of NISTP256 curve parameters including the prepended length word. More...
 
#define SHA256_SUCCESS   0x77
 
#define SHA256_ERROR   0x88
 

Functions

uint8_t SHA256_init (SHA256_Workzone *workzone)
 Initialize a SHA-256 operation. More...
 
uint8_t SHA256_process (SHA256_Workzone *workzone, uint8_t *inputBuffer, uint32_t bufLength)
 Add a message segment to the hash. More...
 
uint8_t SHA256_final (SHA256_Workzone *workzone, uint8_t *digest)
 Finalize the hash and write back the digest. More...
 
uint8_t SHA256_full (SHA256_Workzone *workzone, uint8_t *digest, uint8_t *inputBuffer, uint32_t bufLength)
 Compute the hash of a message in one go. More...
 

Macro Definition Documentation

§ ECC_LENGTH_OFFSET_BYTES

#define ECC_LENGTH_OFFSET_BYTES   4

Number of bytes for the length word prepended before all parameters passed into the ECC functions.

§ ECC_NISTP256_PARAM_LENGTH_BYTES

#define ECC_NISTP256_PARAM_LENGTH_BYTES   32

Length in bytes of NISTP256 curve parameters excluding the prepended length word.

§ ECC_NISTP256_PARAM_LENGTH_WITH_OFFSET_BYTES

#define ECC_NISTP256_PARAM_LENGTH_WITH_OFFSET_BYTES   (ECC_NISTP256_PARAM_LENGTH_BYTES + ECC_LENGTH_OFFSET_BYTES)

Length in bytes of NISTP256 curve parameters including the prepended length word.

§ SHA256_ERROR

#define SHA256_ERROR   0x88

§ SHA256_SUCCESS

#define SHA256_SUCCESS   0x77

Function Documentation

§ SHA256_final()

uint8_t SHA256_final ( SHA256_Workzone workzone,
uint8_t *  digest 
)

Finalize the hash and write back the digest.

Parameters
[in,out]workzoneWorking memory that holds intermediate results
[out]digestResultant digest of the hash
Returns
Status
66 {
67  return HapiSHA256Final(workzone, digest);
68 }
#define HapiSHA256Final(a, b)
Definition: rom.h:282

§ SHA256_full()

uint8_t SHA256_full ( SHA256_Workzone workzone,
uint8_t *  digest,
uint8_t *  inputBuffer,
uint32_t  bufLength 
)

Compute the hash of a message in one go.

Parameters
[in,out]workzoneWorking memory that holds intermediate results
[out]digestResultant digest of the hash
[in]inputBufferSegment of an input message to process
[in]bufLengthNumber of bytes to process
Returns
Status
77 {
78  return HapiSHA256Full(workzone,
79  digest,
80  inputBuffer,
81  bufLength);
82 }
#define HapiSHA256Full(a, b, c, d)
Definition: rom.h:283

§ SHA256_init()

uint8_t SHA256_init ( SHA256_Workzone workzone)

Initialize a SHA-256 operation.

Parameters
workzoneWorking memory that holds intermediate results
Returns
Status
46 {
47  return HapiSHA256Init(workzone);
48 }
#define HapiSHA256Init(a)
Definition: rom.h:280

§ SHA256_process()

uint8_t SHA256_process ( SHA256_Workzone workzone,
uint8_t *  inputBuffer,
uint32_t  bufLength 
)

Add a message segment to the hash.

Parameters
[in,out]workzoneWorking memory that holds intermediate results
[in]inputBufferSegment of an input message to process
[in]bufLengthNumber of bytes to process
Returns
Status
56 {
57  return HapiSHA256Process(workzone,
58  inputBuffer,
59  bufLength);
60 }
#define HapiSHA256Process(a, b, c)
Definition: rom.h:281