diff --git a/src/mame/machine/igs036crypt.cpp b/src/mame/machine/igs036crypt.cpp index 574f4345ebd..b05c0c7c346 100644 --- a/src/mame/machine/igs036crypt.cpp +++ b/src/mame/machine/igs036crypt.cpp @@ -15,18 +15,15 @@ The scheme works on 16-bits words and is probably designed to depend on 24 bits (word-) address; in what follows, we will refer to the 8 lowest ones simply as the lowest bits of the address, and the other 16 as the highest bits the address. -The address-based XOR is thought to be comprised of 16 one-bit XOR controlled -by a certain combination of one or two of the highest address bits. Every one of -the one-bit XORs affects a different bit of the word. The game key is comprised of -256 8-bits values provided by the internal ARM, and acts by masking on/off those XORs; -every 8-bit value in the key affect those words whose address match the index modulus 256; -every bit in a given key byte, affects two positions of the correponding 16-bits -encrypted words, in conjunction with the lowest bits of the address. +The address-based XOR can be thought as 16 one-bit XORs against key bits +controlled by certain combinations of up to three address bits. The game key is +comprised of 256 8-bits values provided by the internal ARM; every 8-bit value +in the key is used on those words whose address match the index modulus 256; +in a given key byte, every bit affects two positions of the correponding 16-bits +encrypted words. This use of the key is similar to the one found in previous instantiations of IGS circuits. -TO-DO (2017-12-06): change the current implementation to match the real keys. - What is new in the IGS036 is the use of an obfuscation working this way: 1) The highest bits of the address are split in 4 groups, every of which controls @@ -64,7 +61,7 @@ TO-DO: complete the table with the 20-bytes values *****************************************************************************/ -igs036_decryptor::igs036_decryptor(const uint16_t* game_key) +igs036_decryptor::igs036_decryptor(const uint8_t* game_key) : key(game_key) { } @@ -87,14 +84,13 @@ uint16_t igs036_decryptor::decrypt(uint16_t cipherword, int word_address)const // key-dependent manipulation for (int i=0; i<16; ++i) { - if (BIT(key[word_address&0xff],i)) - { - if (((word_address>>8)&triggers[i][0]) == triggers[i][1]) - aux ^= (1<