13#define mul32x32_64(a, b) ((uint64_t)(a) * (b))
17 uint32_t t0, t1, t2, t3;
18 uint32_t h0, h1, h2, h3, h4;
19 uint32_t r0, r1, r2, r3, r4;
20 uint32_t s1, s2, s3, s4;
24 uint64_t f0, f1, f2, f3;
25 uint64_t g0, g1, g2, g3, g4;
63 goto poly1305_donna_atmost15bytes;
66poly1305_donna_16bytes:
76 h1 += ((((uint64_t)t1 << 32) | t0) >> 26) & 0x3ffffff;
77 h2 += ((((uint64_t)t2 << 32) | t1) >> 20) & 0x3ffffff;
78 h3 += ((((uint64_t)t3 << 32) | t2) >> 14) & 0x3ffffff;
79 h4 += (t3 >> 8) | (1 << 24);
93 h0 = (uint32_t)t[0] & 0x3ffffff;
96 h1 = (uint32_t)t[1] & 0x3ffffff;
97 b = (uint32_t)(t[1] >> 26);
99 h2 = (uint32_t)t[2] & 0x3ffffff;
100 b = (uint32_t)(t[2] >> 26);
102 h3 = (uint32_t)t[3] & 0x3ffffff;
103 b = (uint32_t)(t[3] >> 26);
105 h4 = (uint32_t)t[4] & 0x3ffffff;
106 b = (uint32_t)(t[4] >> 26);
110 goto poly1305_donna_16bytes;
114poly1305_donna_atmost15bytes:
116 goto poly1305_donna_finish;
119 for (j = 0; j < inlen; j++) {
123 for (; j < 16; j++) {
133 h0 += t0 & 0x3ffffff;
134 h1 += ((((uint64_t)t1 << 32) | t0) >> 26) & 0x3ffffff;
135 h2 += ((((uint64_t)t2 << 32) | t1) >> 20) & 0x3ffffff;
136 h3 += ((((uint64_t)t3 << 32) | t2) >> 14) & 0x3ffffff;
139 goto poly1305_donna_mul;
141poly1305_donna_finish:
173 g4 = h4 + b - (1 << 26);
177 h0 = (h0 & nb) | (g0 & b);
178 h1 = (h1 & nb) | (g1 & b);
179 h2 = (h2 & nb) | (g2 & b);
180 h3 = (h3 & nb) | (g3 & b);
181 h4 = (h4 & nb) | (g4 & b);
183 f0 = ((h0) | (h1 << 26)) + (uint64_t)
ReadLE32(&key[16]);
184 f1 = ((h1 >> 6) | (h2 << 20)) + (uint64_t)
ReadLE32(&key[20]);
185 f2 = ((h2 >> 12) | (h3 << 14)) + (uint64_t)
ReadLE32(&key[24]);
186 f3 = ((h3 >> 18) | (h4 << 8)) + (uint64_t)
ReadLE32(&key[28]);
static void WriteLE32(uint8_t *ptr, uint32_t x)
static uint32_t ReadLE32(const uint8_t *ptr)
#define mul32x32_64(a, b)
void poly1305_auth(uint8_t out[POLY1305_TAGLEN], const uint8_t *m, size_t inlen, const uint8_t key[POLY1305_KEYLEN])