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

Oleg Hahm notifications at github.com
Fri Aug 9 17:26:25 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);

For a MSP430 
```
sha256.c: In function ‘SHA256_Update’:
sha256.c:200:5: warning: right shift count >= width of type [enabled by default]
```

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


More information about the notifications mailing list