Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

evacrypt.cpp File Reference

#include "evacrypt.h"
#include <string.h>
#include <arpa/inet.h>

Include dependency graph for evacrypt.cpp:

Go to the source code of this file.

Defines

#define encrypt_every_8_byte()
#define decrypt_every_8_byte()


Define Documentation

 
#define decrypt_every_8_byte  ) 
 

Value:

{\
        bool bNeedRet = false;\
        for (pos_in_byte = 0; pos_in_byte < 8; pos_in_byte ++ ) {\
        if (context_start + pos_in_byte >= instrlen) \
        {\
        bNeedRet = true;\
        break;\
        }\
        decrypted[pos_in_byte] ^= crypt_buff[pos_in_byte];\
        }\
        if( !bNeedRet ) { \
        teaDecipher( (unsigned int *) decrypted, \
        (unsigned int *) key, \
        (unsigned int *) decrypted);\
        \
        context_start +=  8;\
        crypt_buff    +=  8;\
        pos_in_byte   =   0;\
        }\
}

Referenced by EvaCrypt::decrypt().

 
#define encrypt_every_8_byte  ) 
 

Value:

{\
        for(pos_in_byte=0; pos_in_byte<8; pos_in_byte++) {\
        if(is_header) { plain[pos_in_byte] ^= plain_pre_8[pos_in_byte]; }\
                        else { plain[pos_in_byte] ^= crypted_pre_8[pos_in_byte]; }\
        } /* prepare plain text*/\
        teaEncipher( (unsigned int *) plain,\
        (unsigned int *) key, \
        (unsigned int *) crypted);   /* encrypt it*/\
        \
        for(pos_in_byte=0; pos_in_byte<8; pos_in_byte++) {\
        crypted[pos_in_byte] ^= plain_pre_8[pos_in_byte]; \
        } \
        memcpy(plain_pre_8, plain, 8);     /* prepare next*/\
        \
        crypted_pre_8   =   crypted;       /* store position of previous 8 byte*/\
        crypted         +=  8;             /* prepare next output*/\
        count           +=  8;             /* outstrlen increase by 8*/\
        pos_in_byte     =   0;             /* back to start*/\
        is_header       =   0;             /* and exit header*/\
        }

Referenced by EvaCrypt::encrypt().


Generated on Mon May 15 20:48:44 2006 for libeva by  doxygen 1.4.4