A simple library to support serving https.
Dependents: oldheating gps motorhome heating
Diff: sha/sha256.c
- Revision:
- 14:03a0b8fd6ddc
- Parent:
- 7:94ef5824c3c0
--- a/sha/sha256.c Fri Sep 27 11:31:18 2019 +0000 +++ b/sha/sha256.c Wed Oct 02 20:26:04 2019 +0000 @@ -105,7 +105,7 @@ int Sha256Add(struct Sha256State *md, const uint8_t *in, int inlen) //Return 0 if ok; -1 on error { - if (md->curlen > sizeof(md->buf)) return -1; + if (md->curlen > SHA256_BLOCK_SIZE) return -1; while (inlen > 0) { @@ -136,7 +136,7 @@ int Sha256Finish(struct Sha256State *md, uint8_t *out) //returns 0 on success; -1 on failure { - if (md->curlen >= sizeof(md->buf)) return -1; + if (md->curlen >= SHA256_BLOCK_SIZE) return -1; // increase the length of the message md->length += md->curlen * 8;