forked from wolfSSL/wolfssl
Fixed formatting, redundant if's and added a comment explaining why a value was chosen.
This commit is contained in:
@ -16009,10 +16009,9 @@ static int test_wc_curve25519_shared_secret_ex (void)
|
|||||||
ret = wc_curve25519_make_key(&rng, CURVE25519_KEYSIZE, &private_key);
|
ret = wc_curve25519_make_key(&rng, CURVE25519_KEYSIZE, &private_key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret == 0) {
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = wc_curve25519_make_key(&rng, CURVE25519_KEYSIZE, &public_key);
|
ret = wc_curve25519_make_key(&rng, CURVE25519_KEYSIZE, &public_key);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = wc_curve25519_shared_secret_ex(&private_key, &public_key, out,
|
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) {
|
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;
|
public_key.p.point[CURVE25519_KEYSIZE-1] = 0x8F;
|
||||||
ret = wc_curve25519_shared_secret_ex(&private_key, &public_key, out,
|
ret = wc_curve25519_shared_secret_ex(&private_key, &public_key, out,
|
||||||
&outLen, endian);
|
&outLen, endian);
|
||||||
|
Reference in New Issue
Block a user