From ed41e55df52e819f7687f7afcc336f7077b8725a Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@b08762b0-b915-fc4b-9d8c-17b2551a87ff> Date: Fri, 7 Mar 2008 07:46:13 +0000 Subject: [PATCH] =?UTF-8?q?(=E6=9B=B4=E6=96=B0:Akabane=20Jumpei)=20?= =?UTF-8?q?=E3=83=BBARM9=E3=81=8B=E3=82=89=E6=B8=A1=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9FDS=E4=BA=92=E6=8F=9BBlowfish=E3=83=86=E3=83=BC?= =?UTF-8?q?=E3=83=96=E3=83=AB=E3=82=92=E4=BD=BF=E3=81=86=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4=E3=80=82=20=E3=83=87=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=AB=E3=83=88=E3=81=A7=E3=81=AF=E3=80=81=E3=83=93?= =?UTF-8?q?=E3=83=AB=E3=83=89=E3=82=B9=E3=82=A4=E3=83=83=E3=83=81=E3=81=A7?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB=E3=81=AEBlowfish=E3=83=86?= =?UTF-8?q?=E3=83=BC=E3=83=96=E3=83=AB=E3=82=92=E4=BD=BF=E3=81=86=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84=E3=82=8B?= =?UTF-8?q?=E3=80=82=20=E3=83=93=E3=83=AB=E3=83=89=E3=82=B9=E3=82=A4?= =?UTF-8?q?=E3=83=83=E3=83=81=EF=BC=9AUSE=5FLOCAL=5FKEYTABLE=20(hotsw/ARM7?= =?UTF-8?q?/include/blowfish.h=E3=81=A7=E5=AE=9A=E7=BE=A9)?= 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@848 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- build/libraries_sysmenu/hotsw/ARM7/Makefile | 4 +--- build/libraries_sysmenu/hotsw/ARM7/include/blowfish.h | 4 ++++ build/libraries_sysmenu/hotsw/ARM7/src/blowfish.c | 11 ++++++++--- .../hotsw/ARM7/src/ds_blowfish_table.c | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/build/libraries_sysmenu/hotsw/ARM7/Makefile b/build/libraries_sysmenu/hotsw/ARM7/Makefile index 544cac43..9e7e28c7 100644 --- a/build/libraries_sysmenu/hotsw/ARM7/Makefile +++ b/build/libraries_sysmenu/hotsw/ARM7/Makefile @@ -34,9 +34,7 @@ SRCS = blowfish.c \ ds_blowfish_table.c \ dsCardCommon.c \ romEmulation.c \ - customNDma.c \ -# dsCardType1.c \ -# dsCardType2.c \ + customNDma.c TARGET_LIB = libhotsw_sp$(TWL_LIBSUFFIX).a diff --git a/build/libraries_sysmenu/hotsw/ARM7/include/blowfish.h b/build/libraries_sysmenu/hotsw/ARM7/include/blowfish.h index 559cf008..f38a49d9 100644 --- a/build/libraries_sysmenu/hotsw/ARM7/include/blowfish.h +++ b/build/libraries_sysmenu/hotsw/ARM7/include/blowfish.h @@ -21,10 +21,14 @@ extern "C" { #endif +#define USE_LOCAL_KEYTABLE + /*************************************************************************/ +#ifdef USE_LOCAL_KEYTABLE // 初期化テーブル extern const BLOWFISH_CTX GCDi_BlowfishInitTableDS; +#endif // Function Prototype ------------------------------------------------------------------------ // Blowfish 初期化 diff --git a/build/libraries_sysmenu/hotsw/ARM7/src/blowfish.c b/build/libraries_sysmenu/hotsw/ARM7/src/blowfish.c index 116b4d5c..2da68dbe 100644 --- a/build/libraries_sysmenu/hotsw/ARM7/src/blowfish.c +++ b/build/libraries_sysmenu/hotsw/ARM7/src/blowfish.c @@ -18,7 +18,6 @@ // Function Prototype ------------------------------------------------------- static u32 F(const BLOWFISH_CTX *ctx, u32 x); -//static void GCDi_InitBlowfishKeyAndTableDS(BLOWFISH_CTX *ctx, u32 *keyBufp, s32 keyLen); //***************************************** // @@ -27,16 +26,22 @@ static u32 F(const BLOWFISH_CTX *ctx, u32 x); //***************************************** void GCDm_MakeBlowfishTableDS(CardBootData *cbd, s32 keyLen) { +#ifdef USE_LOCAL_KEYTABLE const BLOWFISH_CTX *blowfishInitTablep = &GCDi_BlowfishInitTableDS; +#endif u32 blowfishedKey[2]; u8 *RomHeaderCtrlRsvB = cbd->pBootSegBuf->rh.s.ctrl_reserved_B; u32 *RomHeaderGameCode = (u32 *)cbd->pBootSegBuf->rh.s.game_code; u32 *keyBuf = cbd->keyBuf; BLOWFISH_CTX *ctx = &cbd->keyTable; - - MI_CpuCopy32((void *)blowfishInitTablep, (void *)ctx, sizeof(BLOWFISH_CTX)); +#ifdef USE_LOCAL_KEYTABLE + MI_CpuCopyFast((void *)blowfishInitTablep, (void *)ctx, sizeof(BLOWFISH_CTX)); +#else + MI_CpuCopyFast((void *)HW_WRAM_0_LTD, (void *)ctx, sizeof(BLOWFISH_CTX)); +#endif + keyBuf[0] = *RomHeaderGameCode; keyBuf[1] = *RomHeaderGameCode >> 1; keyBuf[2] = *RomHeaderGameCode << 1; diff --git a/build/libraries_sysmenu/hotsw/ARM7/src/ds_blowfish_table.c b/build/libraries_sysmenu/hotsw/ARM7/src/ds_blowfish_table.c index 0c402ad0..323aeb15 100644 --- a/build/libraries_sysmenu/hotsw/ARM7/src/ds_blowfish_table.c +++ b/build/libraries_sysmenu/hotsw/ARM7/src/ds_blowfish_table.c @@ -13,7 +13,7 @@ #include -const BLOWFISH_CTX GCDi_BlowfishInitTableDS = { +const BLOWFISH_CTX GCDi_BlowfishInitTableDS ATTRIBUTE_ALIGN(4) = { 0x5f20d599, 0xb9f54457, 0xd9a4196e, 0x945a6a9e, 0xebf1aed8, 0x3ae27541, 0x32d08293, 0xd531ee33, 0x9a6157cc, 0x1ba20637, 0xf5723979, 0xbef6ae55,