Some clean up

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3377 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee
2009-06-08 14:36:00 +00:00
parent ad4ffaf0b6
commit 1a6b9d8174
21 changed files with 345 additions and 967 deletions

View File

@ -19,7 +19,6 @@
#include "pluginspecs_wiimote.h"
#include "Common.h"
#include "Logging.h" // for startConsoleWin, Console::Print, GetConsoleHwnd
#include "Encryption.h"
@ -247,9 +246,7 @@ void gentabs(u8 *rand, u8 *key, u8 idx, u8 *ft, u8 *sb)
// ===================================================
/* Generate key from the 0x40-0x4c data in g_RegExt */
// ----------------
void wiimote_gen_key(wiimote_key *key, u8 *keydata)
{
u8 rand[10];
@ -283,9 +280,7 @@ void wiimote_gen_key(wiimote_key *key, u8 *keydata)
}
// ===================================================
/* Encrypt data */
// ----------------
void wiimote_encrypt(wiimote_key *key, u8 *data, int addr, u8 len)
{
for(int i = 0; i < len; i++, addr++)
@ -293,11 +288,9 @@ void wiimote_encrypt(wiimote_key *key, u8 *data, int addr, u8 len)
}
// ===================================================
/* Decrypt data */
// ----------------
void wiimote_decrypt(wiimote_key *key, u8 *data, int addr, u8 len)
{
for(int i = 0; i < len; i++, addr++)
data[i] = (data[i] ^ key->sb[addr%8]) + key->ft[addr%8];
}
}