Lines Matching defs:from

173 /* {{{ mp_init_copy(mp, from) */
176 mp_init_copy(mp, from)
178 Initialize mp as an exact copy of from. Returns MP_OKAY if
183 mp_err mp_init_copy(mp_int *mp, const mp_int *from)
185 ARGCHK(mp != NULL && from != NULL, MP_BADARG);
187 if(mp == from)
190 if((DIGITS(mp) = s_mp_alloc(ALLOC(from), sizeof(mp_digit), FLAG(from))) == NULL)
193 s_mp_copy(DIGITS(from), DIGITS(mp), USED(from));
194 USED(mp) = USED(from);
195 ALLOC(mp) = ALLOC(from);
196 SIGN(mp) = SIGN(from);
197 FLAG(mp) = FLAG(from);
205 /* {{{ mp_copy(from, to) */
208 mp_copy(from, to)
210 Copies the mp_int 'from' to the mp_int 'to'. It is presumed that
212 instead). If 'from' and 'to' are identical, nothing happens.
215 mp_err mp_copy(const mp_int *from, mp_int *to)
217 ARGCHK(from != NULL && to != NULL, MP_BADARG);
219 if(from == to)
228 all the used digits of 'from', we'll re-use it to avoid hitting
233 if(ALLOC(to) >= USED(from)) {
234 s_mp_setz(DIGITS(to) + USED(from), ALLOC(to) - USED(from));
235 s_mp_copy(DIGITS(from), DIGITS(to), USED(from));
238 if((tmp = s_mp_alloc(ALLOC(from), sizeof(mp_digit), FLAG(from))) == NULL)
241 s_mp_copy(DIGITS(from), tmp, USED(from));
251 ALLOC(to) = ALLOC(from);
254 /* Copy the precision and sign from the original */
255 USED(to) = USED(from);
256 SIGN(to) = SIGN(from);
257 FLAG(to) = FLAG(from);
2261 ** This technique from the paper "Fast Modular Reciprocals" (unpublished)
2332 ** This technique from the paper "Fast Modular Reciprocals" (unpublished)
2351 ** This technique from the paper "Fast Modular Reciprocals" (unpublished)
2679 /* Get sign from first byte */
2742 Read an integer from the given string, and set mp to the resulting
3038 /* Copy 'count' digits from sp to dp */
3095 /* Remove leading zeroes from the given value */
3281 /* Deal with rollover from last digit */
3462 /* Subtract d from |mp| in place, assumes |mp| > d */
4317 ** so its high bit is 1. This code is from NSPR.
4553 This algorithm was derived from the _Handbook of Applied