/*
- * Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2015-2016 Cryptography Research, Inc.
*
* Licensed under the OpenSSL license (the "License"). You may not use
mask_t gf_hibit(const gf x)
{
gf y;
+
gf_add(y, x, x);
gf_strong_reduce(y);
return 0 - (y->limb[0] & 1);
mask_t gf_lobit(const gf x)
{
gf y;
+
gf_copy(y, x);
gf_strong_reduce(y);
return 0 - (y->limb[0] & 1);
gf_sub(c, a, b);
gf_strong_reduce(c);
- for (i = 0; i < NLIMBS; i++) {
+ for (i = 0; i < NLIMBS; i++)
ret |= c->limb[LIMBPERM(i)];
- }
return word_is_zero(ret);
}
mask_t gf_isr(gf a, const gf x)
{
gf L0, L1, L2;
+
gf_sqr(L1, x);
gf_mul(L2, x, L1);
gf_sqr(L1, L2);