fixed AES-128 test
authorMartin Willi <martin@strongswan.org>
Tue, 22 Apr 2008 09:00:27 +0000 (09:00 -0000)
committerMartin Willi <martin@strongswan.org>
Tue, 22 Apr 2008 09:00:27 +0000 (09:00 -0000)
src/charon/plugins/unit_tester/tests/test_aes.c

index b4ab03f..22e8e25 100644 (file)
@@ -38,12 +38,12 @@ static bool do_aes_test(u_char *key, int keysize, u_char *iv,
        crypter->set_key(crypter, chunk_create(key, keysize));
        crypter->encrypt(crypter,
                                         chunk_create(plain, len), chunk_create(iv, 16), &enc);
-       if (!memeq(enc.ptr, cipher, 16))
+       if (!memeq(enc.ptr, cipher, len))
        {
                good = FALSE;
        }
        crypter->decrypt(crypter, enc, chunk_create(iv, 16), &dec);
-       if (!memeq(dec.ptr, plain, 16))
+       if (!memeq(dec.ptr, plain, len))
        {
                good = FALSE;
        }