comparison bn_mp_exteuclid.c @ 190:d8254fc979e9 libtommath-orig LTM_0.35

Initial import of libtommath 0.35
author Matt Johnston <matt@ucc.asn.au>
date Fri, 06 May 2005 08:59:30 +0000
parents d29b64170cf0
children
comparison
equal deleted inserted replaced
142:d29b64170cf0 190:d8254fc979e9
57 if ((err = mp_copy(&t1, &v1)) != MP_OKAY) { goto _ERR; } 57 if ((err = mp_copy(&t1, &v1)) != MP_OKAY) { goto _ERR; }
58 if ((err = mp_copy(&t2, &v2)) != MP_OKAY) { goto _ERR; } 58 if ((err = mp_copy(&t2, &v2)) != MP_OKAY) { goto _ERR; }
59 if ((err = mp_copy(&t3, &v3)) != MP_OKAY) { goto _ERR; } 59 if ((err = mp_copy(&t3, &v3)) != MP_OKAY) { goto _ERR; }
60 } 60 }
61 61
62 /* make sure U3 >= 0 */
63 if (u3.sign == MP_NEG) {
64 mp_neg(&u1, &u1);
65 mp_neg(&u2, &u2);
66 mp_neg(&u3, &u3);
67 }
68
62 /* copy result out */ 69 /* copy result out */
63 if (U1 != NULL) { mp_exch(U1, &u1); } 70 if (U1 != NULL) { mp_exch(U1, &u1); }
64 if (U2 != NULL) { mp_exch(U2, &u2); } 71 if (U2 != NULL) { mp_exch(U2, &u2); }
65 if (U3 != NULL) { mp_exch(U3, &u3); } 72 if (U3 != NULL) { mp_exch(U3, &u3); }
66 73