You should avoid ecdsa and use ed25519 instead.
https://www.schneier.com/blog/archives/2007/11/the_strange_s...
https://www.schneier.com/blog/archives/2007/11/the_strange_s...
You can read about what is actually done to make ECDSA keys here.
https://wiki.openssl.org/index.php/Creating_an_OpenSSL_Engin...