TSEC: Difference between revisions
No edit summary |
|||
Line 383: | Line 383: | ||
memcpy(key_buf, key_data_buf, 0x7C); | memcpy(key_buf, key_data_buf, 0x7C); | ||
u32 | u32 crypt_reg_flag = 0x00060000; | ||
u32 blob1_hash_addr = key_buf + 0x20; | u32 blob1_hash_addr = key_buf + 0x20; | ||
// fuc5 crypt cauth instruction | // fuc5 crypt cauth instruction | ||
// Set auth_addr to 0x300 and auth_size to blob1_size | // Set auth_addr to 0x300 and auth_size to blob1_size | ||
cauth((blob1_size << 0x10) | (0x300 >> 0x08)); | |||
// fuc5 crypt cxset instruction | // fuc5 crypt cxset instruction | ||
// | // The next 2 xfer instructions will be overridden | ||
// and target changes from DMA to crypto | |||
cxset(0x02); | |||
// Transfer data | // Transfer data to crypto register c6 | ||
xdst(0, (blob1_hash_addr | | xdst(0, (blob1_hash_addr | crypt_reg_flag)); | ||
// Wait for all data loads/stores to finish | // Wait for all data loads/stores to finish |