tailieunhanh - Luận văn tốt nghiệp: Tổng quan về cơ sở dữ liệu và cách thiết kế DBMS phần 10

#define MUL(x,y) (x = mul(low16(x),y)) static void ideaCipher(byte const inbuf[8], byte outbuf[8], word16 const *key) { register uint16 x1, x2, x3, x4, s2, s3; word16 *in, *out; int r = IDEAROUNDS; in = (word16 *) inbuf; | define MUL x y x mul low16 x y static void ideaCipher byte const inbuf 8 byte outbuf 8 word16 const key register uint16 x1 x2 x3 x4 s2 s3 word16 in out int r IDEAROUNDS in word16 inbuf x1 in x2 in x3 in x4 in ifndef HIGHFIRST x1 x1 8 x1 8 x2 x2 8 x2 8 x3 x3 8 x3 8 x4 x4 8 x4 8 endif do MUL x1 key x2 key x3 key MUL x4 key s3 x3 x3 A x1 MUL x3 key s2 x2 x2 A x4 x2 x3 MUL x2 key x3 x2 x1 A x2 x4 A x3 x2 A s3 x3 A s2 while --r MuL x1 key x3 key x2 key MUL x4 key out word16 outbuf ifdef HIGHFIRST out x1 out x3 out x2 126 out x4 else x1 low16 x1 x2 low16 x2 x3 low16 x3 x4 low16 x4 out x1 8 I x1 8 out x3 8 x3 8 out x2 8 x2 8 out x4 8 x4 8 endif endif void ideaCfbReinit struct IdeaCfbContext context byte const iv if iv memcpy context- iv iv 8 else fill0 context- iv 8 context- bufleft 0 void ideaCfbInit struct IdeaCfbContext context byte const key 16 ideaExpandKey key context- key ideaCfbReinit context 0 void ideaCfbDestroy struct IdeaCfbContext context burn context void ideaCfbSync struct IdeaCfbContext context int bufleft context- bufleft if bufleft memmove context- iv bufleft context- iv 8 - bufleft memcpy context- iv context- oldcipher 8 - bufleft bufleft context- bufleft 0 void ideaCfbEncrypt struct IdeaCfbContext context byte const src byte dest int count 127 int bufleft context- bufleft byte bufptr context- iv 8 - bufleft if count bufleft context- bufleft bufleft - count while count-- dest bufptr A src return count - bufleft while bufleft-- dest bufptr A src while count 8 bufptr context- iv memcpy context- oldcipher bufptr 8 ideaCipher bufptr bufptr context- key bufleft 8 count - 8 do dest bufptr A src while --bufleft bufptr context- iv memcpy context- oldcipher bufptr 8 ideaCipher bufptr bufptr context- key context- bufleft 8 - count do dest bufptr A src while --count void ideaCfbDecrypt struct IdeaCfbContext context byte const src byte dest int count int bufleft context- bufleft static byte bufptr byte t bufptr context- iv 8 - bufleft if count bufleft context- .

TÀI LIỆU LIÊN QUAN
TỪ KHÓA LIÊN QUAN