aboutsummaryrefslogtreecommitdiffstats
path: root/cipher
diff options
context:
space:
mode:
Diffstat (limited to 'cipher')
-rw-r--r--cipher/ChangeLog9
-rw-r--r--cipher/cipher.c16
-rw-r--r--cipher/rndw32.c4
3 files changed, 19 insertions, 10 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index bb617a9fd..8a289051e 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,3 +1,12 @@
+2001-01-18 Werner Koch <[email protected]>
+
+ * rndw32.c: Fixed typo and wrong ifdef for VER_PLATFORM* macro
+
+2001-01-12 Werner Koch <[email protected]>
+
+ * cipher.c (cipher_encrypt,cipher_encrypt): Use blocksize and
+ not 8 for CBC mode (However: we don't use CBS in OpenPGP).
+
2000-11-22 Werner Koch <[email protected]>
* rndegd.c (gather_random): Fixed default socket to be '=entropy'.
diff --git a/cipher/cipher.c b/cipher/cipher.c
index 870e854cc..bbaddd116 100644
--- a/cipher/cipher.c
+++ b/cipher/cipher.c
@@ -619,12 +619,12 @@ cipher_encrypt( CIPHER_HANDLE c, byte *outbuf, byte *inbuf, unsigned nbytes )
{
switch( c->mode ) {
case CIPHER_MODE_ECB:
- assert(!(nbytes%8));
- do_ecb_encrypt(c, outbuf, inbuf, nbytes/8 );
+ assert(!(nbytes%c->blocksize));
+ do_ecb_encrypt(c, outbuf, inbuf, nbytes/c->blocksize );
break;
case CIPHER_MODE_CBC:
- assert(!(nbytes%8)); /* fixme: should be blocksize */
- do_cbc_encrypt(c, outbuf, inbuf, nbytes/8 );
+ assert(!(nbytes%c->blocksize));
+ do_cbc_encrypt(c, outbuf, inbuf, nbytes/c->blocksize );
break;
case CIPHER_MODE_CFB:
case CIPHER_MODE_PHILS_CFB:
@@ -649,12 +649,12 @@ cipher_decrypt( CIPHER_HANDLE c, byte *outbuf, byte *inbuf, unsigned nbytes )
{
switch( c->mode ) {
case CIPHER_MODE_ECB:
- assert(!(nbytes%8));
- do_ecb_decrypt(c, outbuf, inbuf, nbytes/8 );
+ assert(!(nbytes%c->blocksize));
+ do_ecb_decrypt(c, outbuf, inbuf, nbytes/c->blocksize );
break;
case CIPHER_MODE_CBC:
- assert(!(nbytes%8)); /* fixme: should assert on blocksize */
- do_cbc_decrypt(c, outbuf, inbuf, nbytes/8 );
+ assert(!(nbytes%c->blocksize));
+ do_cbc_decrypt(c, outbuf, inbuf, nbytes/c->blocksize );
break;
case CIPHER_MODE_CFB:
case CIPHER_MODE_PHILS_CFB:
diff --git a/cipher/rndw32.c b/cipher/rndw32.c
index 059cd6bc2..e951fdf6e 100644
--- a/cipher/rndw32.c
+++ b/cipher/rndw32.c
@@ -311,8 +311,8 @@ gather_random_fast( void (*add)(const void*, size_t, int), int requester )
#ifndef IOCTL_DISK_PERFORMANCE
#define IOCTL_DISK_PERFORMANCE 0x00070020
#endif
-#ifndef IOCTL_DISK_PERFORMANCE
-#define VER_PLATFORM_WIN32_WINDOWSw 1
+#ifndef VER_PLATFORM_WIN32_WINDOWS
+#define VER_PLATFORM_WIN32_WINDOWS 1
#endif
typedef struct {