Reorganise ECC code so it can use FIPS module.