Commit 9959f304 authored by Niels Möller's avatar Niels Möller

New aliases sha512_224_ctx and sha512_256_cxt, for the sha512_ctx struct tag.

parent 9b29534a
2014-04-22 Niels Möller <nisse@lysator.liu.se>
* sha2.h (sha512_224_ctx, sha512_256_ctx): New aliases for the
sha512_ctx struct tag.
2014-04-17 Niels Möller <nisse@lysator.liu.se> 2014-04-17 Niels Möller <nisse@lysator.liu.se>
* examples/Makefile.in (SOURCES): Deleted next-prime.c (forgotten * examples/Makefile.in (SOURCES): Deleted next-prime.c (forgotten
......
...@@ -167,25 +167,29 @@ sha384_digest(struct sha512_ctx *ctx, ...@@ -167,25 +167,29 @@ sha384_digest(struct sha512_ctx *ctx,
#define SHA512_224_DIGEST_SIZE 28 #define SHA512_224_DIGEST_SIZE 28
#define SHA512_224_DATA_SIZE SHA512_DATA_SIZE #define SHA512_224_DATA_SIZE SHA512_DATA_SIZE
#define sha512_224_ctx sha512_ctx
void void
sha512_224_init(struct sha512_ctx *ctx); sha512_224_init(struct sha512_224_ctx *ctx);
#define sha512_224_update nettle_sha512_update #define sha512_224_update nettle_sha512_update
void void
sha512_224_digest(struct sha512_ctx *ctx, sha512_224_digest(struct sha512_224_ctx *ctx,
size_t length, size_t length,
uint8_t *digest); uint8_t *digest);
#define SHA512_256_DIGEST_SIZE 32 #define SHA512_256_DIGEST_SIZE 32
#define SHA512_256_DATA_SIZE SHA512_DATA_SIZE #define SHA512_256_DATA_SIZE SHA512_DATA_SIZE
#define sha512_256_ctx sha512_ctx
void void
sha512_256_init(struct sha512_ctx *ctx); sha512_256_init(struct sha512_256_ctx *ctx);
#define sha512_256_update nettle_sha512_update #define sha512_256_update nettle_sha512_update
void void
sha512_256_digest(struct sha512_ctx *ctx, sha512_256_digest(struct sha512_256_ctx *ctx,
size_t length, size_t length,
uint8_t *digest); uint8_t *digest);
......
...@@ -249,7 +249,7 @@ sha384_digest(struct sha512_ctx *ctx, ...@@ -249,7 +249,7 @@ sha384_digest(struct sha512_ctx *ctx,
/* sha-512/224 variant. */ /* sha-512/224 variant. */
void void
sha512_224_init(struct sha512_ctx *ctx) sha512_224_init(struct sha512_224_ctx *ctx)
{ {
static const uint64_t H0[_SHA512_DIGEST_LENGTH] = static const uint64_t H0[_SHA512_DIGEST_LENGTH] =
{ {
...@@ -269,7 +269,7 @@ sha512_224_init(struct sha512_ctx *ctx) ...@@ -269,7 +269,7 @@ sha512_224_init(struct sha512_ctx *ctx)
} }
void void
sha512_224_digest(struct sha512_ctx *ctx, sha512_224_digest(struct sha512_224_ctx *ctx,
size_t length, size_t length,
uint8_t *digest) uint8_t *digest)
{ {
...@@ -282,7 +282,7 @@ sha512_224_digest(struct sha512_ctx *ctx, ...@@ -282,7 +282,7 @@ sha512_224_digest(struct sha512_ctx *ctx,
/* sha-512/256 variant. */ /* sha-512/256 variant. */
void void
sha512_256_init(struct sha512_ctx *ctx) sha512_256_init(struct sha512_256_ctx *ctx)
{ {
static const uint64_t H0[_SHA512_DIGEST_LENGTH] = static const uint64_t H0[_SHA512_DIGEST_LENGTH] =
{ {
...@@ -302,7 +302,7 @@ sha512_256_init(struct sha512_ctx *ctx) ...@@ -302,7 +302,7 @@ sha512_256_init(struct sha512_ctx *ctx)
} }
void void
sha512_256_digest(struct sha512_ctx *ctx, sha512_256_digest(struct sha512_256_ctx *ctx,
size_t length, size_t length,
uint8_t *digest) uint8_t *digest)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment