A simple library to support serving https.

Dependents:   oldheating gps motorhome heating

sha/sha1.h

Committer:
andrewboyson
Date:
2019-09-01
Revision:
6:819c17738dc2
Child:
7:94ef5824c3c0

File content as of revision 6:819c17738dc2:

#include <stdint.h>
#define SHA1_DIGEST_SIZE 20
#define SHA1_BLOCK_SIZE 64

struct sha1_ctx
{
    uint32_t count;
    uint32_t state[5];
    union
    {
        uint8_t  b[SHA1_BLOCK_SIZE];
        uint32_t w[SHA1_BLOCK_SIZE / 4];
    } buf;
};
void sha1_init(struct sha1_ctx *ctx);
void sha1_update(struct sha1_ctx *ctx, const uint8_t *data, uint32_t len);
uint8_t *sha1_final(struct sha1_ctx *ctx);