Core/burn/drv/capcom/cps2_crpt.cpp
// srckey is the 64-bit master key (2x32 bits) XORed with the subkey
// dstkey will contain the 96-bit key for the 2nd FN (4x24 bits)
srckey is the 64-bit master key (2x32 bits) XORed with the subkey
dstkey will contain the 96-bit key for the 2nd FN (4x24 bits)
srckey is the 64 - bit master key ( 2x32 bits ) XORed with the subkey dstkey will contain the 96 - bit key for the 2nd FN ( 4x24 bits )
static void expand_2nd_key(UINT32 *dstkey, const UINT32 *srckey)
{
	static const INT32 bits[96] =
	{
		34,  9, 32, 24, 44, 54,
		38, 61, 47, 13, 28,  7,
		29, 58, 18,  1, 20, 60,
		15,  6, 11, 43, 39, 19,
		63, 23, 16, 62, 54, 40,
		31,  3, 56, 61, 17, 25,
		47, 38, 55, 57,  5,  4,
		15, 42, 22,  7,  2, 19,
		46, 37, 29, 39, 12, 30,
		49, 57, 31, 41, 26, 27,
		24, 36, 11, 63, 33, 16,
		56, 62, 48, 60, 59, 32,
		12, 30, 53, 48, 10,  0,
		50, 35,  3, 59, 14, 49,
		51, 45, 44,  2, 21, 33,
		55, 52, 23, 28,  8, 26,
	};
	INT32 i;
	dstkey[0] = 0;
	dstkey[1] = 0;
	dstkey[2] = 0;
	dstkey[3] = 0;
	for (i = 0; i < 96; ++i)
		dstkey[i / 24] |= BIT(srckey[bits[i] / 32], bits[i] % 32) << (i % 24);
}
static void expand_2nd_key ( UINT32 * dstkey , const UINT32 * srckey ) { static const INT32 bits [ 96 ] = { 34 , 9 , 32 , 24 , 44 , 54 , 38 , 61 , 47 , 13 , 28 , 7 , 29 , 58 , 18 , 1 , 20 , 60 , 15 , 6 , 11 , 43 , 39 , 19 , 63 , 23 , 16 , 62 , 54 , 40 , 31 , 3 , 56 , 61 , 17 , 25 , 47 , 38 , 55 , 57 , 5 , 4 , 15 , 42 , 22 , 7 , 2 , 19 , 46 , 37 , 29 , 39 , 12 , 30 , 49 , 57 , 31 , 41 , 26 , 27 , 24 , 36 , 11 , 63 , 33 , 16 , 56 , 62 , 48 , 60 , 59 , 32 , 12 , 30 , 53 , 48 , 10 , 0 , 50 , 35 , 3 , 59 , 14 , 49 , 51 , 45 , 44 , 2 , 21 , 33 , 55 , 52 , 23 , 28 , 8 , 26 , } ; INT32 i ; dstkey [ 0 ] = 0 ; dstkey [ 1 ] = 0 ; dstkey [ 2 ] = 0 ; dstkey [ 3 ] = 0 ; for ( i = 0 ; i < 96 ; ++ i ) dstkey [ i / 24 ] |= BIT ( srckey [ bits [ i ] / 32 ] , bits [ i ] % 32 ) << ( i % 24 ) ; }
srckey is the 64-bit master key (2x32 bits) XORed with the subkey
dstkey will contain the 96-bit key for the 2nd FN (4x24 bits)
srckey is the 64 - bit master key ( 2x32 bits ) XORed with the subkey dstkey will contain the 96 - bit key for the 2nd FN ( 4x24 bits )