mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-15 02:08:08 +08:00
17 lines
448 B
C
17 lines
448 B
C
#pragma once
|
|
|
|
#include "arch.h"
|
|
|
|
typedef struct {
|
|
uint32_t state[8];
|
|
uint64_t bits;
|
|
uint32_t len;
|
|
unsigned char buffer[64];
|
|
} mg_sha256_ctx;
|
|
|
|
void mg_sha256_init(mg_sha256_ctx *);
|
|
void mg_sha256_update(mg_sha256_ctx *, const unsigned char *data, size_t len);
|
|
void mg_sha256_final(unsigned char digest[32], mg_sha256_ctx *);
|
|
void mg_hmac_sha256(uint8_t dst[32], uint8_t *key, size_t keysz, uint8_t *data,
|
|
size_t datasz);
|