[svn] / ecrypt / trunk / submissions / f-fcsr / f-fcsr-8 / f-fcsr-8.c  

svn: ecrypt/trunk/submissions/f-fcsr/f-fcsr-8/f-fcsr-8.c

Diff for /ecrypt/trunk/submissions/f-fcsr/f-fcsr-8/f-fcsr-8.c between version 7 and 8

version 7, Sun Jun 26 20:17:14 2005 UTC version 8, Sun Jun 26 20:33:43 2005 UTC
Line 12 
Line 12 
      * Technical remarks and questions can be addressed to       * Technical remarks and questions can be addressed to
      * <cedric.lauradoux@inria.fr>       * <cedric.lauradoux@inria.fr>
      */       */
   
   #ifndef ECRYPT_API
 #define FFCSR8_EVALUATE  #define FFCSR8_EVALUATE
   #endif
   
 #include "ffcsr8-sync.h"  #include "ffcsr8-sync.h"
 #ifdef FFCSR8_EVALUATE  #ifdef FFCSR8_EVALUATE
 #include <time.h>  #include <time.h>
 #endif  #endif
   
   void ECRYPT_init(void)
   { }
   
 void ECRYPT_keysetup(  void ECRYPT_keysetup(
   ECRYPT_ctx* ctx,    ECRYPT_ctx* ctx,
Line 41 
Line 45 
         ctx->state[0] = key[15] | key[14]<<8 | key[13]<<16 | key[12]<<24;          ctx->state[0] = key[15] | key[14]<<8 | key[13]<<16 | key[12]<<24;
   
   
         while( goodfilter(ctx) != 1 )          for(i=0; (i < 1024) && (goodfilter(ctx) != 1); i++)
         {          {
                 ctx->carry[0] = 0;                  ctx->carry[0] = 0;
                 ctx->carry[1] = 0;                  ctx->carry[1] = 0;
Line 72 
Line 76 
                 ECRYPT_clock(ctx);                  ECRYPT_clock(ctx);
         }          }
   
         init[0]=ctx->state[0];          ctx->init[0]=ctx->state[0];
         init[1]=ctx->state[1];          ctx->init[1]=ctx->state[1];
         init[2]=ctx->state[2];          ctx->init[2]=ctx->state[2];
         init[3]=ctx->state[3];          ctx->init[3]=ctx->state[3];
 }  }
   
 void ECRYPT_ivsetup(  void ECRYPT_ivsetup(
   ECRYPT_ctx* ctx,    ECRYPT_ctx* ctx,
   const u8* iv)    const u8* iv)
 {  {
         u32 i=0,tmp;          u32 i=0;
         ctx->carry[0] = 0;          ctx->carry[0] = 0;
         ctx->carry[1] = 0;          ctx->carry[1] = 0;
         ctx->carry[2] = 0;          ctx->carry[2] = 0;
Line 90 
Line 94 
   
         insertIV(ctx,&iv[0]);          insertIV(ctx,&iv[0]);
   
         ctx->state[0]=init[0];          ctx->state[0]=ctx->init[0];
         ctx->state[1]=init[1];          ctx->state[1]=ctx->init[1];
         ctx->state[2]=init[2];          ctx->state[2]=ctx->init[2];
         ctx->state[3]=init[3];          ctx->state[3]=ctx->init[3];
   
         for( i=0; i<64 ; i++)          for( i=0; i<64 ; i++)
                 {                  {
Line 110 
Line 114 
                 {                  {
                         ECRYPT_clock(ctx);                          ECRYPT_clock(ctx);
                 }                  }
         ctx->state[0]=init[0];          ctx->state[0]=ctx->init[0];
         ctx->state[1]=init[1];          ctx->state[1]=ctx->init[1];
         ctx->state[2]=init[2];          ctx->state[2]=ctx->init[2];
         ctx->state[3]=init[3];          ctx->state[3]=ctx->init[3];
 }  }
   
 void ECRYPT_process_bytes(  void ECRYPT_process_bytes(
Line 226 
Line 230 
 ECRYPT_ctx *ctx  ECRYPT_ctx *ctx
 )  )
 {  {
   u32 i,j;    u32 i;
   u32 weight;    u32 weight;
   u32 tmp, mask;    u32 tmp, mask;
   
Line 329 
Line 333 
 #define NUM_MB 100  #define NUM_MB 100
 int main()  int main()
 {  {
         u32 nbByte,i,j;          u32 i,j;
         clock_t orig, end;          clock_t orig, end;
         double time;          double time;
         ECRYPT_ctx ctx;          ECRYPT_ctx ctx;


Generate output suitable for use with a patch program
Legend:
Removed from v.7  
changed lines
  Added in v.8

eSTREAM Project

Powered by ViewCVS 1.0-dev
(Powered by Apache)

ViewCVS and CVS Help