Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Commit

Permalink
Fix Checksums for Key1 and Key2.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrimsonMaple committed Nov 9, 2017
1 parent bd1059a commit 9c56225
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@ void checkKeyHash(u8* key1, u8* key2){
ALIGNED(4) u8 computed_key2[SHA_256_HASH_SIZE];

ALIGNED(4) const u8 key1_hash[SHA_256_HASH_SIZE] = {
0x18, 0x08, 0x60, 0xF9, 0x82, 0x44, 0x46, 0xB8, 0xAA, 0x2D, 0xFF, 0xB8, 0x71, 0x40, 0x27, 0x32, 0x73, 0xB6, 0xB6, 0xA9, 0xC8, 0x37, 0x72, 0x02, 0xF9, 0xC4, 0xF9, 0x72, 0x3E, 0xE9, 0x94, 0xB8
0xBA, 0xC1, 0x40, 0x9C, 0x6E, 0xE4, 0x1F, 0x04, 0xAA, 0xC4, 0xE2, 0x09, 0x5C, 0xE9, 0x4F, 0x78, 0x6C, 0x78, 0x5F, 0xAC, 0xEC, 0x7E, 0xC0, 0x11, 0x26, 0x9D, 0x4E, 0x47, 0xB3, 0x64, 0xC4, 0xA5
};
ALIGNED(4) const u8 key2_hash[SHA_256_HASH_SIZE] = {
0x9F, 0x80, 0x48, 0x66, 0xF1, 0xF0, 0x4B, 0x78, 0x8D, 0xEE, 0x09, 0x17, 0xB1, 0xBB, 0xD5, 0x5F, 0x6B, 0x87, 0xC4, 0x31, 0x37, 0x10, 0x49, 0x04, 0xF5, 0xC3, 0x4D, 0x97, 0xB2, 0x33, 0xCD, 0xDF
0x8B, 0xB9, 0x77, 0x76, 0x86, 0xBD, 0xCC, 0xFF, 0x30, 0xE9, 0x4D, 0xC6, 0x5F, 0x23, 0x43, 0xF7, 0x41, 0x2E, 0x3D, 0x6C, 0x19, 0x12, 0xE3, 0x18, 0xDA, 0x9F, 0x17, 0x35, 0x96, 0xB9, 0xE8, 0x98
};

//Compute & Compare SHA Hashes
Expand Down Expand Up @@ -408,7 +408,7 @@ void k9loader(Arm9Bin* sect_arm9){
memcpy(key2, secretSector + AES_BLOCK_SIZE, AES_BLOCK_SIZE);

//Check Key1+Key2 Hashes
//checkKeyHash(key1, key2);
checkKeyHash(key1, key2);

//Clear buffer
memset(secretSector, 0, 512);
Expand Down Expand Up @@ -441,8 +441,8 @@ void k9loader(Arm9Bin* sect_arm9){
memset(CTR, 0, AES_BLOCK_SIZE);

if(*arm9BinStart != 0x47704770 && *arm9BinStart != 0xB0862000){
shutdown();
debugWrite("/rei/debugCrypto.log", "Failed to decrypt arm9 binary... ", 33);
shutdown();
}
}

Expand Down

0 comments on commit 9c56225

Please sign in to comment.