gcm128.c: fix typo in CRYPTO_gcm128_encrypt_ctr32 name.
[openssl.git] / crypto / modes / ofb128.c
index ae264c832c5fefba52f611d2fe265917a383dc24..4b5b4ec64856bb5a01325d5dcbda9c029833132f 100644 (file)
@@ -48,7 +48,7 @@
  *
  */
 
-#include <stddef.h>
+#include "modes_lcl.h"
 #include <string.h>
 
 #ifndef MODES_DEBUG
 #endif
 #include <assert.h>
 
-#include "modes.h"
-
-#define STRICT_ALIGNMENT
-#if defined(__i386) || defined(__i386__) || \
-    defined(__x86_64) || defined(__x86_64__) || \
-    defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \
-    defined(__s390__) || defined(__s390x__)
-#  undef STRICT_ALIGNMENT
-#endif
-
 /* The input and output encrypted as though 128bit ofb mode is being
  * used.  The extra state information to record how much of the
  * 128bit block we have used is contained in *num;
@@ -75,7 +65,7 @@
 void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
                        size_t len, const void *key,
                        unsigned char ivec[16], int *num,
-                       block_f block)
+                       block128_f block)
 {
        unsigned int n;
        size_t l=0;
@@ -97,14 +87,14 @@ void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
 #endif
                while (len>=16) {
                        (*block)(ivec, ivec, key);
-                       for (n=0; n<16; n+=sizeof(size_t))
+                       for (; n<16; n+=sizeof(size_t))
                                *(size_t*)(out+n) =
                                *(size_t*)(in+n) ^ *(size_t*)(ivec+n);
                        len -= 16;
                        out += 16;
                        in  += 16;
+                       n = 0;
                }
-               n = 0;
                if (len) {
                        (*block)(ivec, ivec, key);
                        while (len--) {