Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
sha/sha256.h@5:ee5489ee1117, 2019-08-28 (annotated)
- Committer:
 - andrewboyson
 - Date:
 - Wed Aug 28 07:10:59 2019 +0000
 - Revision:
 - 5:ee5489ee1117
 - Parent:
 - 4:6a1d887f1cad
 - Child:
 - 7:94ef5824c3c0
 
Added connection status
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 | 5:ee5489ee1117 | 17 | extern int Sha256Add (struct Sha256State *md, const uint8_t* in, int inlen ); | 
| andrewboyson | 5:ee5489ee1117 | 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); |