diff options
author | Werner Koch <[email protected]> | 1998-04-08 19:49:02 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1998-04-08 19:49:02 +0000 |
commit | 8b10a87908f4d382735a046e7d043ebc250d8d67 (patch) | |
tree | 9c4255d5cd84df663f9a7001b7b6277e53cf6e6e /cipher/cipher.c | |
parent | New tests (diff) | |
download | gnupg-8b10a87908f4d382735a046e7d043ebc250d8d67.tar.gz gnupg-8b10a87908f4d382735a046e7d043ebc250d8d67.zip |
test release
Diffstat (limited to 'cipher/cipher.c')
-rw-r--r-- | cipher/cipher.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cipher/cipher.c b/cipher/cipher.c index 6e2bcce08..1f24c6b0e 100644 --- a/cipher/cipher.c +++ b/cipher/cipher.c @@ -225,8 +225,7 @@ do_cfb_encrypt( CIPHER_HANDLE c, byte *outbuf, byte *inbuf, unsigned nbytes ) if( nbytes <= c->unused ) { /* short enough to be encoded by the remaining XOR mask */ /* XOR the input with the IV and store input into IV */ - c->unused -= nbytes; - for(ivp=c->iv+STD_BLOCKSIZE - c->unused; nbytes; nbytes-- ) + for(ivp=c->iv+STD_BLOCKSIZE - c->unused; nbytes; nbytes--, c->unused-- ) *outbuf++ = (*ivp++ ^= *inbuf++); return; } @@ -271,8 +270,7 @@ do_cfb_decrypt( CIPHER_HANDLE c, byte *outbuf, byte *inbuf, unsigned nbytes ) if( nbytes <= c->unused ) { /* short enough to be encoded by the remaining XOR mask */ /* XOR the input with the IV and store input into IV */ - c->unused -= nbytes; - for(ivp=c->iv+STD_BLOCKSIZE - c->unused; nbytes; nbytes-- ) { + for(ivp=c->iv+STD_BLOCKSIZE - c->unused; nbytes; nbytes--,c->unused--){ temp = *inbuf++; *outbuf++ = *ivp ^ temp; *ivp++ = temp; |