[crypto] enhance generate_key for ECC keys

enhance generate_key to calculate ECC public keys from private keys