[riot-notifications] [RIOT] add sha256 implementation (#96)

René Kijewski notifications at github.com
Fri Aug 9 17:51:11 CEST 2013


> +    ctx->state[3] = 0xA54FF53A;
> +    ctx->state[4] = 0x510E527F;
> +    ctx->state[5] = 0x9B05688C;
> +    ctx->state[6] = 0x1F83D9AB;
> +    ctx->state[7] = 0x5BE0CD19;
> +}
> +
> +/* Add bytes into the hash */
> +void SHA256_Update(SHA256_CTX *ctx, const void *in, size_t len)
> +{
> +    /* Number of bytes left in the buffer from previous updates */
> +    uint32_t r = (ctx->count[1] >> 3) & 0x3f;
> +
> +    /* Convert the length into a number of bits */
> +    uint32_t bitlen1 = ((uint32_t) len) << 3;
> +    uint32_t bitlen0 = (uint32_t)(len >> 29);

Wrong bracing, should have been:

     uint32_t bitlen0 = ((uint32_t) len) >> 29;

Maybe that bug should be reported to the FreeBSD guys?

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/96/files#r5686095
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20130809/b226383c/attachment.html>


More information about the notifications mailing list