The block size may be something other than 8!
authorRichard Levitte <levitte@openssl.org>
Wed, 2 Jan 2002 16:51:17 +0000 (16:51 +0000)
committerRichard Levitte <levitte@openssl.org>
Wed, 2 Jan 2002 16:51:17 +0000 (16:51 +0000)
crypto/evp/evp_locl.h

index 62fbeba699d5532f9c7eda15783e787d8daf3535..fbf0a3ab8cb2cda1f44f458d453a0fdcf414a986 100644 (file)
 /* Wrapper functions for each cipher mode */
 
 #define BLOCK_CIPHER_ecb_loop() \
-       unsigned int i; \
-       if(inl < 8) return 1;\
-       inl -= 8; \
-       for(i=0; i <= inl; i+=8) \
+       unsigned int i, bl; \
+       bl = ctx->cipher->block_size;\
+       if(inl < bl) return 1;\
+       inl -= bl; \
+       for(i=0; i <= inl; i+=bl) \
 
 #define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \
 static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \