Changes

765 bytes added ,  20:25, 9 March 2015
Moved info from elsewhere since it's not really relevant there.
Line 158: Line 158:     
The TWL_FIRM ARM11-process includes a TWL bootloader, see [http://dsibrew.org/wiki/Bootloader here] and [[Memory_layout#Detailed_TWL_FIRM_ARM11_Memory|here]] for details. See [http://dsibrew.org/wiki/Bootloader here] regarding the RSA code used by TWL_FIRM for all TWL RSA sig-checks.
 
The TWL_FIRM ARM11-process includes a TWL bootloader, see [http://dsibrew.org/wiki/Bootloader here] and [[Memory_layout#Detailed_TWL_FIRM_ARM11_Memory|here]] for details. See [http://dsibrew.org/wiki/Bootloader here] regarding the RSA code used by TWL_FIRM for all TWL RSA sig-checks.
 +
 +
TWL_FIRM verifies all TWL RSA padding with the following. This is different from the DSi "BIOS" code.
 +
* The first byte must be 0x0.
 +
* The second byte must be 0x1 or 0x2.
 +
* Executes a while(<value of byte at current pos in RSA message>). When the second_byte in the message is 0x1, the byte at curpos must be 0xFF(otherwise the non-zero value of the byte at curpos doesn't matter). This loop must find a zero byte before offset 0x7F in the message otherwise an error is returned.
 +
* Returns an address for msg_curpos+1.
 +
With the code in TWL_FIRM, the actual "totalhashdatasize" in the RSA message must be <= <expected hashdata_size>(0x74 for bootloader). The TWL_FIRM code copies the RSA "hashdata" to the output buffer, using the actual size of the RSA "hashdata".
    
== FIRM Launch Parameters ==
 
== FIRM Launch Parameters ==