X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fcamellia%2Fcmll_ofb.c;h=a482befc74707df29eea9f43444bdde4a2c291ac;hp=1646fc0ce78a4262122aefc2fa5fb5a85e34d97d;hb=5d48a66a6a4bc27b54d32721f7183077489c2e5f;hpb=63fc7f848d4e047c3bd0f4a1c7e843191b2e9f0a;ds=sidebyside diff --git a/crypto/camellia/cmll_ofb.c b/crypto/camellia/cmll_ofb.c index 1646fc0ce7..a482befc74 100644 --- a/crypto/camellia/cmll_ofb.c +++ b/crypto/camellia/cmll_ofb.c @@ -105,14 +105,8 @@ * [including the GNU Public Licence.] */ -#ifndef CAMELLIA_DEBUG -# ifndef NDEBUG -# define NDEBUG -# endif -#endif -#include #include -#include "cmll_locl.h" +#include /* The input and output encrypted as though 128bit ofb mode is being * used. The extra state information to record how much of the @@ -121,20 +115,5 @@ void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out, size_t length, const CAMELLIA_KEY *key, unsigned char *ivec, int *num) { - - unsigned int n; - - assert(in && out && key && ivec && num); - - n = *num; - - while (length--) { - if (n == 0) { - Camellia_encrypt(ivec, ivec, key); - } - *(out++) = *(in++) ^ ivec[n]; - n = (n+1) % CAMELLIA_BLOCK_SIZE; - } - - *num=n; + CRYPTO_ofb128_encrypt(in,out,length,key,ivec,num,(block128_f)Camellia_encrypt); }