nt9856x/code/application/source/sf_app/code/include/sha256.h
2023-05-17 15:33:39 +08:00

34 lines
681 B
C

#include "sf_type.h"
#define SHA256_HASH_SIZE 32
/* Hash size in 32-bit words */
#define SHA256_HASH_WORDS 8
struct _SHA256Context {
unsigned long long totalLength;
UINT32 hash[SHA256_HASH_WORDS];
UINT32 bufferLength;
union {
UINT32 words[16];
UINT8 bytes[64];
} buffer;
#ifdef RUNTIME_ENDIAN
int littleEndian;
#endif /* RUNTIME_ENDIAN */
};
typedef struct _SHA256Context SHA256Context;
#ifdef __cplusplus
extern "C" {
#endif
void SHA256Init (SHA256Context *sc);
void SHA256Update (SHA256Context *sc, const void *data, UINT32 len);
void SHA256Final (SHA256Context *sc, UINT8 hash[SHA256_HASH_SIZE]);
#ifdef __cplusplus
}
#endif