From 4f37095fa371da8522bb3f5b09add95189a8f2ef Mon Sep 17 00:00:00 2001 From: yutaka Date: Thu, 6 Mar 2008 05:33:03 +0000 Subject: [PATCH] =?UTF-8?q?=E9=8D=B5=E3=83=AA=E3=82=BB=E3=83=83=E3=83=88AP?= =?UTF-8?q?I=E3=81=AE=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@832 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- include/firm/aes/ARM7/aes_init.h | 63 ++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/include/firm/aes/ARM7/aes_init.h b/include/firm/aes/ARM7/aes_init.h index d1c5ca5a..9924c773 100644 --- a/include/firm/aes/ARM7/aes_init.h +++ b/include/firm/aes/ARM7/aes_init.h @@ -52,7 +52,45 @@ void AESi_InitKeysForApp( u8 game_code[4] ); void AESi_InitKeysForHard( u8 fuse[8] ); /*---------------------------------------------------------------------------* - Name: AESi_ResetAesKeyC + Name: AESi_ResetAesKeyA + + Description: set SEED/ID/KEYs filler data for slot-C + + Arguments: None + + Returns: None + *---------------------------------------------------------------------------*/ +static inline void AESi_ResetAesKeyA( void ) +{ + AES_Lock(); + AES_WaitKey(); + + MI_CpuCopy32( (u32*)AESi_ResetAesKeyA + 0, (u32*)REG_AES_KEY_A1_ADDR, 40 ); + + AES_Unlock(); +} + +/*---------------------------------------------------------------------------* + Name: AESi_ResetAesKeyB + + Description: set SEED/ID/KEYs filler data for slot-C + + Arguments: None + + Returns: None + *---------------------------------------------------------------------------*/ +static inline void AESi_ResetAesKeyB( void ) +{ + AES_Lock(); + AES_WaitKey(); + + MI_CpuCopy32( (u32*)AESi_ResetAesKeyB + 1, (u32*)REG_AES_KEY_B1_ADDR, 40 ); + + AES_Unlock(); +} + +/*---------------------------------------------------------------------------* + Name: AESi_ResetAesKeyB Description: set SEED/ID/KEYs filler data for slot-C @@ -65,28 +103,7 @@ static inline void AESi_ResetAesKeyC( void ) AES_Lock(); AES_WaitKey(); - MI_CpuCopy32( (u32*)AESi_ResetAesKeyC, (u32*)REG_AES_KEY_C1_ADDR, 40 ); - - AES_Unlock(); -} - -/*---------------------------------------------------------------------------* - Name: AESi_ResetAesKey - - Description: set SEED/ID/KEYs filler data without slot-D - - Arguments: None - - Returns: None - *---------------------------------------------------------------------------*/ -static inline void AESi_ResetAesKey( void ) -{ - AES_Lock(); - AES_WaitKey(); - - MI_CpuCopy32( (u32*)AESi_ResetAesKey, (u32*)REG_AES_KEY_A1_ADDR, 40 ); - MI_CpuCopy32( (u32*)AESi_ResetAesKey+10, (u32*)REG_AES_KEY_B1_ADDR, 40 ); - MI_CpuCopy32( (u32*)AESi_ResetAesKey+20, (u32*)REG_AES_KEY_C1_ADDR, 40 ); + MI_CpuCopy32( (u32*)AESi_ResetAesKeyC + 2, (u32*)REG_AES_KEY_C1_ADDR, 40 ); AES_Unlock(); }