Commit c63c2c06 authored by Niels Möller's avatar Niels Möller
Browse files

Re-indent poly1305 code.

parent 04d29c83
......@@ -39,7 +39,7 @@
void poly1305_set_key(struct poly1305_ctx *ctx, const uint8_t key[16])
{
uint32_t t0,t1,t2,t3;
uint32_t t0,t1,t2,t3;
t0 = LE_READ_UINT32(key);
t1 = LE_READ_UINT32(key+4);
......@@ -96,7 +96,7 @@ poly1305_block (struct poly1305_ctx *ctx, const uint8_t m[16])
ctx->h3 += ((((uint64_t)t3 << 32) | t2) >> 14) & 0x3ffffff;
ctx->h4 += (t3 >> 8) | (1 << 24);
/* poly1305_donna_mul: */
/* poly1305_donna_mul: */
t[0] = mul32x32_64(ctx->h0,ctx->r0) + mul32x32_64(ctx->h1,ctx->s4) + mul32x32_64(ctx->h2,ctx->s3) + mul32x32_64(ctx->h3,ctx->s2) + mul32x32_64(ctx->h4,ctx->s1);
t[1] = mul32x32_64(ctx->h0,ctx->r1) + mul32x32_64(ctx->h1,ctx->r0) + mul32x32_64(ctx->h2,ctx->s4) + mul32x32_64(ctx->h3,ctx->s3) + mul32x32_64(ctx->h4,ctx->s2);
t[2] = mul32x32_64(ctx->h0,ctx->r2) + mul32x32_64(ctx->h1,ctx->r1) + mul32x32_64(ctx->h2,ctx->r0) + mul32x32_64(ctx->h3,ctx->s4) + mul32x32_64(ctx->h4,ctx->s3);
......@@ -126,7 +126,7 @@ poly1305_digest (struct poly1305_ctx *ctx,
uint8_t td[16];
/* final bytes */
/* poly1305_donna_atmost15bytes: */
/* poly1305_donna_atmost15bytes: */
if (!ctx->index) goto poly1305_donna_finish;
for (j = 0; j < ctx->index; j++) mp[j] = ctx->block[j];
......@@ -144,7 +144,7 @@ poly1305_digest (struct poly1305_ctx *ctx,
ctx->h3 += ((((uint64_t)t3 << 32) | t2) >> 14) & 0x3ffffff;
ctx->h4 += (t3 >> 8);
/* poly1305_donna_mul: */
/* poly1305_donna_mul: */
t[0] = mul32x32_64(ctx->h0,ctx->r0) + mul32x32_64(ctx->h1,ctx->s4) + mul32x32_64(ctx->h2,ctx->s3) + mul32x32_64(ctx->h3,ctx->s2) + mul32x32_64(ctx->h4,ctx->s1);
t[1] = mul32x32_64(ctx->h0,ctx->r1) + mul32x32_64(ctx->h1,ctx->r0) + mul32x32_64(ctx->h2,ctx->s4) + mul32x32_64(ctx->h3,ctx->s3) + mul32x32_64(ctx->h4,ctx->s2);
t[2] = mul32x32_64(ctx->h0,ctx->r2) + mul32x32_64(ctx->h1,ctx->r1) + mul32x32_64(ctx->h2,ctx->r0) + mul32x32_64(ctx->h3,ctx->s4) + mul32x32_64(ctx->h4,ctx->s3);
......@@ -158,7 +158,7 @@ poly1305_digest (struct poly1305_ctx *ctx,
t[4] += b; ctx->h4 = (uint32_t)t[4] & 0x3ffffff; b = (uint32_t)(t[4] >> 26);
ctx->h0 += b * 5;
poly1305_donna_finish:
poly1305_donna_finish:
b = ctx->h0 >> 26; ctx->h0 = ctx->h0 & 0x3ffffff;
ctx->h1 += b; b = ctx->h1 >> 26; ctx->h1 = ctx->h1 & 0x3ffffff;
ctx->h2 += b; b = ctx->h2 >> 26; ctx->h2 = ctx->h2 & 0x3ffffff;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment