X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fcrypto%2Fsha256%2Fsha256.c;h=95c700692ce50a0f2a57163a41706f9bb8980c79;hp=4b1f8cdf303af328320691cc4ee8b8403c65fb5a;hb=98d16c40f7cb21268751da58c0cb0d14efd38c5a;hpb=f989a43b55795c04a6225b392f3f58afd2cd6543 diff --git a/ccan/crypto/sha256/sha256.c b/ccan/crypto/sha256/sha256.c index 4b1f8cdf..95c70069 100644 --- a/ccan/crypto/sha256/sha256.c +++ b/ccan/crypto/sha256/sha256.c @@ -36,7 +36,7 @@ void sha256_init(struct sha256_ctx *ctx) SHA256_Init(&ctx->c); } -void sha256_update_bytes(struct sha256_ctx *ctx, const void *p, size_t size) +void sha256_update(struct sha256_ctx *ctx, const void *p, size_t size) { check_sha256(ctx); SHA256_Update(&ctx->c, p, size); @@ -181,7 +181,7 @@ static void add(struct sha256_ctx *ctx, const void *p, size_t len) size_t bufsize = ctx->bytes % 64; if (bufsize + len >= 64) { - // Fill the buffer, and process it. + /* Fill the buffer, and process it. */ memcpy(ctx->buf.u8 + bufsize, data, 64 - bufsize); ctx->bytes += 64 - bufsize; data += 64 - bufsize; @@ -191,7 +191,7 @@ static void add(struct sha256_ctx *ctx, const void *p, size_t len) } while (len >= 64) { - // Process full chunks directly from the source. + /* Process full chunks directly from the source. */ if (alignment_ok(data, sizeof(uint32_t))) Transform(ctx->s, (const uint32_t *)data); else { @@ -204,7 +204,7 @@ static void add(struct sha256_ctx *ctx, const void *p, size_t len) } if (len) { - // Fill the buffer with what remains. + /* Fill the buffer with what remains. */ memcpy(ctx->buf.u8 + bufsize, data, len); ctx->bytes += len; }