keys.bin support added.

Remove hollywood id from config.
Tidy HLE_Device_es.h (maybe)
Added const params to crypto stuff.
This commit is contained in:
Matthew Parlane
2013-01-29 01:18:53 +13:00
parent 2dd077028f
commit bca2cac640
9 changed files with 193 additions and 57 deletions

View File

@ -40,7 +40,7 @@ static u8 ec_G[60] =
printf("\n");
}*/
static void elt_copy(u8 *d, u8 *a)
static void elt_copy(u8 *d, const u8 *a)
{
memcpy(d, a, 30);
}
@ -303,7 +303,7 @@ static void point_add(u8 *r, u8 *p, u8 *q)
elt_add(ry, s, rx);
}
void point_mul(u8 *d, u8 *a, u8 *b) // a is bignum
void point_mul(u8 *d, const u8 *a, u8 *b) // a is bignum
{
u32 i;
u8 mask;
@ -330,7 +330,7 @@ void silly_random(u8 * rndArea, u8 count)
}
}
void generate_ecdsa(u8 *R, u8 *S, u8 *k, u8 *hash)
void generate_ecdsa(u8 *R, u8 *S, const u8 *k, u8 *hash)
{
u8 e[30];
u8 kk[30];
@ -394,7 +394,7 @@ int check_ecdsa(u8 *Q, u8 *R, u8 *S, u8 *hash)
return (bn_compare(r1, R, 30) == 0);
}
void ec_priv_to_pub(u8 *k, u8 *Q)
void ec_priv_to_pub(const u8 *k, u8 *Q)
{
point_mul(Q, k, ec_G);
}