From 9850f7f6b285ed1c0c849b1fa97522245f294586 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sun, 26 Dec 2004 13:05:40 +0000 Subject: [PATCH] Remove yet another redundant memcpy. Not at least performance critical, essentially cosmetic modification... --- crypto/aes/aes_cbc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crypto/aes/aes_cbc.c b/crypto/aes/aes_cbc.c index e43135e8a0..41d538f2b5 100644 --- a/crypto/aes/aes_cbc.c +++ b/crypto/aes/aes_cbc.c @@ -82,11 +82,10 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, } if (len) { for(n=0; n < len; ++n) - tmp[n] = in[n] ^ iv[n]; + out[n] = in[n] ^ iv[n]; for(n=len; n < AES_BLOCK_SIZE; ++n) - tmp[n] = iv[n]; - AES_encrypt(tmp, tmp, key); - memcpy(out, tmp, AES_BLOCK_SIZE); + out[n] = iv[n]; + AES_encrypt(out, out, key); iv = out; } memcpy(ivec,iv,AES_BLOCK_SIZE); -- GitLab