optimized ecc_encrypt_key