mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Quickfix for a symbol collision. Should really share the AES code.
This commit is contained in:
1 parent
d3a66d0a90
commit
d73fcebc3f
5 files changed
+13
-13
No files matched your search
+2
-2
@@ -89,9 +89,9 @@ int AES_set_encrypt_key(const unsigned char* userKey, const int bits,
|
||||
int AES_set_decrypt_key(const unsigned char* userKey, const int bits,
|
||||
AES_KEY* key);
|
||||
|
||||
void AES_encrypt(const unsigned char* in, unsigned char* out,
|
||||
void AES_encrypt1(const unsigned char* in, unsigned char* out,
|
||||
const AES_KEY* key);
|
||||
void AES_decrypt(const unsigned char* in, unsigned char* out,
|
||||
void AES_decrypt1(const unsigned char* in, unsigned char* out,
|
||||
const AES_KEY* key);
|
||||
|
||||
void AES_ecb_encrypt(const unsigned char* in, unsigned char* out,
|
||||
|
||||
@@ -75,7 +75,7 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
while (len >= AES_BLOCK_SIZE) {
|
||||
for(n=0; n < AES_BLOCK_SIZE; ++n)
|
||||
out[n] = in[n] ^ iv[n];
|
||||
AES_encrypt(out, out, key);
|
||||
AES_encrypt1(out, out, key);
|
||||
iv = out;
|
||||
len -= AES_BLOCK_SIZE;
|
||||
in += AES_BLOCK_SIZE;
|
||||
@@ -86,13 +86,13 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
out[n] = in[n] ^ iv[n];
|
||||
for(n=len; n < AES_BLOCK_SIZE; ++n)
|
||||
out[n] = iv[n];
|
||||
AES_encrypt(out, out, key);
|
||||
AES_encrypt1(out, out, key);
|
||||
iv = out;
|
||||
}
|
||||
memcpy(ivec,iv,AES_BLOCK_SIZE);
|
||||
} else if (in != out) {
|
||||
while (len >= AES_BLOCK_SIZE) {
|
||||
AES_decrypt(in, out, key);
|
||||
AES_decrypt1(in, out, key);
|
||||
for(n=0; n < AES_BLOCK_SIZE; ++n)
|
||||
out[n] ^= iv[n];
|
||||
iv = in;
|
||||
@@ -101,7 +101,7 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
out += AES_BLOCK_SIZE;
|
||||
}
|
||||
if (len) {
|
||||
AES_decrypt(in,tmp,key);
|
||||
AES_decrypt1(in,tmp,key);
|
||||
for(n=0; n < len; ++n)
|
||||
out[n] = tmp[n] ^ iv[n];
|
||||
iv = in;
|
||||
@@ -110,7 +110,7 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
} else {
|
||||
while (len >= AES_BLOCK_SIZE) {
|
||||
memcpy(tmp, in, AES_BLOCK_SIZE);
|
||||
AES_decrypt(in, out, key);
|
||||
AES_decrypt1(in, out, key);
|
||||
for(n=0; n < AES_BLOCK_SIZE; ++n)
|
||||
out[n] ^= ivec[n];
|
||||
memcpy(ivec, tmp, AES_BLOCK_SIZE);
|
||||
@@ -120,7 +120,7 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
}
|
||||
if (len) {
|
||||
memcpy(tmp, in, AES_BLOCK_SIZE);
|
||||
AES_decrypt(tmp, out, key);
|
||||
AES_decrypt1(tmp, out, key);
|
||||
for(n=0; n < len; ++n)
|
||||
out[n] ^= ivec[n];
|
||||
for(n=len; n < AES_BLOCK_SIZE; ++n)
|
||||
|
||||
@@ -778,7 +778,7 @@ int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
* Encrypt a single block
|
||||
* in and out can overlap
|
||||
*/
|
||||
void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
void AES_encrypt1(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key) {
|
||||
|
||||
const u32 *rk;
|
||||
@@ -969,7 +969,7 @@ void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
* Decrypt a single block
|
||||
* in and out can overlap
|
||||
*/
|
||||
void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
void AES_decrypt1(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key) {
|
||||
|
||||
const u32 *rk;
|
||||
|
||||
+2
-2
@@ -37,11 +37,11 @@
|
||||
|
||||
//CMAC GLOBS
|
||||
#define AES_128 0
|
||||
const unsigned char const_Rb[16] = {
|
||||
static const unsigned char const_Rb[16] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87
|
||||
};
|
||||
const unsigned char const_Zero[16] = {
|
||||
static const unsigned char const_Zero[16] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
+1
-1
Submodule pspautotests updated: a013aed6f1...24620b2ae1.
Reference in new issue
Block a user