[makerom] corrected aes keygen code, thanks plutoo.

This commit is contained in:
jakcron
2016-01-15 21:51:59 +08:00
parent 8420f9dadd
commit fefa25f5ad
5 changed files with 29 additions and 21 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
#include "lib.h"
#include "aes_keygen.h"
#include "ncch_build.h"
#include "exheader_build.h"
#include "exheader_read.h"
@@ -1043,12 +1044,12 @@ bool SetNcchKeys(keys_struct *keys, ncch_hdr *hdr)
}
if(keys->aes.ncchKeyX[0])
AesKeyScrambler(keys->aes.ncchKey0,keys->aes.ncchKeyX[0],hdr->signature);
ctr_aes_keygen(keys->aes.ncchKeyX[0],hdr->signature,keys->aes.ncchKey0);
else
return false;
if(keys->aes.ncchKeyX[hdr->flags[ncchflag_CONTENT_KEYX]])
AesKeyScrambler(keys->aes.ncchKey1,keys->aes.ncchKeyX[hdr->flags[ncchflag_CONTENT_KEYX]],hdr->signature);
ctr_aes_keygen(keys->aes.ncchKeyX[ncchflag_CONTENT_KEYX], hdr->signature, keys->aes.ncchKey0);
else
return false;