A simple library to support serving https.
Dependents: oldheating gps motorhome heating
sha/sha256.h@4:6a1d887f1cad, 2019-08-20 (annotated)
- Committer:
- andrewboyson
- Date:
- Tue Aug 20 14:50:48 2019 +0000
- Revision:
- 4:6a1d887f1cad
- Parent:
- 3:e6a2c4579a4d
- Child:
- 5:ee5489ee1117
Continued work to implement TLS
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewboyson | 4:6a1d887f1cad | 1 | #pragma once |
andrewboyson | 4:6a1d887f1cad | 2 | |
andrewboyson | 3:e6a2c4579a4d | 3 | #include <stdint.h> |
andrewboyson | 3:e6a2c4579a4d | 4 | |
andrewboyson | 4:6a1d887f1cad | 5 | #define SHA_BLOCK_SIZE 64 |
andrewboyson | 4:6a1d887f1cad | 6 | #define SHA_HASH_SIZE 32 |
andrewboyson | 4:6a1d887f1cad | 7 | |
andrewboyson | 3:e6a2c4579a4d | 8 | struct Sha256State |
andrewboyson | 3:e6a2c4579a4d | 9 | { |
andrewboyson | 3:e6a2c4579a4d | 10 | uint64_t length; |
andrewboyson | 3:e6a2c4579a4d | 11 | uint32_t curlen; |
andrewboyson | 3:e6a2c4579a4d | 12 | uint32_t state[8]; |
andrewboyson | 4:6a1d887f1cad | 13 | uint8_t buf[SHA_BLOCK_SIZE]; |
andrewboyson | 3:e6a2c4579a4d | 14 | }; |
andrewboyson | 3:e6a2c4579a4d | 15 | |
andrewboyson | 4:6a1d887f1cad | 16 | extern void Sha256Start (struct Sha256State *md ); |
andrewboyson | 4:6a1d887f1cad | 17 | extern int Sha256Add (struct Sha256State *md, const uint8_t *in, int inlen ); |
andrewboyson | 4:6a1d887f1cad | 18 | extern int Sha256Finish(struct Sha256State *md, uint8_t *hash); |
andrewboyson | 4:6a1d887f1cad | 19 | extern void Sha256 ( const uint8_t* in, int inlen, uint8_t* hash); |