SimpleOTA client main
Shared core of the SimpleOTA Arduino and ESP-IDF clients
Loading...
Searching...
No Matches
sota_sha256.h
Go to the documentation of this file.
1
15#ifndef SOTA_SHA256_H
16#define SOTA_SHA256_H
17
18#include <stddef.h>
19#include <stdint.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
26typedef struct {
27 uint32_t state[8];
28 uint64_t bitlen;
29 uint8_t buffer[64];
30 size_t buffer_len;
32
36void sota_sha256_update(sota_sha256_ctx *ctx, const uint8_t *data, size_t len);
38void sota_sha256_final(sota_sha256_ctx *ctx, uint8_t out[32]);
39
40#ifdef __cplusplus
41}
42#endif
43
44#endif /* SOTA_SHA256_H */
void sota_sha256_final(sota_sha256_ctx *ctx, uint8_t out[32])
Finish the hash and write the 32-byte digest to out.
void sota_sha256_init(sota_sha256_ctx *ctx)
Start a hash.
void sota_sha256_update(sota_sha256_ctx *ctx, const uint8_t *data, size_t len)
Add len bytes from data.
A running SHA-256.
Definition sota_sha256.h:26
size_t buffer_len
Bytes in buffer.
Definition sota_sha256.h:30
uint64_t bitlen
Bits hashed so far.
Definition sota_sha256.h:28