|
@@ -14,7 +14,7 @@ int pkcs_1_test(void)
|
|
{
|
|
{
|
|
unsigned char buf[3][128];
|
|
unsigned char buf[3][128];
|
|
int res1, res2, res3, prng_idx, hash_idx;
|
|
int res1, res2, res3, prng_idx, hash_idx;
|
|
- unsigned long x, y, l1, l2, l3, i1, i2, lparamlen, saltlen, modlen;
|
|
|
|
|
|
+ unsigned long x, y, l1, l2, l3, i1, lparamlen, saltlen, modlen;
|
|
static const unsigned char lparam[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 };
|
|
static const unsigned char lparam[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 };
|
|
|
|
|
|
/* get hash/prng */
|
|
/* get hash/prng */
|
|
@@ -75,7 +75,7 @@ int pkcs_1_test(void)
|
|
DO(pkcs_1_pss_decode(buf[0], l3, buf[1], l1, saltlen, hash_idx, modlen, &res2));
|
|
DO(pkcs_1_pss_decode(buf[0], l3, buf[1], l1, saltlen, hash_idx, modlen, &res2));
|
|
|
|
|
|
buf[0][i1] ^= 1;
|
|
buf[0][i1] ^= 1;
|
|
- buf[1][i2 = abs(rand()) % (l1 - 1)] ^= 1;
|
|
|
|
|
|
+ buf[1][abs(rand()) % (l1 - 1)] ^= 1;
|
|
pkcs_1_pss_decode(buf[0], l3, buf[1], l1, saltlen, hash_idx, modlen, &res3);
|
|
pkcs_1_pss_decode(buf[0], l3, buf[1], l1, saltlen, hash_idx, modlen, &res3);
|
|
if (!(res1 == 1 && res2 == 0 && res3 == 0)) {
|
|
if (!(res1 == 1 && res2 == 0 && res3 == 0)) {
|
|
fprintf(stderr, "PSS failed: %d, %d, %d, %lu, %lu\n", res1, res2, res3, l3, saltlen);
|
|
fprintf(stderr, "PSS failed: %d, %d, %d, %lu, %lu\n", res1, res2, res3, l3, saltlen);
|