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/sha1.h@14:03a0b8fd6ddc, 2019-10-02 (annotated)
- Committer:
- andrewboyson
- Date:
- Wed Oct 02 20:26:04 2019 +0000
- Revision:
- 14:03a0b8fd6ddc
- Parent:
- 7:94ef5824c3c0
Session resume now working. TLS working quickly after the initial 5 second RSA decrypt time using the 1024 bit private key.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewboyson | 7:94ef5824c3c0 | 1 | #pragma once |
andrewboyson | 7:94ef5824c3c0 | 2 | |
andrewboyson | 6:819c17738dc2 | 3 | #include <stdint.h> |
andrewboyson | 14:03a0b8fd6ddc | 4 | #define SHA1_BLOCK_SIZE 64 |
andrewboyson | 7:94ef5824c3c0 | 5 | #define SHA1_HASH_SIZE 20 |
andrewboyson | 6:819c17738dc2 | 6 | |
andrewboyson | 7:94ef5824c3c0 | 7 | struct Sha1State |
andrewboyson | 6:819c17738dc2 | 8 | { |
andrewboyson | 6:819c17738dc2 | 9 | uint32_t count; |
andrewboyson | 7:94ef5824c3c0 | 10 | uint32_t state[SHA1_HASH_SIZE / 4]; |
andrewboyson | 6:819c17738dc2 | 11 | union |
andrewboyson | 6:819c17738dc2 | 12 | { |
andrewboyson | 6:819c17738dc2 | 13 | uint8_t b[SHA1_BLOCK_SIZE]; |
andrewboyson | 6:819c17738dc2 | 14 | uint32_t w[SHA1_BLOCK_SIZE / 4]; |
andrewboyson | 6:819c17738dc2 | 15 | } buf; |
andrewboyson | 6:819c17738dc2 | 16 | }; |
andrewboyson | 7:94ef5824c3c0 | 17 | extern void Sha1Start (struct Sha1State *ctx ); |
andrewboyson | 7:94ef5824c3c0 | 18 | extern void Sha1Add (struct Sha1State *ctx, const uint8_t *data, int len ); |
andrewboyson | 7:94ef5824c3c0 | 19 | extern void Sha1Finish(struct Sha1State *ctx, uint8_t *out); |
andrewboyson | 7:94ef5824c3c0 | 20 | extern void Sha1 ( const uint8_t *data, int len, uint8_t *out); |