Mercurial > pidgin
comparison libpurple/protocols/qq/qq_crypt.c @ 25607:b34d5e9b3d9b
*** Plucked rev 2c9a1153 (khc@pidgin.im):
counterpart for ad057b75 in the outgoing side
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Mon, 11 May 2009 00:20:17 +0000 |
parents | c18f78b2db6b |
children | 867b4cdc01bf |
comparison
equal
deleted
inserted
replaced
25606:2260e5b0ca91 | 25607:b34d5e9b3d9b |
---|---|
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) |