Fix the implementation for NIST P-256 and secp256k1