Constify a couple of globals

This commit is contained in:
Henrik Rydgard 2013-01-03 12:04:40 +01:00
parent e3ee83c6a6
commit 98fd202730
2 changed files with 7 additions and 7 deletions

View File

@ -454,7 +454,7 @@ struct TAG_INFO2
u8 type;
};
static TAG_INFO2 g_tagInfo2[] =
static const TAG_INFO2 g_tagInfo2[] =
{
{ 0x4C9494F0, keys660_k1, 0x43 },
{ 0x4C9495F0, keys660_k2, 0x43 },
@ -590,7 +590,7 @@ static TAG_INFO2 g_tagInfo2[] =
};
static TAG_INFO2 *GetTagInfo2(u32 tagFind)
static const TAG_INFO2 *GetTagInfo2(u32 tagFind)
{
for (u32 iTag = 0; iTag < sizeof(g_tagInfo2) / sizeof(TAG_INFO2); iTag++)
{
@ -605,7 +605,7 @@ static TAG_INFO2 *GetTagInfo2(u32 tagFind)
static int DecryptPRX2(const u8 *inbuf, u8 *outbuf, u32 size, u32 tag)
{
TAG_INFO2 * pti = GetTagInfo2(tag);
const TAG_INFO2 *pti = GetTagInfo2(tag);
if (!pti)
{
@ -632,7 +632,7 @@ static int DecryptPRX2(const u8 *inbuf, u8 *outbuf, u32 size, u32 tag)
return -2;
}
if ((size - 0x150) < retsize)
if (((int)size - 0x150) < retsize)
{
return -4;
}

View File

@ -37,11 +37,11 @@
//CMAC GLOBS
#define AES_128 0
unsigned char const_Rb[16] = {
const unsigned char const_Rb[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87
};
unsigned char const_Zero[16] = {
const unsigned char const_Zero[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
@ -1294,7 +1294,7 @@ void AES_encrypt(AES_ctx *ctx, const u8 *src, u8 *dst)
rijndaelEncrypt(ctx->ek, ctx->Nr, src, dst);
}
void xor_128(unsigned char *a, unsigned char *b, unsigned char *out)
void xor_128(const unsigned char *a, const unsigned char *b, unsigned char *out)
{
int i;
for (i=0;i<16; i++)