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

Oleg Hahm notifications at github.com
Fri Aug 9 17:16:50 CEST 2013


> +    be32dec_vect(W, block, 64);
> +    for (int i = 16; i < 64; i++) {
> +        W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16];
> +    }
> +
> +    /* 2. Initialize working variables. */
> +    memcpy(S, state, 32);
> +
> +    /* 3. Mix. */
> +    for (int i = 0; i < 64; ++i) {
> +        uint32_t e = S[(68 - i) % 8], f = S[(69 - i) % 8];
> +        uint32_t g = S[(70 - i) % 8], h = S[(71 - i) % 8];
> +        uint32_t t0 = h + S1(e) + Ch(e, f, g) + W[i] + K[i];
> +
> +        uint32_t a = S[(64 - i) % 8], b = S[(65 - i) % 8];
> +        uint32_t c = S[(66 - i) % 8], d = S[(67 - i) % 8];

warning: unused variable 'd'

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


More information about the notifications mailing list