Lines Matching refs:MOD
110 static p256_digit subM(const p256_int* MOD, in subM() argument
118 borrow -= P256_DIGIT(MOD, i) & mask; in subM()
127 static p256_digit addM(const p256_int* MOD, in addM() argument
135 carry += P256_DIGIT(MOD, i) & mask; in addM()
143 void p256_modmul(const p256_int* MOD, in p256_modmul() argument
169 top_reducer = mulAdd(MOD, top, 0, reducer); in p256_modmul()
177 top = subM(MOD, top, tmp + i, ~(top - 1)); in p256_modmul()
187 addM(MOD, 0, tmp, subM(MOD, 0, tmp, -1)); in p256_modmul()
291 void p256_modinv_vartime(const p256_int* MOD, in p256_modinv_vartime() argument
296 p256_int U = *MOD; in p256_modinv_vartime()
306 p256_shr1(&R, p256_add(&R, MOD, &R), &R); in p256_modinv_vartime()
314 p256_shr1(&S, p256_add(&S, MOD, &S) , &S); in p256_modinv_vartime()
319 if (p256_sub(&S, &R, &S)) p256_add(&S, MOD, &S); in p256_modinv_vartime()
323 if (p256_sub(&R, &S, &R)) p256_add(&R, MOD, &R); in p256_modinv_vartime()
328 p256_mod(MOD, &R, b); in p256_modinv_vartime()
331 void p256_mod(const p256_int* MOD, in p256_mod() argument
335 addM(MOD, 0, P256_DIGITS(out), subM(MOD, 0, P256_DIGITS(out), -1)); in p256_mod()