diff options
author | Brad King <brad.king@kitware.com> | 2016-11-03 17:45:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-03 17:45:29 (GMT) |
commit | 5cb1b345d932d3e0dc34a2d423894a59a6c8db35 (patch) | |
tree | e65b51405aeffee8b4ca00523fe450c76cf3aec0 /Utilities/cmlibrhash/librhash/sha512.h | |
parent | 798b0adc628ab16dbb4d04ef444b8e7db4f5cffa (diff) | |
parent | 1367fccc330b0ff314845aeb3547bbc38486913a (diff) | |
download | CMake-5cb1b345d932d3e0dc34a2d423894a59a6c8db35.zip CMake-5cb1b345d932d3e0dc34a2d423894a59a6c8db35.tar.gz CMake-5cb1b345d932d3e0dc34a2d423894a59a6c8db35.tar.bz2 |
Merge branch 'upstream-librhash' into import-librhash
* upstream-librhash:
librhash 2016-11-01 (d839a1a8)
Diffstat (limited to 'Utilities/cmlibrhash/librhash/sha512.h')
-rw-r--r-- | Utilities/cmlibrhash/librhash/sha512.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Utilities/cmlibrhash/librhash/sha512.h b/Utilities/cmlibrhash/librhash/sha512.h new file mode 100644 index 0000000..7c689be --- /dev/null +++ b/Utilities/cmlibrhash/librhash/sha512.h @@ -0,0 +1,32 @@ +/* sha.h sha512 and sha384 hash functions */ +#ifndef SHA512_H +#define SHA512_H +#include "ustd.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define sha512_block_size 128 +#define sha512_hash_size 64 +#define sha384_hash_size 48 + +/* algorithm context */ +typedef struct sha512_ctx +{ + uint64_t message[16]; /* 1024-bit buffer for leftovers */ + uint64_t length; /* number of processed bytes */ + uint64_t hash[8]; /* 512-bit algorithm internal hashing state */ + unsigned digest_length; /* length of the algorithm digest in bytes */ +} sha512_ctx; + +void rhash_sha384_init(sha512_ctx *ctx); +void rhash_sha512_init(sha512_ctx *ctx); +void rhash_sha512_update(sha512_ctx *ctx, const unsigned char* data, size_t length); +void rhash_sha512_final(sha512_ctx *ctx, unsigned char* result); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* SHA512_H */ |