crypto/aes/asm/aesni-x86[_64].pl update, up to 14% improvement on
[openssl.git] / crypto / seed / seed_ofb.c
index e2f3f57a38cd75ad4f5e9623820193cace6b79ae..3c8ba33bb9f90caf7aa5c7ae38e2279d8ef8175d 100644 (file)
  * [including the GNU Public Licence.]
  */
 
-#include "seed_locl.h"
-#include <string.h>
+#include <openssl/seed.h>
+#include <openssl/modes.h>
 
 void SEED_ofb128_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 n;
-
-       n = *num;
-       
-       while (len--)
-               {
-               if (n == 0)
-                       SEED_encrypt(ivec, ivec, ks);
-               *(out++) = *(in++) ^ ivec[n];
-               n = (n+1) % SEED_BLOCK_SIZE;
-               }
-
-       *num = n;
+       CRYPTO_ofb128_encrypt(in,out,len,ks,ivec,num,(block128_f)SEED_encrypt);
        }