This is my code:
EC_KEY *eckey = EC_KEY_new();
EC_KEY_generate_key(eckey);
const EC_POINT *pub = EC_KEY_get0_public_key(eckey);
printf("%s", pub->X);
I'm getting an error that says "Incomplete definition of type 'struct ec_point_st'". I also tried:
EC_GROUP *curve = EC_GROUP_new_by_curve_name(NID_secp521r1);
BN_CTX *ecctx= BN_CTX_new();
EC_KEY *eckey = EC_KEY_new();
EC_KEY_generate_key(eckey);
const EC_POINT *pub = EC_KEY_get0_public_key(eckey);
NSLog(@"%s", EC_POINT_point2hex(curve, pub, POINT_CONVERSION_HYBRID, ecctx));
in which case I'm getting an EXC_BAD_ACCESS error. How can I print (for debugging) the x and y points of the public key?