X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/6af2607b63ce649a919513949d5f8a8deb2e6663..799e63b486e5d3d473de8032261b35f80707cd54:/symm/eax-def.h diff --git a/symm/eax-def.h b/symm/eax-def.h index 6e1c7ca4..3154ac07 100644 --- a/symm/eax-def.h +++ b/symm/eax-def.h @@ -123,7 +123,7 @@ void pre##_eaxsetkey(pre##_eaxkey *key, const void *k, size_t ksz) \ * \ * * %$z_i = E_K(t_0 \xor m_0)$% is the tweak with the `full final \ * buffer' mask applied, which is the final tag for a final empty \ - * message. \ + * message. \ */ \ BLKC_BSET(PRE, t, 0); pre##_eblk(&key->ctx, t, key->v0); \ BLKC_XMOVE(PRE, t, key->m0); pre##_eblk(&key->ctx, t, key->z0); \ @@ -275,9 +275,9 @@ int pre##_eaxencrypt(pre##_eaxctx *ctx, \ /* Determine the buffering plan. Our buffer is going to do double- \ * duty here. The end portion is going to contain mask from the \ * encrypted counter which we mix into the plaintext to encrypt it; \ - * the start portion, which originally mask bytes we've already used, \ - * will hold the output ciphertext, which will eventually be \ - * collected into the OMAC state. \ + * the start portion, which originally contained mask bytes we've \ + * already used, will hold the output ciphertext, which will \ + * eventually be collected into the OMAC state. \ */ \ rsvr_mkplan(&plan, &pre##_omacpolicy, ctx->off, sz); \ \ @@ -362,9 +362,9 @@ int pre##_eaxdecrypt(pre##_eaxctx *ctx, \ /* Determine the buffering plan. Our buffer is going to do double- \ * duty here. The end portion is going to contain mask from the \ * encrypted counter which we mix into the plaintext to encrypt it; \ - * the start portion, which originally mask bytes we've already used, \ - * will hold the input ciphertext, which will eventually be \ - * collected into the OMAC state. \ + * the start portion, which originally contained mask bytes we've \ + * already used, will hold the input ciphertext, which will \ + * eventually be collected into the OMAC state. \ */ \ rsvr_mkplan(&plan, &pre##_omacpolicy, ctx->off, sz); \ \ @@ -700,6 +700,7 @@ EAX_TESTX(PRE, pre, name, fname) #include #include +#include #include #include @@ -761,8 +762,8 @@ static int eaxverify(dstr *v) \ d.len = BLEN(&b); \ \ if (d.len != v[4].len || \ - memcmp(d.buf, v[4].buf, v[4].len) != 0 || \ - memcmp(t.buf, v[5].buf, v[5].len) != 0) { \ + MEMCMP(d.buf, !=, v[4].buf, v[4].len) || \ + MEMCMP(t.buf, !=, v[5].buf, v[5].len)) { \ fail_enc: \ printf("\nfail encrypt:\n\tstep = %i", *ip); \ fputs("\n\tkey = ", stdout); type_hex.dump(&v[0], stdout); \ @@ -803,7 +804,7 @@ static int eaxverify(dstr *v) \ d.len = BLEN(&b); \ \ if (d.len != v[3].len || !win || \ - memcmp(d.buf, v[3].buf, v[3].len) != 0) { \ + MEMCMP(d.buf, !=, v[3].buf, v[3].len)) { \ fail_dec: \ printf("\nfail decrypt:\n\tstep = %i", *ip); \ fputs("\n\tkey = ", stdout); type_hex.dump(&v[0], stdout); \