X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fseed%2Fseed_cfb.c;h=694597dd06e17cde0857dc9042f638e7e33fc399;hp=07d878a788891190f309991b7a9b1e15b58fadf5;hb=5d48a66a6a4bc27b54d32721f7183077489c2e5f;hpb=63fc7f848d4e047c3bd0f4a1c7e843191b2e9f0a;ds=sidebyside diff --git a/crypto/seed/seed_cfb.c b/crypto/seed/seed_cfb.c index 07d878a788..694597dd06 100644 --- a/crypto/seed/seed_cfb.c +++ b/crypto/seed/seed_cfb.c @@ -105,40 +105,12 @@ * [including the GNU Public Licence.] */ -#include "seed_locl.h" -#include +#include +#include void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out, size_t len, const SEED_KEY_SCHEDULE *ks, unsigned char ivec[SEED_BLOCK_SIZE], int *num, int enc) { - int n; - unsigned char c; - - n = *num; - - if (enc) - { - while (len--) - { - if (n == 0) - SEED_encrypt(ivec, ivec, ks); - ivec[n] = *(out++) = *(in++) ^ ivec[n]; - n = (n+1) % SEED_BLOCK_SIZE; - } - } - else - { - while (len--) - { - if (n == 0) - SEED_encrypt(ivec, ivec, ks); - c = *(in); - *(out++) = *(in++) ^ ivec[n]; - ivec[n] = c; - n = (n+1) % SEED_BLOCK_SIZE; - } - } - - *num = n; + CRYPTO_cfb128_encrypt(in,out,len,ks,ivec,num,enc,(block128_f)SEED_encrypt); }