Fixed formatting, redundant if's and added a comment explaining why a value was chosen.

This commit is contained in:
Ethan Looney
2020-07-01 16:01:50 -07:00
parent f526a11126
commit 3242fa3669

View File

@ -16009,10 +16009,9 @@ static int test_wc_curve25519_shared_secret_ex (void)
ret = wc_curve25519_make_key(&rng, CURVE25519_KEYSIZE, &private_key);
}
}
if (ret == 0) {
if (ret == 0) {
ret = wc_curve25519_make_key(&rng, CURVE25519_KEYSIZE, &public_key);
}
}
if (ret == 0) {
ret = wc_curve25519_shared_secret_ex(&private_key, &public_key, out,
@ -16056,6 +16055,8 @@ static int test_wc_curve25519_shared_secret_ex (void)
}
if (ret == 0) {
/*curve25519.c is checking for public_key size less than or equal to 0x7f,
*increasing to 0x8f checks for error being returned*/
public_key.p.point[CURVE25519_KEYSIZE-1] = 0x8F;
ret = wc_curve25519_shared_secret_ex(&private_key, &public_key, out,
&outLen, endian);