/* Perform a "final reduction" in field F256 (field for curve P-256). The source value must be less than twice the modulus. If the value is not lower than the modulus, then the modulus is subtracted and this function returns 1; otherwise, it leaves it untouched and it returns 0.  */
static uint32_t reduce_final_f256(uint32_t *d)
/* Perform a "final reduction" in field F256 (field for curve P-256). The source value must be less than twice the modulus. If the value is not lower than the modulus, then the modulus is subtracted and this function returns 1; otherwise, it leaves it untouched and it returns 0.  */
static uint32_t reduce_final_f256(uint32_t *d)
{
	uint32_t t[9];
	uint32_t cc;
	int i;
	cc = 0;
	for (i = 0; i < 9; i ++) {
		uint32_t w;
		w = d[i] - F256[i] - cc;
		cc = w >> 31;
		t[i] = w & 0x3FFFFFFF;
	}
	cc ^= 1;
	CCOPY(cc, d, t, sizeof t);
	return cc;
}