octet b[9];
unsigned i;
- SET64(t, ((n&~MASK32) >> 16) >> 16, n&MASK32);
+ SET64(t, ((n&~(size_t)MASK32) >> 16) >> 16, n&MASK32);
STORE64_B_(b + 1, t);
for (i = 1; i < 8 && !b[i]; i++);
i--; b[i] = 8 - i;
octet b[9];
unsigned i;
- SET64(t, ((n&~MASK32) >> 16) >> 16, n&MASK32);
+ SET64(t, ((n&~(size_t)MASK32) >> 16) >> 16, n&MASK32);
STORE64_B_(b, t);
for (i = 0; i < 7 && !b[i]; i++);
b[8] = 8 - i;
static gcipher *shake256_gcinit(const void *k, size_t sz)
{
shake_gcctx *cc = S_CREATE(shake_gcctx);
- cc->gc.ops = &shake128_gcops;
+ cc->gc.ops = &shake256_gcops;
shake256_init(&cc->c); shake_hash(&cc->c, k, sz); shake_xof(&cc->c);
return (&cc->gc);
}
#include <stdio.h>
+#include <mLib/macros.h>
#include <mLib/report.h>
#include <mLib/testrig.h>
sha3_done(&ctx, d.buf);
}
- if (memcmp(d.buf, out->buf, out->len) != 0) {
+ if (MEMCMP(d.buf, !=, out->buf, out->len)) {
ok = 0;
printf("\nfail\n\tsteps = %d\n\tinput = ", n);
type_hex.dump(in, stdout);
p += i; sz -= i;
}
- if (memcmp(d.buf, want->buf, want->len) != 0) {
+ if (MEMCMP(d.buf, !=, want->buf, want->len)) {
ok = 0;
printf("\nfail (get):\n\tstep = %i\n\tinput = ", *ip);
type_hex.dump(m, stdout);
p += i; sz -= i;
}
- if (memcmp(d.buf, want->buf, want->len) != 0) {
+ if (MEMCMP(d.buf, !=, want->buf, want->len)) {
ok = 0;
printf("\nfail (mask):\n\tstep = %i\n\tinput = ", *ip);
type_hex.dump(m, stdout);
if (tsz) kmac_done(&ctx, d.buf, tsz);
else { kmac_xof(&ctx); kmac_get(&ctx, d.buf, d.len); }
- if (memcmp(d.buf, want->buf, want->len) != 0) {
+ if (MEMCMP(d.buf, !=, want->buf, want->len)) {
ok = 0;
printf("\nfail");
printf("\n\tperso = `%s'", perso->buf);