sha512-256.h - sbase - suckless unix tools | |
git clone git://git.suckless.org/sbase | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
sha512-256.h (523B) | |
--- | |
1 /* public domain sha512/256 implementation based on fips180-3 */ | |
2 | |
3 #include "sha512.h" | |
4 | |
5 #define sha512_256 sha512 /*struct*/ | |
6 | |
7 enum { SHA512_256_DIGEST_LENGTH = 32 }; | |
8 | |
9 /* reset state */ | |
10 void sha512_256_init(void *ctx); | |
11 /* process message */ | |
12 #define sha512_256_update sha512_update | |
13 /* get message digest */ | |
14 /* state is ruined after sum, keep a copy if multiple sum is needed */ | |
15 /* part of the message might be left in s, zero it if secrecy is needed … | |
16 void sha512_256_sum(void *ctx, uint8_t md[SHA512_256_DIGEST_LENGTH]); |