Files
kunlun/rom/riscv/inc/sha256.h
2024-09-28 14:24:04 +08:00

23 lines
633 B
C

#ifndef _ROM_SHA256_H_
#define _ROM_SHA256_H_
/**
* SHA-256 context structure
*/
typedef struct
{
uint32_t total[2]; /*!< number of bytes processed */
uint32_t state[8]; /*!< intermediate digest state */
unsigned char buffer[64]; /*!< data block being processed */
}sha256_context;
void sha256_init( sha256_context *ctx );
void sha256_free( sha256_context *ctx );
void sha256_starts( sha256_context *ctx );
void sha256_update( sha256_context *ctx, const unsigned char *input,
unsigned int ilen );
void sha256_finish( sha256_context *ctx, unsigned char output[32] );
#endif