Skip to content

Commit

Permalink
Add another optblocker
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Aug 1, 2024
1 parent 92611e3 commit 6edcd85
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ poly1305_init_ext(poly1305_state_internal_t *st, const unsigned char key[32],
st->leftover = 0U;
}

static volatile uint64_t optblocker_u64;

static POLY1305_NOINLINE void
poly1305_blocks(poly1305_state_internal_t *st, const unsigned char *m,
unsigned long long bytes)
Expand Down Expand Up @@ -745,7 +747,7 @@ poly1305_blocks(poly1305_state_internal_t *st, const unsigned char *m,
g1 &= 0xfffffffffff;
g2 = h2 + c - ((uint64_t) 1 << 42);

c = (g2 >> 63) - 1;
c = (((g2 >> 61) ^ optblocker_u64) >> 2) - 1;
nc = ~c;
h0 = (h0 & nc) | (g0 & c);
h1 = (h1 & nc) | (g1 & c);
Expand Down

0 comments on commit 6edcd85

Please sign in to comment.