Lines Matching refs:mmm
95 mp_err s_mp_redc(mp_int *T, mp_mont_modulus *mmm)
100 i = MP_USED(T) + MP_USED(&mmm->N) + 2;
102 for (i = 0; i < MP_USED(&mmm->N); ++i ) {
103 mp_digit m_i = MP_DIGIT(T, i) * mmm->n0prime;
105 MP_CHECKOK( s_mp_mul_d_add_offset(&mmm->N, m_i, T, i) );
110 s_mp_div_2d(T, mmm->b);
112 if ((res = s_mp_cmp(T, &mmm->N)) >= 0) {
114 MP_CHECKOK( s_mp_sub(T, &mmm->N) );
116 if ((res = mp_cmp(T, &mmm->N)) >= 0) {
193 mp_mont_modulus *mmm)
226 nsize = (MP_USED(&(mmm->N) + 1)) / 2;
227 n0 = big_n0(((uint64_t)(MP_DIGITS(&(mmm->N))[1]) << 32) +
228 MP_DIGITS(&(mmm->N))[0]);
230 nsize = MP_USED(&(mmm->N));
231 n0 = mmm->n0prime;
252 mpi_to_bignum64(&(mmm->N), &n_bn);
289 ib = MP_USED(a) + MP_MAX(MP_USED(b), MP_USED(&mmm->N)) + 2;
297 m_i = MP_DIGIT(c, 0) * mmm->n0prime;
298 s_mp_mul_d_add_offset(&mmm->N, m_i, c, 0);
308 m_i = MP_DIGIT(c, ib) * mmm->n0prime;
309 s_mp_mul_d_add_offset(&mmm->N, m_i, c, ib);
311 if (usedb < MP_USED(&mmm->N)) {
312 for (usedb = MP_USED(&mmm->N); ib < usedb; ++ib ) {
313 m_i = MP_DIGIT(c, ib) * mmm->n0prime;
314 s_mp_mul_d_add_offset(&mmm->N, m_i, c, ib);
318 s_mp_div_2d(c, mmm->b);
319 if (s_mp_cmp(c, &mmm->N) >= 0) {
320 MP_CHECKOK( s_mp_sub(c, &mmm->N) );