MCPcopy Create free account
hub / github.com/Segs/Segs / XorCodeBuf

Method XorCodeBuf

Projects/CoX/Common/AuthProtocol/AuthPacketCodec.cpp:357–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355 SetXorKey(-1);
356}
357void AuthPacketCodec::XorCodeBuf(unsigned char *buffer,size_t length)
358{
359 if(!xor_enc_key)
360 return;
361 const unsigned char *Key = (unsigned char *)&xor_enc_key;
362 *buffer ^= *Key;
363 for(size_t i=1; i<length; i++)
364 buffer[i] ^= buffer[i-1] ^ Key[i&7];
365 xor_enc_key += length;
366}
367
368void AuthPacketCodec::XorDecodeBuf(unsigned char *buffer,size_t length)
369{

Callers 1

encode_bufferFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected