diff options
author | Werner Koch <wk@gnupg.org> | 2005-08-11 18:57:29 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2005-08-11 18:57:29 +0200 |
commit | 0a3eda24ee244534ab3081257e9777f1d67de058 (patch) | |
tree | 414b7e229c41c35177d2e3dc642671dab0a37a18 /cipher/cipher.c | |
parent | * configure.ac: Remove hardcoded -I and -L for /usr/local on FreeBSD. (diff) | |
download | gnupg2-0a3eda24ee244534ab3081257e9777f1d67de058.tar.xz gnupg2-0a3eda24ee244534ab3081257e9777f1d67de058.zip |
Experimental code to improve AES performance. Got about 25% on ia32.
Diffstat (limited to 'cipher/cipher.c')
-rw-r--r-- | cipher/cipher.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/cipher/cipher.c b/cipher/cipher.c index 591ce208e..311919fe1 100644 --- a/cipher/cipher.c +++ b/cipher/cipher.c @@ -536,7 +536,25 @@ do_cfb_encrypt( CIPHER_HANDLE c, byte *outbuf, byte *inbuf, unsigned nbytes ) *outbuf++ = (*ivp++ ^= *inbuf++); } - /* now we can process complete blocks */ + /* Now we can process complete blocks. */ +#if 0 + /* Experimental code. We may only use this for standard CFB + because for Phil's mode we need to save the IV of before the + last encryption - we don't want to do this in tghe fasf CFB + encryption routine. */ + if (c->algo == CIPHER_ALGO_AES + && nbytes >= blocksize + && c->mode != CIPHER_MODE_PHILS_CFB) { + size_t n; + + memcpy( c->lastiv, c->iv, blocksize ); + n = (nbytes / blocksize) * blocksize; + rijndael_cfb_encrypt (&c->context.c, c->iv, outbuf, inbuf, n); + inbuf += n; + outbuf += n; + nbytes -= n; + } +#endif while( nbytes >= blocksize ) { int i; /* encrypt the IV (and save the current one) */ |