Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8393:44f3bf2d0671 HEAD
sha256_loop() takes now const void *data parameter.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 13 Nov 2008 12:05:28 +0200 |
parents | 3b6999dc112f |
children | 8be0fe79093b |
files | src/lib/sha2.c src/lib/sha2.h |
diffstat | 2 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/sha2.c Wed Nov 12 17:08:15 2008 +0200 +++ b/src/lib/sha2.c Thu Nov 13 12:05:28 2008 +0200 @@ -178,7 +178,7 @@ ctx->tot_len = 0; } -void sha256_loop(struct sha256_ctx *ctx, const unsigned char *data, +void sha256_loop(struct sha256_ctx *ctx, const void *data, size_t len) { const unsigned char *shifted_message; @@ -198,7 +198,7 @@ new_len = len - rem_len; block_nb = new_len / SHA256_BLOCK_SIZE; - shifted_message = data + rem_len; + shifted_message = CONST_PTR_OFFSET(data, rem_len); sha256_transf(ctx, ctx->block, 1); sha256_transf(ctx, shifted_message, block_nb);
--- a/src/lib/sha2.h Wed Nov 12 17:08:15 2008 +0200 +++ b/src/lib/sha2.h Thu Nov 13 12:05:28 2008 +0200 @@ -45,7 +45,7 @@ }; void sha256_init(struct sha256_ctx *ctx); -void sha256_loop(struct sha256_ctx *ctx, const unsigned char *data, size_t len); +void sha256_loop(struct sha256_ctx *ctx, const void *data, size_t len); void sha256_result(struct sha256_ctx *ctx, unsigned char digest[SHA256_RESULTLEN]);