mirror of
https://github.com/cuberite/polarssl.git
synced 2025-08-27 15:02:47 -04:00
Merge pull request #7907 from gowthamsk-arm/fix_ecp_group_compare
tests/test_suite_ecp: Fix ECP group compare test
This commit is contained in:
commit
4e73afe6ed
@ -61,12 +61,11 @@ inline static int mbedtls_ecp_group_cmp(mbedtls_ecp_group *grp1,
|
|||||||
if (grp1->t_data != grp2->t_data) {
|
if (grp1->t_data != grp2->t_data) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (grp1->T_size != grp2->T_size) {
|
/* Here we should not compare T and T_size as the value of T is
|
||||||
return 1;
|
* always NULL for Montgomery curves and for Weierstrass curves
|
||||||
}
|
* it will be NULL until ecp_mul is called. After calling ecp_mul,
|
||||||
if (grp1->T != grp2->T) {
|
* the value will be unique (dynamically allocated).
|
||||||
return 1;
|
*/
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1207,6 +1206,8 @@ void mbedtls_ecp_group_metadata(int id, int bit_size, int crv_type,
|
|||||||
|
|
||||||
// Copy group and compare with original
|
// Copy group and compare with original
|
||||||
TEST_EQUAL(mbedtls_ecp_group_copy(&grp_cpy, &grp), 0);
|
TEST_EQUAL(mbedtls_ecp_group_copy(&grp_cpy, &grp), 0);
|
||||||
|
TEST_ASSERT(grp_cpy.T == NULL);
|
||||||
|
TEST_ASSERT(grp_cpy.T_size == 0);
|
||||||
TEST_EQUAL(mbedtls_ecp_group_cmp(&grp, &grp_cpy), 0);
|
TEST_EQUAL(mbedtls_ecp_group_cmp(&grp, &grp_cpy), 0);
|
||||||
|
|
||||||
// Check curve is in curve list and group ID list
|
// Check curve is in curve list and group ID list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user