AES IGE mode speedup.

This commit is contained in:
Ben Laurie
2007-05-13 12:57:59 +00:00
parent 76b46e7707
commit 5f09d0ecc2
4 changed files with 135 additions and 34 deletions

View File

@@ -218,6 +218,23 @@ static int run_test_vectors(void)
hexdump(stdout, "expected", v->out, v->length);
hexdump(stdout, "got", buf, v->length);
++errs;
}
// try with in == out
memcpy(iv, v->iv, sizeof iv);
memcpy(buf, v->in, v->length);
AES_ige_encrypt(buf, buf, v->length, &key, iv, v->encrypt);
if(memcmp(v->out, buf, v->length))
{
printf("IGE test vector %d failed (with in == out)\n", n);
hexdump(stdout, "key", v->key, sizeof v->key);
hexdump(stdout, "iv", v->iv, sizeof v->iv);
hexdump(stdout, "in", v->in, v->length);
hexdump(stdout, "expected", v->out, v->length);
hexdump(stdout, "got", buf, v->length);
++errs;
}
}