diff --git a/rpcs3/Crypto/unedat.cpp b/rpcs3/Crypto/unedat.cpp index 21ccd2914f..27ddbffb6a 100644 --- a/rpcs3/Crypto/unedat.cpp +++ b/rpcs3/Crypto/unedat.cpp @@ -620,7 +620,7 @@ int validate_npd_hashes(const char* file_name, unsigned char *klicensee, NPD_HEA else { // Generate klicensee xor key. - xor(key, klicensee, NP_OMAC_KEY_2, 0x10); + xor_key(key, klicensee, NP_OMAC_KEY_2, 0x10); // Hash with generated key and compare with dev_hash. dev_hash_result = cmac_hash_compare(key, 0x10, dev, 0x60, npd->dev_hash, 0x10); @@ -699,7 +699,7 @@ bool extract_data(rFile *input, rFile *output, const char* input_file_name, unsi } // Generate SDAT key. - xor(key, NPD->dev_hash, SDAT_KEY, 0x10); + xor_key(key, NPD->dev_hash, SDAT_KEY, 0x10); } else { diff --git a/rpcs3/Crypto/utils.cpp b/rpcs3/Crypto/utils.cpp index 8cdf567c88..2cba01afb8 100644 --- a/rpcs3/Crypto/utils.cpp +++ b/rpcs3/Crypto/utils.cpp @@ -26,7 +26,7 @@ u64 swap64(u64 i) ((i & 0x00ff000000000000) >> 40) | ((i & 0xff00000000000000) >> 56); } -void xor(unsigned char *dest, unsigned char *src1, unsigned char *src2, int size) +void xor_key(unsigned char *dest, unsigned char *src1, unsigned char *src2, int size) { int i; for(i = 0; i < size; i++) diff --git a/rpcs3/Crypto/utils.h b/rpcs3/Crypto/utils.h index 34041d8645..1c27ddb182 100644 --- a/rpcs3/Crypto/utils.h +++ b/rpcs3/Crypto/utils.h @@ -4,7 +4,7 @@ // Licensed under the terms of the GNU GPL, version 3 // http://www.gnu.org/licenses/gpl-3.0.txt -#define MAX_PATH _MAX_PATH +#define MAX_PATH 4096 #include #include "aes.h" @@ -16,7 +16,7 @@ u16 swap16(u16 i); u32 swap32(u32 i); u64 swap64(u64 i); -void xor(unsigned char *dest, unsigned char *src1, unsigned char *src2, int size); +void xor_key(unsigned char *dest, unsigned char *src1, unsigned char *src2, int size); void prng(unsigned char *dest, int size); char* extract_file_name(const char* file_path, char real_file_name[MAX_PATH]);