comparison libpurple/protocols/qq/qq_crypt.c @ 26943:ccc217362818

counterpart for ad057b75 in the outgoing side
author Ka-Hing Cheung <khc@hxbc.us>
date Mon, 11 May 2009 00:17:40 +0000
parents bf7b3cd5ed25
children 867b4cdc01bf
comparison
equal deleted inserted replaced
26942:f924c19ad9c2 26943:ccc217362818
161 /* set prev */ 161 /* set prev */
162 p32_prev[0] = plain32[0]; p32_prev[1] = plain32[1]; 162 p32_prev[0] = plain32[0]; p32_prev[1] = plain32[1];
163 c32_prev[0] = crypted32[0]; c32_prev[1] = crypted32[1]; 163 c32_prev[0] = crypted32[0]; c32_prev[1] = crypted32[1];
164 164
165 /* set next 64 bits want to crypt*/ 165 /* set next 64 bits want to crypt*/
166 crypted_ptr += 8; 166 if (count64 > 0) {
167 memcpy(crypted32, crypted_ptr, sizeof(crypted32)); 167 crypted_ptr += 8;
168 plain32[0] = crypted32[0] ^ c32_prev[0]; plain32[1] = crypted32[1] ^ c32_prev[1]; 168 memcpy(crypted32, crypted_ptr, sizeof(crypted32));
169 plain32[0] = crypted32[0] ^ c32_prev[0]; plain32[1] = crypted32[1] ^ c32_prev[1];
170 }
169 } 171 }
170 } 172 }
171 173
172 /* length of crypted buffer must be plain_len + 16*/ 174 /* length of crypted buffer must be plain_len + 16*/
173 gint qq_encrypt(guint8* crypted, const guint8* const plain, const gint plain_len, const guint8* const key) 175 gint qq_encrypt(guint8* crypted, const guint8* const plain, const gint plain_len, const guint8* const key)