Need to call EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
with the ec pkey and then EVP_PKEY_derive_init
from that ctx then call EVP_PKEY_derive_set_peer
and finally EVP_PKEY_derive
Right now there is no way I can see to do any of these four calls with luaossl