tiencr.c
/*
 * \brief XOR's the data key back to its original form
 *
 * \param key Key data to be XORed
 * \param len Key length 
 * \param encrypt Encrypt or decrypt direction of the key
 */
\brief XOR's the data key back to its original form
\param key Key data to be XORed
\param len Key length
\param encrypt Encrypt or decrypt direction of the key
\ brief XOR ' s the data key back to its original form \ param key Key data to be XORed \ param len Key length \ param encrypt Encrypt or decrypt direction of the key
void xor_key(uint8_t* key, size_t len, bool encrypt)
{
	size_t i = 0;
	if( encrypt )
	{
		for( i = 1; i < len; ++i )
			key[i] ^= key[i-1];
	}
	else
	{
		for( i = len-1; i > 0; --i )
			key[i] ^= key[i-1];
	}
}
void xor_key ( uint8_t * key , size_t len , bool encrypt ) { size_t i = 0 ; if ( encrypt ) { for ( i = 1 ; i < len ; ++ i ) key [ i ] ^= key [ i - 1 ] ; } else { for ( i = len - 1 ; i > 0 ; -- i ) key [ i ] ^= key [ i - 1 ] ; } }
\brief XOR's the data key back to its original form
 \param key Key data to be XORed
 \param len Key length
 \param encrypt Encrypt or decrypt direction of the key
\ brief XOR ' s the data key back to its original form \ param key Key data to be XORed \ param len Key length \ param encrypt Encrypt or decrypt direction of the key