X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fmodes%2Fofb128.c;h=01c01702c4f963175ef7db7a4096df29787067c9;hp=09b34300346975b364f4d2339335c527680947c1;hb=53d6bf40c1df1c6f274c391a034a21e01bf5dce8;hpb=63fc7f848d4e047c3bd0f4a1c7e843191b2e9f0a diff --git a/crypto/modes/ofb128.c b/crypto/modes/ofb128.c index 09b3430034..01c01702c4 100644 --- a/crypto/modes/ofb128.c +++ b/crypto/modes/ofb128.c @@ -48,7 +48,8 @@ * */ -#include "modes.h" +#include +#include "modes_lcl.h" #include #ifndef MODES_DEBUG @@ -58,14 +59,6 @@ #endif #include -#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; @@ -95,14 +88,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--) {