From cbeb0b26e4c7caa8d1b47de791a7418dc20a4567 Mon Sep 17 00:00:00 2001 From: rsc Date: Sat, 1 Apr 2006 19:24:03 +0000 Subject: Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms. --- src/libmp/port/mpeuclid.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/libmp/port/mpeuclid.c') diff --git a/src/libmp/port/mpeuclid.c b/src/libmp/port/mpeuclid.c index 80b5983b..dda77eab 100644 --- a/src/libmp/port/mpeuclid.c +++ b/src/libmp/port/mpeuclid.c @@ -1,12 +1,12 @@ #include "os.h" #include -// extended euclid -// -// For a and b it solves, d = gcd(a,b) and finds x and y s.t. -// ax + by = d -// -// Handbook of Applied Cryptography, Menezes et al, 1997, pg 67 +/* extended euclid */ +/* */ +/* For a and b it solves, d = gcd(a,b) and finds x and y s.t. */ +/* ax + by = d */ +/* */ +/* Handbook of Applied Cryptography, Menezes et al, 1997, pg 67 */ void mpeuclid(mpint *a, mpint *b, mpint *d, mpint *x, mpint *y) @@ -44,16 +44,16 @@ mpeuclid(mpint *a, mpint *b, mpint *d, mpint *x, mpint *y) r = mpnew(0); while(b->top != 0 && b->sign > 0){ - // q = a/b - // r = a mod b + /* q = a/b */ + /* r = a mod b */ mpdiv(a, b, q, r); - // x0 = x2 - qx1 + /* x0 = x2 - qx1 */ mpmul(q, x1, x0); mpsub(x2, x0, x0); - // y0 = y2 - qy1 + /* y0 = y2 - qy1 */ mpmul(q, y1, y0); mpsub(y2, y0, y0); - // rotate values + /* rotate values */ tmp = a; a = b; b = r; -- cgit v1.2.3