Home | History | Annotate | Download | only in pre_gen

Lines Matching defs:u3

2961    a*u1 + b*u2 = u3
2963 int mp_exteuclid(mp_int *a, mp_int *b, mp_int *U1, mp_int *U2, mp_int *U3)
2965 mp_int u1,u2,u3,v1,v2,v3,t1,t2,t3,q,tmp;
2968 if ((err = mp_init_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL)) != MP_OKAY) {
2972 /* initialize, (u1,u2,u3) = (1,0,a) */
2974 if ((err = mp_copy(a, &u3)) != MP_OKAY) { goto _ERR; }
2982 /* q = u3/v3 */
2983 if ((err = mp_div(&u3, &v3, &q, NULL)) != MP_OKAY) { goto _ERR; }
2985 /* (t1,t2,t3) = (u1,u2,u3) - (v1,v2,v3)q */
2991 if ((err = mp_sub(&u3, &tmp, &t3)) != MP_OKAY) { goto _ERR; }
2993 /* (u1,u2,u3) = (v1,v2,v3) */
2996 if ((err = mp_copy(&v3, &u3)) != MP_OKAY) { goto _ERR; }
3004 /* make sure U3 >= 0 */
3005 if (u3.sign == MP_NEG) {
3008 mp_neg(&u3, &u3);
3014 if (U3 != NULL) { mp_exch(U3, &u3); }
3017 _ERR: mp_clear_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL);