trunk/src/mame/drivers/naomi.c
| r242967 | r242968 | |
| 6014 | 6014 | ROM_LOAD( "wk1ma10.4c", 0xa000000, 0x1000000, CRC(e96f312c) SHA1(0a92640277111aef5c6e9dab4218a8ae2196ce61) ) |
| 6015 | 6015 | |
| 6016 | 6016 | ROM_REGION( 4, "rom_key", 0 ) |
| 6017 | | ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(c1e3000b) SHA1(36c2546833effe9452e2b3f7d31335fc5e349f49) ) |
| 6017 | ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(1708ebb9) SHA1(c1115e4dd675f10d5fb41f57c1eea8e6a4f09fed) ) |
| 6018 | 6018 | ROM_END |
| 6019 | 6019 | |
| 6020 | 6020 | ROM_START( wldkicksa ) |
| r242967 | r242968 | |
| 6036 | 6036 | ROM_LOAD( "wk1ma10.4c", 0xa000000, 0x1000000, CRC(e96f312c) SHA1(0a92640277111aef5c6e9dab4218a8ae2196ce61) ) |
| 6037 | 6037 | |
| 6038 | 6038 | ROM_REGION( 4, "rom_key", 0 ) |
| 6039 | | ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(c1e3000b) SHA1(36c2546833effe9452e2b3f7d31335fc5e349f49) ) |
| 6039 | ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(1708ebb9) SHA1(c1115e4dd675f10d5fb41f57c1eea8e6a4f09fed) ) |
| 6040 | 6040 | ROM_END |
| 6041 | 6041 | |
| 6042 | 6042 | ROM_START( wldkicksb ) |
| r242967 | r242968 | |
| 6058 | 6058 | ROM_LOAD( "wk1ma10.4c", 0xa000000, 0x1000000, CRC(e96f312c) SHA1(0a92640277111aef5c6e9dab4218a8ae2196ce61) ) |
| 6059 | 6059 | |
| 6060 | 6060 | ROM_REGION( 4, "rom_key", 0 ) |
| 6061 | | ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(c1e3000b) SHA1(36c2546833effe9452e2b3f7d31335fc5e349f49) ) |
| 6061 | ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(1708ebb9) SHA1(c1115e4dd675f10d5fb41f57c1eea8e6a4f09fed) ) |
| 6062 | 6062 | ROM_END |
| 6063 | 6063 | |
| 6064 | 6064 | ROM_START( toukon4 ) |
| r242967 | r242968 | |
| 6085 | 6085 | ROM_LOAD( "trf1ma15.6l", 0xf000000, 0x1000000, CRC(42d318c5) SHA1(f9fe82ffbfc51fcb52333f94c55a7092e7124fb4) ) |
| 6086 | 6086 | |
| 6087 | 6087 | ROM_REGION( 4, "rom_key", 0 ) |
| 6088 | | ROM_LOAD( "tr4ae-key.bin", 0x000000, 0x000004, CRC(986a7cee) SHA1(70c3ff80f86de6a0655251658c66a156fb644995) ) |
| 6088 | ROM_LOAD( "tr4ae-key.bin", 0x000000, 0x000004, CRC(1708ebb9) SHA1(c1115e4dd675f10d5fb41f57c1eea8e6a4f09fed) ) |
| 6089 | 6089 | ROM_END |
| 6090 | 6090 | |
| 6091 | 6091 | ROM_START( ninjaslt ) |
| r242967 | r242968 | |
| 7805 | 7805 | ROM_LOAD( "mpr-23662.ic11", 0xa800000, 0x0800000, CRC(d6ef7d68) SHA1(4ee396af6c5caf4c5af6e9ad0e03a7ac2c5039f4) ) |
| 7806 | 7806 | |
| 7807 | 7807 | ROM_REGION( 4, "rom_key", 0 ) |
| 7808 | | ROM_LOAD( "vstrik3c-key.bin", 0, 4, CRC(049f41b0) SHA1(4ea444878c8e9288ec95b1763d48bc92c634acdd) ) |
| 7808 | ROM_LOAD( "vstrik3c-key.bin", 0, 4, CRC(8c9012fe) SHA1(d81e00d6377a3f0eeed01dc523707e36ca1b434d) ) |
| 7809 | 7809 | ROM_END |
| 7810 | 7810 | |
| 7811 | 7811 | ROM_START( vstrik3cb ) |
| r242967 | r242968 | |
| 7827 | 7827 | ROM_LOAD( "mpr-23662.ic11", 0xa800000, 0x0800000, CRC(d6ef7d68) SHA1(4ee396af6c5caf4c5af6e9ad0e03a7ac2c5039f4) ) |
| 7828 | 7828 | |
| 7829 | 7829 | ROM_REGION( 4, "rom_key", 0 ) |
| 7830 | | ROM_LOAD( "vstrik3c-key.bin", 0, 4, CRC(049f41b0) SHA1(4ea444878c8e9288ec95b1763d48bc92c634acdd) ) |
| 7830 | ROM_LOAD( "vstrik3c-key.bin", 0, 4, CRC(8c9012fe) SHA1(d81e00d6377a3f0eeed01dc523707e36ca1b434d) ) |
| 7831 | 7831 | ROM_END |
| 7832 | 7832 | |
| 7833 | 7833 | ROM_START( wldrider ) |
| r242967 | r242968 | |
| 7870 | 7870 | ROM_LOAD( "mpr-23784.ic11", 0xa800000, 0x1000000, CRC(f74f2fee) SHA1(84b07baa6d116727e66ef27e24ba6484c3393891) ) |
| 7871 | 7871 | |
| 7872 | 7872 | ROM_REGION( 4, "rom_key", 0 ) |
| 7873 | | ROM_LOAD( "vf4cart-key.bin", 0, 4, CRC(22838e16) SHA1(afee674dce3cfdd20360c30da2da5ba69f8d4682) ) |
| 7873 | ROM_LOAD( "vf4cart-key.bin", 0, 4, CRC(aa8cdd58) SHA1(e282b7d215044a005b50c8553b8056f3d599135c) ) |
| 7874 | 7874 | ROM_END |
| 7875 | 7875 | |
| 7876 | 7876 | // There is also a development cart (171-7885A) with 20x 64Mb FlashROMs instead of 10x 128Mb MaskROMs. Content is the same. |
trunk/src/mame/machine/315-5881_crypt.c
| r242967 | r242968 | |
| 121 | 121 | The encryption is done by a stream cipher operating in counter mode, which use a 16-bits internal block cipher. |
| 122 | 122 | |
| 123 | 123 | There are 2 "control bits" at the start of the decrypted stream which control the mode of operation: bit #1 set to 1 means |
| 124 | | that the decrypted stream needs to be decompressed after being decrypted. More on this later. |
| 124 | that the stream needs to be decompressed after being decrypted. More on this later. |
| 125 | 125 | |
| 126 | 126 | The next 16-bits are part of the header (they don't belong to the plaintext), but his meaning is unclear. It has been |
| 127 | 127 | conjectured that it could stablish when to "reset" the process and start processing a new stream (based on some tests |
| r242967 | r242968 | |
| 134 | 134 | given plaintext word, and the remaining 2 to the next plaintext word. |
| 135 | 135 | |
| 136 | 136 | The underlying block cipher consists of two 4-round Feistel Networks (FN): the first one takes the counter (16 bits), |
| 137 | | the game-key (>=26 bits) and the sequence-key (16 bits) and output a middle result (16 bits) which will act as another key |
| 137 | the game-key (>=27 bits) and the sequence-key (16 bits) and output a middle result (16 bits) which will act as another key |
| 138 | 138 | for the second one. The second FN will take the encrypted word (16 bits), the game-key, the sequence-key and the result |
| 139 | 139 | from the first FN and will output the decrypted word (16 bits). |
| 140 | 140 | |
| 141 | | Each round of the Feistel Networks use four substitution sboxes, each having 6 inputs and 2 outputs. The input can be the |
| 142 | | XOR of at most two "sources bits", being source bits the bits from the previous round and the bits from the different keys. |
| 141 | Each round of the Feistel Networks use four substitution sboxes, each having 6 inputs and 2 outputs. The input is the |
| 142 | XOR of at most one bit from the previous round and at most one bit from the different keys. |
| 143 | 143 | |
| 144 | 144 | The underlying block cipher has the same structure than the one used by the CPS-2 (Capcom Play System 2) and, |
| 145 | 145 | indeed, some of the used sboxes are exactly the same and appear in the same FN/round in both systems (this is not evident, |
| r242967 | r242968 | |
| 151 | 151 | some (encrypted word-decrypted word) pairs suffice. However, due to the weak key scheduling, it should be noted that some |
| 152 | 152 | related keys can produce the same output bytes for some (short) input sequences. |
| 153 | 153 | |
| 154 | | The only difference in the decryption process between M2 and M3 is the initialization of the counter. In M3, the counter is |
| 155 | | always set to 0 at the beginning of the decryption while, in M2, the bits #1-#16 of the ciphertext's address are used |
| 156 | | to initialize the counter. |
| 157 | | |
| 158 | 154 | Note that this implementation considers that the counter initialization for ram decryption is 0 simply because the ram is |
| 159 | 155 | mapped to multiples of 128K. |
| 160 | 156 | |
| r242967 | r242968 | |
| 164 | 160 | chosen so as to make the key for CAPSNK equal to 0. |
| 165 | 161 | |
| 166 | 162 | It can be observed that a couple of sboxes have incomplete tables (a 255 value indicate an unknown value). The recovered keys |
| 167 | | as of december/2010 show small randomness and big correlations, making possible that some unseen bits could make the |
| 163 | as of january/2015 show small randomness and big correlations, making possible that some unseen bits could make the |
| 168 | 164 | decryption need those incomplete parts. |
| 169 | 165 | |
| 170 | 166 | ****************************************************************************************/ |
| r242967 | r242968 | |
| 478 | 474 | {1,29}, {1,71}, {2,4}, {2,54}, {3,8}, {4,56}, {4,73}, {5,11}, |
| 479 | 475 | {6,51}, {7,92}, {8,89}, {9,9}, {9,10}, {9,39}, {9,41}, {9,58}, |
| 480 | 476 | {9,59}, {9,86}, {10,90}, {11,6}, {12,64}, {13,49}, {14,44}, {15,40}, |
| 481 | | {16,69}, {17,15}, {18,23}, {18,43}, {19,82}, {20,81}, {21,32}, {21,61}, |
| 482 | | {22,5}, {23,66}, {24,13}, {24,45}, {25,12}, {25,35} |
| 477 | {16,69}, {17,15}, {18,23}, {18,43}, {19,82}, {20,81}, {21,32}, {22,5}, |
| 478 | {23,66}, {24,13}, {24,45}, {25,12}, {25,35}, {26,61}, |
| 483 | 479 | }; |
| 484 | 480 | |
| 485 | 481 | const int sega_315_5881_crypt_device::fn2_game_key_scheduling[34][2] = { |
| 486 | 482 | {0,0}, {1,3}, {2,11}, {3,20}, {4,22}, {5,23}, {6,29}, {7,38}, |
| 487 | 483 | {8,39}, {9,47}, {9,55}, {9,86}, {9,87}, {9,90}, {10,50}, {10,53}, |
| 488 | 484 | {11,57}, {12,59}, {13,61}, {13,64}, {14,63}, {15,67}, {16,72}, {17,83}, |
| 489 | | {18,88}, {19,94}, {20,35}, {21,17}, {21,92}, {22,6}, {22,11}, {23,85}, |
| 490 | | {24,16}, {25,25} |
| 485 | {18,88}, {19,94}, {20,35}, {21,17}, {22,6}, {22,11}, {23,85}, {24,16}, |
| 486 | {25,25}, {26,92} |
| 491 | 487 | }; |
| 492 | 488 | |
| 493 | 489 | const int sega_315_5881_crypt_device::fn1_sequence_key_scheduling[20][2] = { |
trunk/src/mame/machine/naomicrypt.c
| r242967 | r242968 | |
| 28 | 28 | { |
| 29 | 29 | // name key gameid # year |
| 30 | 30 | // M2 |
| 31 | | { "wldkicks", 0x00ae2901 }, // 25209801 2000 |
| 32 | | { "toukon4", 0x012e2901 }, // 25349801 2000 |
| 31 | { "wldkicks", 0x052e2901 }, // 25209801 2000 |
| 32 | { "toukon4", 0x052e2901 }, // 25349801 2000 |
| 33 | 33 | { "ninjaslt", 0x000ca510 }, // 25469801 2000 |
| 34 | 34 | { "ninjaslt4", 0x000ca510 }, // 25469801 2000 |
| 35 | 35 | { "gunsur2e", 0x000680d0 }, // 25709801 2001 |
| r242967 | r242968 | |
| 68 | 68 | { "alienfnt", 0x00174343 }, // 840-0048 2001 |
| 69 | 69 | { "alienfnta", 0x00174343 }, // 840-0048 2001 |
| 70 | 70 | { "crackdj2", 0x00428247 }, // 840-0068 2001 |
| 71 | | { "vf4cart", 0x02ef2f96 }, // 840-0080 2002 |
| 71 | { "vf4cart", 0x06ef2f92 }, // 840-0080 2002 |
| 72 | 72 | { "pstone", 0x000e69c1 }, // 841-0001 1999 |
| 73 | 73 | { "suchie3", 0x000368e1 }, // 841-0002 1999 |
| 74 | 74 | { "doa2", 0x0008ad01 }, // 841-0003 1999 |