Core/burn/drv/capcom/cps2_crpt.cpp
// seed is the 16-bit seed generated by the first FN
// subkey will contain the 64-bit key to be XORed with the master key
// for the 2nd FN (2x32 bits)
seed is the 16-bit seed generated by the first FN
subkey will contain the 64-bit key to be XORed with the master key
for the 2nd FN (2x32 bits)
seed is the 16 - bit seed generated by the first FN subkey will contain the 64 - bit key to be XORed with the master key for the 2nd FN ( 2x32 bits )
static void expand_subkey(UINT32* subkey, UINT16 seed)
{
	static const INT32 bits[64] =
	{
		 5, 10, 14,  9,  4,  0, 15,  6,  1,  8,  3,  2, 12,  7, 13, 11,
		 5, 12,  7,  2, 13, 11,  9, 14,  4,  1,  6, 10,  8,  0, 15,  3,
		 4, 10,  2,  0,  6,  9, 12,  1, 11,  7, 15,  8, 13,  5, 14,  3,
		14, 11, 12,  7,  4,  5,  2, 10,  1, 15,  0,  9,  8,  6, 13,  3,
	};
	INT32 i;
	subkey[0] = 0;
	subkey[1] = 0;
	for (i = 0; i < 64; ++i)
		subkey[i / 32] |= BIT(seed, bits[i]) << (i % 32);
}
static void expand_subkey ( UINT32 * subkey , UINT16 seed ) { static const INT32 bits [ 64 ] = { 5 , 10 , 14 , 9 , 4 , 0 , 15 , 6 , 1 , 8 , 3 , 2 , 12 , 7 , 13 , 11 , 5 , 12 , 7 , 2 , 13 , 11 , 9 , 14 , 4 , 1 , 6 , 10 , 8 , 0 , 15 , 3 , 4 , 10 , 2 , 0 , 6 , 9 , 12 , 1 , 11 , 7 , 15 , 8 , 13 , 5 , 14 , 3 , 14 , 11 , 12 , 7 , 4 , 5 , 2 , 10 , 1 , 15 , 0 , 9 , 8 , 6 , 13 , 3 , } ; INT32 i ; subkey [ 0 ] = 0 ; subkey [ 1 ] = 0 ; for ( i = 0 ; i < 64 ; ++ i ) subkey [ i / 32 ] |= BIT ( seed , bits [ i ] ) << ( i % 32 ) ; }
seed is the 16-bit seed generated by the first FN
subkey will contain the 64-bit key to be XORed with the master key
for the 2nd FN (2x32 bits)
seed is the 16 - bit seed generated by the first FN subkey will contain the 64 - bit key to be XORed with the master key for the 2nd FN ( 2x32 bits )
// Note that each row of the table is a permutation of the seed bits.