]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
sha256_loop() takes now const void *data parameter.
authorTimo Sirainen <tss@iki.fi>
Thu, 13 Nov 2008 10:05:28 +0000 (12:05 +0200)
committerTimo Sirainen <tss@iki.fi>
Thu, 13 Nov 2008 10:05:28 +0000 (12:05 +0200)
--HG--
branch : HEAD

src/lib/sha2.c
src/lib/sha2.h

index c0757d7bb29cd9c5585289fa8c9608a4bace7ae4..7c544cb71b53d014b5cac4b59beb8821df76cc8c 100644 (file)
@@ -178,7 +178,7 @@ void sha256_init(struct sha256_ctx *ctx)
        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 @@ void sha256_loop(struct sha256_ctx *ctx, const unsigned char *data,
        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);
index 1875a44a60e4593b1a20567019dfd8255c6623de..01f0dc1a2bbc9cbf909f4f47bd6c920466e9a4cb 100644 (file)
@@ -45,7 +45,7 @@ struct sha256_ctx {
 };
 
 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]);