Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
CC32xxSha.hxx
Go to the documentation of this file.
1
36
#ifndef _CC32xxSHA_HXX_
37
#define _CC32xxSHA_HXX_
38
39
#define USE_CC3220_ROM_DRV_API
40
41
#include "driverlib/prcm.h"
42
#include "driverlib/rom.h"
43
#include "driverlib/rom_map.h"
44
#include "driverlib/shamd5.h"
45
#include "inc/hw_dthe.h"
46
#include "inc/hw_memmap.h"
47
#include "inc/hw_types.h"
48
49
#include <string>
50
51
#include "
utils/SyncStream.hxx
"
52
53
class
SHAHelper
54
{
55
public
:
61
static
std::string
sha256
(
const
void
*data,
size_t
len)
62
{
63
MAP_SHAMD5ConfigSet(SHAMD5_BASE, SHAMD5_ALGO_SHA256, 1, 1, 0, 0);
64
std::string ret(32, 0);
65
// Note: this should really be SHAMD5DataProcess, but that has an
66
// assert on len%64 == 0 for no reason. The below function does the
67
// same thing but without the extra assert.
68
ROM_SHAMD5DataProcess(
69
SHAMD5_BASE, (uint8_t *)data, len, (uint8_t *)&ret[0]);
70
return
ret;
71
}
72
73
private
:
75
SHAHelper
();
76
};
77
78
#endif
// _CC32xxSHA_HXX_
SyncStream.hxx
SHAHelper
Definition
CC32xxSha.hxx:54
SHAHelper::SHAHelper
SHAHelper()
This class cannot be instantiated.
SHAHelper::sha256
static std::string sha256(const void *data, size_t len)
Computes a SHA-256 hash of the given input data.
Definition
CC32xxSha.hxx:61
src
freertos_drivers
ti
CC32xxSha.hxx
Generated on Sun Feb 2 2025 21:18:13 for Open Model Railroad Network (OpenMRN) by
1.9.8