[crypto] enhance generate_key to calculate ECC public keys from private ...

...keys