mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-05-04 21:54:14 +02:00
New API
Add `wc_ecc_import_point_der_ex` for correct importing DER ECC point and keep `wc_ecc_import_point_der` old functionality
This commit is contained in:
+26
-2
@@ -19106,17 +19106,41 @@ static int ecc_point_test(void)
|
||||
}
|
||||
|
||||
#ifdef HAVE_COMP_KEY
|
||||
ret = wc_ecc_import_point_der(derComp0, sizeof(derComp0), curve_idx, point3);
|
||||
ret = wc_ecc_import_point_der(derComp0, sizeof(derComp0)*2-1, curve_idx, point3);
|
||||
if (ret != 0) {
|
||||
ret = -9726;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = wc_ecc_import_point_der(derComp1, sizeof(derComp1), curve_idx, point4);
|
||||
ret = wc_ecc_import_point_der_ex(derComp0, sizeof(derComp0), curve_idx, point4, 0);
|
||||
if (ret != 0) {
|
||||
ret = -9727;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = wc_ecc_cmp_point(point3, point4);
|
||||
if (ret != MP_EQ) {
|
||||
ret = -9728;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = wc_ecc_import_point_der(derComp1, sizeof(derComp1)*2-1, curve_idx, point3);
|
||||
if (ret != 0) {
|
||||
ret = -9729;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = wc_ecc_import_point_der_ex(derComp1, sizeof(derComp1), curve_idx, point4, 0);
|
||||
if (ret != 0) {
|
||||
ret = -9730;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = wc_ecc_cmp_point(point3, point4);
|
||||
if (ret != MP_EQ) {
|
||||
ret = -9731;
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
|
||||
done:
|
||||
|
||||
Reference in New Issue
Block a user