X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=crypto%2Flibeddsa%2Flib%2Fsha512.h;fp=crypto%2Flibeddsa%2Flib%2Fsha512.h;h=a4e1dbeadffab8644730e04a888e84418a3a5fde;hb=7bfbc0423ba40ea5156e06c8fb62bacd5ea93390;hp=0000000000000000000000000000000000000000;hpb=2ae349f5ed63b026cff763b35984dd36b330870a;p=zpackage diff --git a/crypto/libeddsa/lib/sha512.h b/crypto/libeddsa/lib/sha512.h new file mode 100644 index 0000000..a4e1dbe --- /dev/null +++ b/crypto/libeddsa/lib/sha512.h @@ -0,0 +1,31 @@ +#ifndef SHA512_H +#define SHA512_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define SHA512_BLOCK_SIZE 128 +#define SHA512_HASH_LENGTH 64 + + +struct sha512 { + uint64_t state[8]; + uint64_t count; + + uint8_t buffer[SHA512_BLOCK_SIZE]; + size_t fill; +}; + +void sha512_init(struct sha512 *ctx); +void sha512_add(struct sha512 *ctx, const uint8_t *data, size_t len); +void sha512_final(struct sha512 *ctx, uint8_t out[SHA512_HASH_LENGTH]); + +#ifdef __cplusplus +} +#endif + +#endif