From e165d0009cc3da196aa5eb29d443bfdd183ae580 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 2 Oct 2015 15:16:44 +0930 Subject: [PATCH] test_onion: Switch from AES256 to AES128. AFAICT, if SHA256 is good enough, and secp256k1 is good enough, AES128 is good enough. Signed-off-by: Rusty Russell --- test/test_onion.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_onion.c b/test/test_onion.c index 31edec4a3..76741adf4 100644 --- a/test/test_onion.c +++ b/test/test_onion.c @@ -270,7 +270,7 @@ static bool aes_encrypt(void *dst, const void *src, size_t len, int outlen; /* Counter mode allows parallelism in future. */ - if (EVP_EncryptInit(&evpctx, EVP_aes_256_ctr(), + if (EVP_EncryptInit(&evpctx, EVP_aes_128_ctr(), memcheck(enckey->k.u.u8, sizeof(enckey->k)), memcheck(iv->iv, sizeof(iv->iv))) != 1) return false; @@ -305,7 +305,7 @@ static bool aes_decrypt(void *dst, const void *src, size_t len, int outlen; /* Counter mode allows parallelism in future. */ - if (EVP_DecryptInit(&evpctx, EVP_aes_256_ctr(), + if (EVP_DecryptInit(&evpctx, EVP_aes_128_ctr(), memcheck(enckey->k.u.u8, sizeof(enckey->k)), memcheck(iv->iv, sizeof(iv->iv))) != 1) return false; @@ -627,7 +627,7 @@ int main(int argc, char *argv[]) char *msgs[MAX_HOPS]; struct onion onion; - assert(EVP_CIPHER_iv_length(EVP_aes_256_ctr()) == sizeof(struct iv)); + assert(EVP_CIPHER_iv_length(EVP_aes_128_ctr()) == sizeof(struct iv)); if (argc != 2) errx(1, "Usage: %s ", argv[0]);