diff options
author | Joachim Strömbergson <joachim@secworks.se> | 2014-03-23 07:43:14 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2014-03-23 07:45:06 +0100 |
commit | 609a8daee519d17b1e66aefae2ad4e81ba94539b (patch) | |
tree | bea3460c923b47f14f0e23d705e8cf5af73742f1 /sha2.h | |
parent | 7087e021ba1477ebfeb08ee4eac074921300cab6 (diff) | |
download | nettle-609a8daee519d17b1e66aefae2ad4e81ba94539b.tar.gz |
Support for 224-bit and 256-bit truncated sha512.
Diffstat (limited to 'sha2.h')
-rw-r--r-- | sha2.h | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -43,6 +43,10 @@ extern "C" { #define sha512_init nettle_sha512_init #define sha512_update nettle_sha512_update #define sha512_digest nettle_sha512_digest +#define sha512_224_init nettle_sha512_224_init +#define sha512_224_digest nettle_sha512_224_digest +#define sha512_256_init nettle_sha512_256_init +#define sha512_256_digest nettle_sha512_256_digest /* SHA256 */ @@ -149,6 +153,29 @@ sha384_digest(struct sha512_ctx *ctx, size_t length, uint8_t *digest); + +/* SHA512_224 and SHA512_256, two truncated versions of SHA512 + with different initial states. */ +void +sha512_224_init(struct sha512_ctx *ctx); + +#define sha512_224_update nettle_sha512_update + +void +sha512_224_digest(struct sha512_ctx *ctx, + size_t length, + uint8_t *digest); + +void +sha512_256_init(struct sha512_ctx *ctx); + +#define sha512_256_update nettle_sha512_update + +void +sha512_256_digest(struct sha512_ctx *ctx, + size_t length, + uint8_t *digest); + #ifdef __cplusplus } #endif |