On 27/01/2023 10:34, Oliver Mihatsch wrote:
Hello OpenSSL users, I'm currently searching for the reverse operation of EC_GROUP_new_from_params() which should create an EC_GROUP from an OSSL_PARAM array in the public API. I need to convert an EC_GROUP back to an OSSL_PARAM array to modify it (in this case shift the generator/base point of the group). A suitable function is available in 'include/crypto/ec.h' called ossl_ec_group_todata() but I couldn't find a way to access it via public API. Is there something I've overlooked or is the counterpart function of EC_GROUP_new_from_params() missing in the public API?
AFAIK it is missing.
If this the case, would you accept a pull request to add a function like EC_GROUP_to_params() which internally calls ossl_ec_group_todata()?
It seems like a reasonable feature request. I can't promise it would be accepted but it would be looked at. Any such PR would need to target the master branch (it would not be acceptable for 3.1/3.0/1.1.1) and ensure it included appropriate documentation and tests.
Matt
Thanks a lot, Oliver ------ (/include/openssl/ec.h) EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[], OSSL_LIB_CTX *libctx, const char *propq); (include/crypto/ec.h) int ossl_ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl, OSSL_PARAM params[], OSSL_LIB_CTX *libctx, const char *propq, BN_CTX *bnctx, unsigned char **genbuf); int ossl_ec_group_fromdata(EC_KEY *ec, const OSSL_PARAM params[]);