Add ecp_check_prvkey, with test

Also group key checking and generation functions in ecp.h and ecp.c.
4 files changed