@@ -59640,6 +59640,7 @@ static int test_wolfSSL_EC_POINT(void)
5964059640 EC_POINT* Gxy = NULL;
5964159641 EC_POINT* new_point = NULL;
5964259642 EC_POINT* set_point = NULL;
59643+ EC_POINT* get_point = NULL;
5964359644 EC_POINT* infinity = NULL;
5964459645 BIGNUM* k = NULL;
5964559646 BIGNUM* Gx = NULL;
@@ -59657,6 +59658,14 @@ static int test_wolfSSL_EC_POINT(void)
5965759658 "77037D812DEB33A0F4A13945D898C296";
5965859659 const char* kGy = "4FE342E2FE1A7F9B8EE7EB4A7C0F9E16"
5965959660 "2BCE33576B315ECECBB6406837BF51F5";
59661+ const char* uncompG
59662+ = "046B17D1F2E12C4247F8BCE6E563A440F2"
59663+ "77037D812DEB33A0F4A13945D898C296"
59664+ "4FE342E2FE1A7F9B8EE7EB4A7C0F9E16"
59665+ "2BCE33576B315ECECBB6406837BF51F5";
59666+ const char* compG
59667+ = "036B17D1F2E12C4247F8BCE6E563A440F2"
59668+ "77037D812DEB33A0F4A13945D898C296";
5966059669
5966159670#ifndef HAVE_SELFTEST
5966259671 EC_POINT *tmp = NULL;
@@ -59665,10 +59674,6 @@ static int test_wolfSSL_EC_POINT(void)
5966559674 unsigned char* buf = NULL;
5966659675 unsigned char bufInf[1] = { 0x00 };
5966759676
59668- const char* uncompG = "046B17D1F2E12C4247F8BCE6E563A440F2"
59669- "77037D812DEB33A0F4A13945D898C296"
59670- "4FE342E2FE1A7F9B8EE7EB4A7C0F9E16"
59671- "2BCE33576B315ECECBB6406837BF51F5";
5967259677 const unsigned char binUncompG[] = {
5967359678 0x04, 0x6b, 0x17, 0xd1, 0xf2, 0xe1, 0x2c, 0x42, 0x47, 0xf8, 0xbc,
5967459679 0xe6, 0xe5, 0x63, 0xa4, 0x40, 0xf2, 0x77, 0x03, 0x7d, 0x81, 0x2d,
@@ -59686,8 +59691,6 @@ static int test_wolfSSL_EC_POINT(void)
5968659691 0x5e, 0xce, 0xcb, 0xb6, 0x40, 0x68, 0x37, 0xbf, 0x51, 0xf5,
5968759692 };
5968859693
59689- const char* compG = "036B17D1F2E12C4247F8BCE6E563A440F2"
59690- "77037D812DEB33A0F4A13945D898C296";
5969159694#ifdef HAVE_COMP_KEY
5969259695 const unsigned char binCompG[] = {
5969359696 0x03, 0x6b, 0x17, 0xd1, 0xf2, 0xe1, 0x2c, 0x42, 0x47, 0xf8, 0xbc,
@@ -59912,7 +59915,6 @@ static int test_wolfSSL_EC_POINT(void)
5991259915#endif
5991359916 XFREE(hexStr, NULL, DYNAMIC_TYPE_ECC);
5991459917
59915- #ifndef HAVE_SELFTEST
5991659918 /* Test point to hex */
5991759919 ExpectNull(EC_POINT_point2hex(NULL, NULL, POINT_CONVERSION_UNCOMPRESSED,
5991859920 ctx));
@@ -59929,13 +59931,22 @@ static int test_wolfSSL_EC_POINT(void)
5992959931 hexStr = EC_POINT_point2hex(group, Gxy, POINT_CONVERSION_UNCOMPRESSED, ctx);
5993059932 ExpectNotNull(hexStr);
5993159933 ExpectStrEQ(hexStr, uncompG);
59934+ AssertNotNull(get_point = EC_POINT_hex2point(group, hexStr, NULL, ctx));
59935+ AssertIntEQ(EC_POINT_cmp(group, Gxy, get_point, ctx), 0);
5993259936 XFREE(hexStr, NULL, DYNAMIC_TYPE_ECC);
5993359937
5993459938 hexStr = EC_POINT_point2hex(group, Gxy, POINT_CONVERSION_COMPRESSED, ctx);
5993559939 ExpectNotNull(hexStr);
5993659940 ExpectStrEQ(hexStr, compG);
59941+ #ifdef HAVE_COMP_KEY
59942+ AssertNotNull(get_point = EC_POINT_hex2point
59943+ (group, hexStr, get_point, ctx));
59944+ AssertIntEQ(EC_POINT_cmp(group, Gxy, get_point, ctx), 0);
59945+ #endif
5993759946 XFREE(hexStr, NULL, DYNAMIC_TYPE_ECC);
59947+ EC_POINT_free(get_point);
5993859948
59949+ #ifndef HAVE_SELFTEST
5993959950 /* Test point to oct */
5994059951 ExpectIntEQ(EC_POINT_point2oct(NULL, NULL, POINT_CONVERSION_UNCOMPRESSED,
5994159952 NULL, 0, ctx), 0);
0 commit comments