* key-data.c:key_nextsubkey -- explicitly return nonzero if we found
something.
* key-io.c:key_new -- cast the constant type pointer during the
unpleasant hack.
* mp-mem.c:mp_build -- store an arena in the built integer; otherwise
pgen_primep (for example) gets confused later on.
* mp-modsqrt.c:mp_modsqrt -- fix the maths in a comment; the code was
fine.
* oaep.c:oaep_decode -- don't try to do too much in one expression.
* pgen-simul.c:pgen_simultest -- always return a sensible result code.
* cc.h:sig -- hash classes are constant.
* cc-{kem,sig}.c:get{kem,sig} -- initialize the kp structure member,
just in case.
* rijndael*.c, square.c -- fix const-correctness errors.
13 files changed:
if (!ko->kf) {
kd = k->k;
key_incref(kd);
if (!ko->kf) {
kd = k->k;
key_incref(kd);
} else {
kd = xmalloc(ko->kdsz);
kp = key_fetchinit(ko->kf, 0, kd);
} else {
kd = xmalloc(ko->kdsz);
kp = key_fetchinit(ko->kf, 0, kd);
if (!so->kf) {
kd = k->k;
key_incref(kd);
if (!so->kf) {
kd = k->k;
key_incref(kd);
} else {
kd = xmalloc(so->kdsz);
kp = key_fetchinit(so->kf, 0, kd);
} else {
kd = xmalloc(so->kdsz);
kp = key_fetchinit(so->kf, 0, kd);
const struct sigops *ops;
key_packdef *kp;
void *kd;
const struct sigops *ops;
key_packdef *kp;
void *kd;
return (0);
if (tag) *tag = SYM_NAME(ks);
if (kd) *kd = ks->k;
return (0);
if (tag) *tag = SYM_NAME(ks);
if (kd) *kd = ks->k;
}
/* --- @key_structset@, @key_structsteal@ --- *
}
/* --- @key_structset@, @key_structsteal@ --- *
k->tag = 0;
k->exp = k->del = exp;
k->c = 0;
k->tag = 0;
k->exp = k->del = exp;
k->c = 0;
- k->type = type; /* temporarily */
+ k->type = (char *)type; /* temporarily */
sym_create(&k->a);
if ((e = insert(f, k)) != 0)
DESTROY(k);
sym_create(&k->a);
if ((e = insert(f, k)) != 0)
DESTROY(k);
m->v = v;
m->vl = vl;
m->sz = vl - v;
m->v = v;
m->vl = vl;
m->sz = vl - v;
m->f = MP_CONST;
m->ref = 1;
}
m->f = MP_CONST;
m->ref = 1;
}
dd = mpmont_reduce(&mm, dd, dd);
dd = mpmont_mul(&mm, dd, dd, ainv);
dd = mpmont_reduce(&mm, dd, dd);
dd = mpmont_mul(&mm, dd, dd, ainv);
- /* --- Now %$d = d_0^{s - i - 1}$% --- */
+ /* --- Now %$d = d_0^{2^{s - i - 1}}$% --- */
for (j = i; j < s - 1; j++) {
dd = mp_sqr(dd, dd);
for (j = i; j < s - 1; j++) {
dd = mp_sqr(dd, dd);
pp = mq + hsz;
while (*pp == 0 && pp < qq)
pp++;
pp = mq + hsz;
while (*pp == 0 && pp < qq)
pp++;
- bad |= (pp >= qq) | (*pp++ != 1);
+ bad |= (pp >= qq) | (*pp != 1);
+ pp++;
n = qq - pp;
memmove(q, pp, n);
return (bad ? -1 : n);
n = qq - pp;
memmove(q, pp, n);
return (bad ? -1 : n);
case PGEN_DONE:
for (i = 0; i < ss->n; i++)
rabin_destroy(&ss->v[i].r);
case PGEN_DONE:
for (i = 0; i < ss->n; i++)
rabin_destroy(&ss->v[i].r);
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3];
uint32 aa, bb, cc, dd;
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3];
uint32 aa, bb, cc, dd;
+ const uint32 *w = k->w;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;
aa = a; bb = b; cc = c; dd = d;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;
aa = a; bb = b; cc = c; dd = d;
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3];
uint32 aa, bb, cc, dd;
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3];
uint32 aa, bb, cc, dd;
+ const uint32 *w = k->wi;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;
aa = a; bb = b; cc = c; dd = d;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;
aa = a; bb = b; cc = c; dd = d;
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5];
uint32 aa, bb, cc, dd, ee, ff;
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5];
uint32 aa, bb, cc, dd, ee, ff;
+ const uint32 *w = k->w;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++; e ^= *w++; f ^= *w++;
aa = a; bb = b; cc = c; dd = d; ee = e; ff = f;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++; e ^= *w++; f ^= *w++;
aa = a; bb = b; cc = c; dd = d; ee = e; ff = f;
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5];
uint32 aa, bb, cc, dd, ee, ff;
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5];
uint32 aa, bb, cc, dd, ee, ff;
+ const uint32 *w = k->wi;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++; e ^= *w++; f ^= *w++;
aa = a; bb = b; cc = c; dd = d; ee = e; ff = f;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++; e ^= *w++; f ^= *w++;
aa = a; bb = b; cc = c; dd = d; ee = e; ff = f;
uint32 a = s[0], b = s[1], c = s[2], d = s[3];
uint32 e = s[4], f = s[5], g = s[6], h = s[7];
uint32 aa, bb, cc, dd, ee, ff, gg, hh;
uint32 a = s[0], b = s[1], c = s[2], d = s[3];
uint32 e = s[4], f = s[5], g = s[6], h = s[7];
uint32 aa, bb, cc, dd, ee, ff, gg, hh;
+ const uint32 *w = k->w;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;
e ^= *w++; f ^= *w++; g ^= *w++; h ^= *w++;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;
e ^= *w++; f ^= *w++; g ^= *w++; h ^= *w++;
uint32 a = s[0], b = s[1], c = s[2], d = s[3];
uint32 e = s[4], f = s[5], g = s[6], h = s[7];
uint32 aa, bb, cc, dd, ee, ff, gg, hh;
uint32 a = s[0], b = s[1], c = s[2], d = s[3];
uint32 e = s[4], f = s[5], g = s[6], h = s[7];
uint32 aa, bb, cc, dd, ee, ff, gg, hh;
+ const uint32 *w = k->wi;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;
e ^= *w++; f ^= *w++; g ^= *w++; h ^= *w++;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;
e ^= *w++; f ^= *w++; g ^= *w++; h ^= *w++;
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3];
uint32 aa, bb, cc, dd;
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3];
uint32 aa, bb, cc, dd;
+ const uint32 *w = k->w;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3];
uint32 aa, bb, cc, dd;
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3];
uint32 aa, bb, cc, dd;
+ const uint32 *w = k->wi;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;