Use gcc -ansi -pedantic in 9c.  Fix many non-C89-isms.
diff --git a/src/libmp/port/betomp.c b/src/libmp/port/betomp.c
index 95935fc..27fe343 100644
--- a/src/libmp/port/betomp.c
+++ b/src/libmp/port/betomp.c
@@ -2,7 +2,7 @@
 #include <mp.h>
 #include "dat.h"
 
-// convert a big-endian byte array (most significant byte first) to an mpint
+/* convert a big-endian byte array (most significant byte first) to an mpint */
 mpint*
 betomp(uchar *p, uint n, mpint *b)
 {
@@ -12,18 +12,18 @@
 	if(b == nil)
 		b = mpnew(0);
 
-	// dump leading zeros
+	/* dump leading zeros */
 	while(*p == 0 && n > 1){
 		p++;
 		n--;
 	}
 
-	// get the space
+	/* get the space */
 	mpbits(b, n*8);
 	b->top = DIGITS(n*8);
 	m = b->top-1;
 
-	// first digit might not be Dbytes long
+	/* first digit might not be Dbytes long */
 	s = ((n-1)*8)%Dbits;
 	x = 0;
 	for(; n > 0; n--){
diff --git a/src/libmp/port/crt.c b/src/libmp/port/crt.c
index a98fef5..6dc6eea 100644
--- a/src/libmp/port/crt.c
+++ b/src/libmp/port/crt.c
@@ -1,20 +1,20 @@
 #include "os.h"
 #include <mp.h>
 
-// chinese remainder theorem
-//
-// handbook of applied cryptography, menezes et al, 1997, pp 610 - 613
+/* chinese remainder theorem */
+/* */
+/* handbook of applied cryptography, menezes et al, 1997, pp 610 - 613 */
 
 struct CRTpre
 {
-	int	n;		// number of moduli
-	mpint	**m;		// pointer to moduli
-	mpint	**c;		// precomputed coefficients
-	mpint	**p;		// precomputed products
-	mpint	*a[1];		// local storage
+	int	n;		/* number of moduli */
+	mpint	**m;		/* pointer to moduli */
+	mpint	**c;		/* precomputed coefficients */
+	mpint	**p;		/* precomputed products */
+	mpint	*a[1];		/* local storage */
 };
 
-// setup crt info, returns a newly created structure
+/* setup crt info, returns a newly created structure */
 CRTpre*
 crtpre(int n, mpint **m)
 {
@@ -30,18 +30,18 @@
 	crt->p = crt->c+n;
 	crt->n = n;
 
-	// make a copy of the moduli
+	/* make a copy of the moduli */
 	for(i = 0; i < n; i++)
 		crt->m[i] = mpcopy(m[i]);
 
-	// precompute the products
+	/* precompute the products */
 	u = mpcopy(mpone);
 	for(i = 0; i < n; i++){
 		mpmul(u, m[i], u);
 		crt->p[i] = mpcopy(u);
 	}
 
-	// precompute the coefficients
+	/* precompute the coefficients */
 	for(i = 1; i < n; i++){
 		crt->c[i] = mpcopy(mpone);
 		for(j = 0; j < i; j++){
@@ -70,7 +70,7 @@
 	free(crt);
 }
 
-// convert to residues, returns a newly created structure
+/* convert to residues, returns a newly created structure */
 CRTres*
 crtin(CRTpre *crt, mpint *x)
 {
@@ -88,7 +88,7 @@
 	return res;
 }
 
-// garners algorithm for converting residue form to linear
+/* garners algorithm for converting residue form to linear */
 void
 crtout(CRTpre *crt, CRTres *res, mpint *x)
 {
@@ -109,7 +109,7 @@
 	mpfree(u);
 }
 
-// free the residue
+/* free the residue */
 void
 crtresfree(CRTres *res)
 {
diff --git a/src/libmp/port/crttest.c b/src/libmp/port/crttest.c
index 1ae68c7..7106076 100644
--- a/src/libmp/port/crttest.c
+++ b/src/libmp/port/crttest.c
@@ -11,19 +11,19 @@
 
 	fmtinstall('B', mpconv);
 
-	// get a modulus and a test number
+	/* get a modulus and a test number */
 	m = mpnew(1024+160);
 	mpmul(p[0], p[1], m);
 	x = mpnew(1024+160);
 	mpadd(m, mpone, x);
 
-	// do the precomputation for crt conversion
+	/* do the precomputation for crt conversion */
 	crt = crtpre(2, p);
 
-	// convert x to residues
+	/* convert x to residues */
 	res = crtin(crt, x);
 
-	// convert back
+	/* convert back */
 	y = mpnew(1024+160);
 	crtout(crt, res, y);
 	print("x %B\ny %B\n", x, y);
diff --git a/src/libmp/port/dat.h b/src/libmp/port/dat.h
index 50fbf67..95f4196 100644
--- a/src/libmp/port/dat.h
+++ b/src/libmp/port/dat.h
@@ -1,12 +1,12 @@
 #define	mpdighi  (mpdigit)((ulong)1<<(Dbits-1))
 #define DIGITS(x) ((Dbits - 1 + (x))/Dbits)
 
-// for converting between int's and mpint's
+/* for converting between int's and mpint's */
 #define MAXUINT ((uint)-1)
 #define MAXINT (MAXUINT>>1)
 #define MININT (MAXINT+1)
 
-// for converting between vlongs's and mpint's
+/* for converting between vlongs's and mpint's */
 #define MAXUVLONG (~0ULL)
 #define MAXVLONG (MAXUVLONG>>1)
 #define MINVLONG (MAXVLONG+1ULL)
diff --git a/src/libmp/port/letomp.c b/src/libmp/port/letomp.c
index e23fed2..8e494f9 100644
--- a/src/libmp/port/letomp.c
+++ b/src/libmp/port/letomp.c
@@ -2,7 +2,7 @@
 #include <mp.h>
 #include "dat.h"
 
-// convert a little endian byte array (least significant byte first) to an mpint
+/* convert a little endian byte array (least significant byte first) to an mpint */
 mpint*
 letomp(uchar *s, uint n, mpint *b)
 {
diff --git a/src/libmp/port/mpadd.c b/src/libmp/port/mpadd.c
index 6022a64..4811250 100644
--- a/src/libmp/port/mpadd.c
+++ b/src/libmp/port/mpadd.c
@@ -2,14 +2,14 @@
 #include <mp.h>
 #include "dat.h"
 
-// sum = abs(b1) + abs(b2), i.e., add the magnitudes
+/* sum = abs(b1) + abs(b2), i.e., add the magnitudes */
 void
 mpmagadd(mpint *b1, mpint *b2, mpint *sum)
 {
 	int m, n;
 	mpint *t;
 
-	// get the sizes right
+	/* get the sizes right */
 	if(b2->top > b1->top){
 		t = b1;
 		b1 = b2;
@@ -34,7 +34,7 @@
 	mpnorm(sum);
 }
 
-// sum = b1 + b2
+/* sum = b1 + b2 */
 void
 mpadd(mpint *b1, mpint *b2, mpint *sum)
 {
diff --git a/src/libmp/port/mpaux.c b/src/libmp/port/mpaux.c
index c395d83..ef94813 100644
--- a/src/libmp/port/mpaux.c
+++ b/src/libmp/port/mpaux.c
@@ -37,7 +37,7 @@
 
 static int mpmindigits = 33;
 
-// set minimum digit allocation
+/* set minimum digit allocation */
 void
 mpsetminbits(int n)
 {
@@ -48,7 +48,7 @@
 	mpmindigits = DIGITS(n);
 }
 
-// allocate an n bit 0'd number 
+/* allocate an n bit 0'd number  */
 mpint*
 mpnew(int n)
 {
@@ -72,7 +72,7 @@
 	return b;
 }
 
-// guarantee at least n significant bits
+/* guarantee at least n significant bits */
 void
 mpbits(mpint *b, int m)
 {
@@ -101,7 +101,7 @@
 		return;
 	if(b->flags & MPstatic)
 		sysfatal("freeing mp constant");
-	memset(b->p, 0, b->size*Dbytes);	// information hiding
+	memset(b->p, 0, b->size*Dbytes);	/* information hiding */
 	free(b->p);
 	free(b);
 }
@@ -140,7 +140,7 @@
 	memmove(new->p, old->p, Dbytes*old->top);
 }
 
-// number of significant bits in mantissa
+/* number of significant bits in mantissa */
 int
 mpsignif(mpint *n)
 {
@@ -159,7 +159,7 @@
 	return 0;
 }
 
-// k, where n = 2**k * q for odd q
+/* k, where n = 2**k * q for odd q */
 int
 mplowbits0(mpint *n)
 {
diff --git a/src/libmp/port/mpcmp.c b/src/libmp/port/mpcmp.c
index a2e3cf7..7447221 100644
--- a/src/libmp/port/mpcmp.c
+++ b/src/libmp/port/mpcmp.c
@@ -2,7 +2,7 @@
 #include <mp.h>
 #include "dat.h"
 
-// return neg, 0, pos as abs(b1)-abs(b2) is neg, 0, pos
+/* return neg, 0, pos as abs(b1)-abs(b2) is neg, 0, pos */
 int
 mpmagcmp(mpint *b1, mpint *b2)
 {
@@ -15,7 +15,7 @@
 	return mpveccmp(b1->p, b1->top, b2->p, b2->top);
 }
 
-// return neg, 0, pos as b1-b2 is neg, 0, pos
+/* return neg, 0, pos as b1-b2 is neg, 0, pos */
 int
 mpcmp(mpint *b1, mpint *b2)
 {
diff --git a/src/libmp/port/mpdigdiv.c b/src/libmp/port/mpdigdiv.c
index 4a73bb3..723127e 100644
--- a/src/libmp/port/mpdigdiv.c
+++ b/src/libmp/port/mpdigdiv.c
@@ -2,9 +2,9 @@
 #include <mp.h>
 #include "dat.h"
 
-//
-//	divide two digits by one and return quotient
-//
+/* */
+/*	divide two digits by one and return quotient */
+/* */
 void
 mpdigdiv(mpdigit *dividend, mpdigit divisor, mpdigit *quotient)
 {
@@ -14,15 +14,15 @@
 	hi = dividend[1];
 	lo = dividend[0];
 
-	// return highest digit value if the result >= 2**32
+	/* return highest digit value if the result >= 2**32 */
 	if(hi >= divisor || divisor == 0){
 		divisor = 0;
 		*quotient = ~divisor;
 		return;
 	}
 
-	// at this point we know that hi < divisor
-	// just shift and subtract till we're done
+	/* at this point we know that hi < divisor */
+	/* just shift and subtract till we're done */
 	q = 0;
 	x = divisor;
 	for(i = Dbits-1; hi > 0 && i >= 0; i--){
diff --git a/src/libmp/port/mpdiv.c b/src/libmp/port/mpdiv.c
index 92aee03..90ab4ba 100644
--- a/src/libmp/port/mpdiv.c
+++ b/src/libmp/port/mpdiv.c
@@ -2,9 +2,9 @@
 #include <mp.h>
 #include "dat.h"
 
-// division ala knuth, seminumerical algorithms, pp 237-238
-// the numbers are stored backwards to what knuth expects so j
-// counts down rather than up.
+/* division ala knuth, seminumerical algorithms, pp 237-238 */
+/* the numbers are stored backwards to what knuth expects so j */
+/* counts down rather than up. */
 
 void
 mpdiv(mpint *dividend, mpint *divisor, mpint *quotient, mpint *remainder)
@@ -13,11 +13,11 @@
 	mpdigit qd, *up, *vp, *qp;
 	mpint *u, *v, *t;
 
-	// divide bv zero
+	/* divide bv zero */
 	if(divisor->top == 0)
 		abort();
 
-	// quick check
+	/* quick check */
 	if(mpmagcmp(dividend, divisor) < 0){
 		if(remainder != nil)
 			mpassign(dividend, remainder);
@@ -26,8 +26,8 @@
 		return;
 	}
 
-	// D1: shift until divisor, v, has hi bit set (needed to make trial
-	//     divisor accurate)
+	/* D1: shift until divisor, v, has hi bit set (needed to make trial */
+	/*     divisor accurate) */
 	qd = divisor->p[divisor->top-1];
 	for(s = 0; (qd & mpdighi) == 0; s++)
 		qd <<= 1;
@@ -44,13 +44,13 @@
 	vp = v->p+v->top-1;
 	vn = v->top;
 
-	// D1a: make sure high digit of dividend is less than high digit of divisor
+	/* D1a: make sure high digit of dividend is less than high digit of divisor */
 	if(*up >= *vp){
 		*++up = 0;
 		u->top++;
 	}
 
-	// storage for multiplies
+	/* storage for multiplies */
 	t = mpnew(4*Dbits);
 
 	qp = nil;
@@ -60,15 +60,15 @@
 		qp = quotient->p+quotient->top-1;
 	}
 
-	// D2, D7: loop on length of dividend
+	/* D2, D7: loop on length of dividend */
 	for(j = u->top; j > vn; j--){
 
-		// D3: calculate trial divisor
+		/* D3: calculate trial divisor */
 		mpdigdiv(up-1, *vp, &qd);
 
-		// D3a: rule out trial divisors 2 greater than real divisor
+		/* D3a: rule out trial divisors 2 greater than real divisor */
 		if(vn > 1) for(;;){
-			memset(t->p, 0, 3*Dbytes);	// mpvecdigmuladd adds to what's there
+			memset(t->p, 0, 3*Dbytes);	/* mpvecdigmuladd adds to what's there */
 			mpvecdigmuladd(vp-1, 2, qd, t->p);
 			if(mpveccmp(t->p, 3, up-2, 3) > 0)
 				qd--;
@@ -76,21 +76,21 @@
 				break;
 		}
 
-		// D4: u -= v*qd << j*Dbits
+		/* D4: u -= v*qd << j*Dbits */
 		sign = mpvecdigmulsub(v->p, vn, qd, up-vn);
 		if(sign < 0){
 
-			// D6: trial divisor was too high, add back borrowed
-			//     value and decrease divisor
+			/* D6: trial divisor was too high, add back borrowed */
+			/*     value and decrease divisor */
 			mpvecadd(up-vn, vn+1, v->p, vn, up-vn);
 			qd--;
 		}
 
-		// D5: save quotient digit
+		/* D5: save quotient digit */
 		if(qp != nil)
 			*qp-- = qd;
 
-		// push top of u down one
+		/* push top of u down one */
 		u->top--;
 		*up-- = 0;
 	}
@@ -101,7 +101,7 @@
 	}
 
 	if(remainder != nil){
-		mpright(u, s, remainder);	// u is the remainder shifted
+		mpright(u, s, remainder);	/* u is the remainder shifted */
 		remainder->sign = dividend->sign;
 	}
 
diff --git a/src/libmp/port/mpeuclid.c b/src/libmp/port/mpeuclid.c
index 80b5983..dda77ea 100644
--- a/src/libmp/port/mpeuclid.c
+++ b/src/libmp/port/mpeuclid.c
@@ -1,12 +1,12 @@
 #include "os.h"
 #include <mp.h>
 
-// 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 @@
 	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;
diff --git a/src/libmp/port/mpexp.c b/src/libmp/port/mpexp.c
index 9ec067c..995ba28 100644
--- a/src/libmp/port/mpexp.c
+++ b/src/libmp/port/mpexp.c
@@ -2,17 +2,17 @@
 #include <mp.h>
 #include "dat.h"
 
-// res = b**e
-//
-// knuth, vol 2, pp 398-400
+/* res = b**e */
+/* */
+/* knuth, vol 2, pp 398-400 */
 
 enum {
 	Freeb=	0x1,
 	Freee=	0x2,
-	Freem=	0x4,
+	Freem=	0x4
 };
 
-//int expdebug;
+/*int expdebug; */
 
 void
 mpexp(mpint *b, mpint *e, mpint *m, mpint *res)
@@ -47,7 +47,7 @@
 		tofree |= Freem;
 	}
 
-	// skip first bit
+	/* skip first bit */
 	i = e->top-1;
 	d = e->p[i];
 	for(bit = mpdighi; (bit & d) == 0; bit >>= 1)
diff --git a/src/libmp/port/mpextendedgcd.c b/src/libmp/port/mpextendedgcd.c
index 413a05c..712db17 100644
--- a/src/libmp/port/mpextendedgcd.c
+++ b/src/libmp/port/mpextendedgcd.c
@@ -3,12 +3,12 @@
 
 #define iseven(a)	(((a)->p[0] & 1) == 0)
 
-// extended binary gcd
-//
-// For a anv b it solves, v = gcd(a,b) and finds x and y s.t.
-// ax + by = v
-//
-// Handbook of Applied Cryptography, Menezes et al, 1997, pg 608.  
+/* extended binary gcd */
+/* */
+/* For a anv b it solves, v = gcd(a,b) and finds x and y s.t. */
+/* ax + by = v */
+/* */
+/* Handbook of Applied Cryptography, Menezes et al, 1997, pg 608.   */
 void
 mpextendedgcd(mpint *a, mpint *b, mpint *v, mpint *x, mpint *y)
 {
@@ -53,7 +53,7 @@
 	D = mpcopy(mpone);
 
 	for(;;) {
-//		print("%B %B %B %B %B %B\n", u, v, A, B, C, D);
+/*		print("%B %B %B %B %B %B\n", u, v, A, B, C, D); */
 		while(iseven(u)){
 			mpright(u, 1, u);
 			if(!iseven(A) || !iseven(B)) {
@@ -64,7 +64,7 @@
 			mpright(B, 1, B);
 		}
 	
-//		print("%B %B %B %B %B %B\n", u, v, A, B, C, D);
+/*		print("%B %B %B %B %B %B\n", u, v, A, B, C, D); */
 		while(iseven(v)){
 			mpright(v, 1, v);
 			if(!iseven(C) || !iseven(D)) {
@@ -75,7 +75,7 @@
 			mpright(D, 1, D);
 		}
 	
-//		print("%B %B %B %B %B %B\n", u, v, A, B, C, D);
+/*		print("%B %B %B %B %B %B\n", u, v, A, B, C, D); */
 		if(mpcmp(u, v) >= 0){
 			mpsub(u, v, u);
 			mpsub(A, C, A);
diff --git a/src/libmp/port/mpfmt.c b/src/libmp/port/mpfmt.c
index 0a1fb81..7e34597 100644
--- a/src/libmp/port/mpfmt.c
+++ b/src/libmp/port/mpfmt.c
@@ -23,7 +23,7 @@
 	uchar *p;
 	int n, rv;
 
-	// leave room for a multiple of 5 buffer size
+	/* leave room for a multiple of 5 buffer size */
 	n = b->top*Dbytes + 5;
 	p = malloc(n);
 	if(p == nil)
@@ -32,7 +32,7 @@
 	if(n < 0)
 		return -1;
 
-	// round up buffer size, enc32 only accepts a multiple of 5
+	/* round up buffer size, enc32 only accepts a multiple of 5 */
 	if(n%5)
 		n += 5 - (n%5);
 	rv = enc32(buf, len, p, n);
diff --git a/src/libmp/port/mpinvert.c b/src/libmp/port/mpinvert.c
index ee26307..451b40f 100644
--- a/src/libmp/port/mpinvert.c
+++ b/src/libmp/port/mpinvert.c
@@ -3,12 +3,12 @@
 
 #define iseven(a)	(((a)->p[0] & 1) == 0)
 
-// use extended gcd to find the multiplicative inverse
-// res = b**-1 mod m
+/* use extended gcd to find the multiplicative inverse */
+/* res = b**-1 mod m */
 void
 mpinvert(mpint *b, mpint *m, mpint *res)
 {
-	mpint *dc1, *dc2;	// don't care
+	mpint *dc1, *dc2;	/* don't care */
 
 	dc1 = mpnew(0);
 	dc2 = mpnew(0);
diff --git a/src/libmp/port/mpleft.c b/src/libmp/port/mpleft.c
index cdcdff7..6da07d2 100644
--- a/src/libmp/port/mpleft.c
+++ b/src/libmp/port/mpleft.c
@@ -2,7 +2,7 @@
 #include <mp.h>
 #include "dat.h"
 
-// res = b << shift
+/* res = b << shift */
 void
 mpleft(mpint *b, int shift, mpint *res)
 {
@@ -15,17 +15,17 @@
 		return;
 	}
 
-	// a negative left shift is a right shift
+	/* a negative left shift is a right shift */
 	if(shift < 0){
 		mpright(b, -shift, res);
 		return;
 	}
 
-	// b and res may be the same so remember the old top
+	/* b and res may be the same so remember the old top */
 	otop = b->top;
 
-	// shift
-	mpbits(res, otop*Dbits + shift);	// overkill
+	/* shift */
+	mpbits(res, otop*Dbits + shift);	/* overkill */
 	res->top = DIGITS(otop*Dbits + shift);
 	d = shift/Dbits;
 	l = shift - d*Dbits;
@@ -46,7 +46,7 @@
 	for(i = 0; i < d; i++)
 		res->p[i] = 0;
 
-	// normalize
+	/* normalize */
 	while(res->top > 0 && res->p[res->top-1] == 0)
 		res->top--;
 }
diff --git a/src/libmp/port/mpmod.c b/src/libmp/port/mpmod.c
index 91bebfa..409dd38 100644
--- a/src/libmp/port/mpmod.c
+++ b/src/libmp/port/mpmod.c
@@ -2,9 +2,9 @@
 #include <mp.h>
 #include "dat.h"
 
-// remainder = b mod m
-//
-// knuth, vol 2, pp 398-400
+/* remainder = b mod m */
+/* */
+/* knuth, vol 2, pp 398-400 */
 
 void
 mpmod(mpint *b, mpint *m, mpint *remainder)
diff --git a/src/libmp/port/mpmul.c b/src/libmp/port/mpmul.c
index dedd474..a6ce9a0 100644
--- a/src/libmp/port/mpmul.c
+++ b/src/libmp/port/mpmul.c
@@ -2,18 +2,18 @@
 #include <mp.h>
 #include "dat.h"
 
-//
-//  from knuth's 1969 seminumberical algorithms, pp 233-235 and pp 258-260
-//
-//  mpvecmul is an assembly language routine that performs the inner
-//  loop.
-//
-//  the karatsuba trade off is set empiricly by measuring the algs on
-//  a 400 MHz Pentium II.
-//
+/* */
+/*  from knuth's 1969 seminumberical algorithms, pp 233-235 and pp 258-260 */
+/* */
+/*  mpvecmul is an assembly language routine that performs the inner */
+/*  loop. */
+/* */
+/*  the karatsuba trade off is set empiricly by measuring the algs on */
+/*  a 400 MHz Pentium II. */
+/* */
 
-// karatsuba like (see knuth pg 258)
-// prereq: p is already zeroed
+/* karatsuba like (see knuth pg 258) */
+/* prereq: p is already zeroed */
 static void
 mpkaratsuba(mpdigit *a, int alen, mpdigit *b, int blen, mpdigit *p)
 {
@@ -21,7 +21,7 @@
 	int u0len, u1len, v0len, v1len, reslen;
 	int sign, n;
 
-	// divide each piece in half
+	/* divide each piece in half */
 	n = alen/2;
 	if(alen&1)
 		n++;
@@ -39,7 +39,7 @@
 	v0 = b;
 	v1 = b + v0len;
 
-	// room for the partial products
+	/* room for the partial products */
 	t = mallocz(Dbytes*5*(2*n+1), 1);
 	if(t == nil)
 		sysfatal("mpkaratsuba: %r");
@@ -49,7 +49,7 @@
 	res = t + 3*(2*n+1);
 	reslen = 4*n+1;
 
-	// t[0] = (u1-u0)
+	/* t[0] = (u1-u0) */
 	sign = 1;
 	if(mpveccmp(u1, u1len, u0, u0len) < 0){
 		sign = -1;
@@ -57,35 +57,35 @@
 	} else
 		mpvecsub(u1, u1len, u0, u1len, u0v0);
 
-	// t[1] = (v0-v1)
+	/* t[1] = (v0-v1) */
 	if(mpveccmp(v0, v0len, v1, v1len) < 0){
 		sign *= -1;
 		mpvecsub(v1, v1len, v0, v1len, u1v1);
 	} else
 		mpvecsub(v0, v0len, v1, v1len, u1v1);
 
-	// t[4:5] = (u1-u0)*(v0-v1)
+	/* t[4:5] = (u1-u0)*(v0-v1) */
 	mpvecmul(u0v0, u0len, u1v1, v0len, diffprod);
 
-	// t[0:1] = u1*v1
+	/* t[0:1] = u1*v1 */
 	memset(t, 0, 2*(2*n+1)*Dbytes);
 	if(v1len > 0)
 		mpvecmul(u1, u1len, v1, v1len, u1v1);
 
-	// t[2:3] = u0v0
+	/* t[2:3] = u0v0 */
 	mpvecmul(u0, u0len, v0, v0len, u0v0);
 
-	// res = u0*v0<<n + u0*v0
+	/* res = u0*v0<<n + u0*v0 */
 	mpvecadd(res, reslen, u0v0, u0len+v0len, res);
 	mpvecadd(res+n, reslen-n, u0v0, u0len+v0len, res+n);
 
-	// res += u1*v1<<n + u1*v1<<2*n
+	/* res += u1*v1<<n + u1*v1<<2*n */
 	if(v1len > 0){
 		mpvecadd(res+n, reslen-n, u1v1, u1len+v1len, res+n);
 		mpvecadd(res+2*n, reslen-2*n, u1v1, u1len+v1len, res+2*n);
 	}
 
-	// res += (u1-u0)*(v0-v1)<<n
+	/* res += (u1-u0)*(v0-v1)<<n */
 	if(sign < 0)
 		mpvecsub(res+n, reslen-n, diffprod, u0len+v0len, res+n);
 	else
@@ -104,7 +104,7 @@
 	mpdigit d;
 	mpdigit *t;
 
-	// both mpvecdigmuladd and karatsuba are fastest when a is the longer vector
+	/* both mpvecdigmuladd and karatsuba are fastest when a is the longer vector */
 	if(alen < blen){
 		i = alen;
 		alen = blen;
@@ -119,10 +119,10 @@
 	}
 
 	if(alen >= KARATSUBAMIN && blen > 1){
-		// O(n^1.585)
+		/* O(n^1.585) */
 		mpkaratsuba(a, alen, b, blen, p);
 	} else {
-		// O(n^2)
+		/* O(n^2) */
 		for(i = 0; i < blen; i++){
 			d = b[i];
 			if(d != 0)
diff --git a/src/libmp/port/mprand.c b/src/libmp/port/mprand.c
index aaf413b..95a01cc 100644
--- a/src/libmp/port/mprand.c
+++ b/src/libmp/port/mprand.c
@@ -22,7 +22,7 @@
 	betomp(p, n*Dbytes, b);
 	free(p);
 
-	// make sure we don't give too many bits
+	/* make sure we don't give too many bits */
 	m = bits%Dbits;
 	n--;
 	if(m > 0){
diff --git a/src/libmp/port/mpright.c b/src/libmp/port/mpright.c
index 0303917..ee661d5 100644
--- a/src/libmp/port/mpright.c
+++ b/src/libmp/port/mpright.c
@@ -2,7 +2,7 @@
 #include <mp.h>
 #include "dat.h"
 
-// res = b >> shift
+/* res = b >> shift */
 void
 mpright(mpint *b, int shift, mpint *res)
 {
@@ -15,7 +15,7 @@
 		return;
 	}
 
-	// a negative right shift is a left shift
+	/* a negative right shift is a left shift */
 	if(shift < 0){
 		mpleft(b, -shift, res);
 		return;
@@ -27,13 +27,13 @@
 	r = shift - d*Dbits;
 	l = Dbits - r;
 
-	//  shift all the bits out == zero
+	/*  shift all the bits out == zero */
 	if(d>=b->top){
 		res->top = 0;
 		return;
 	}
 
-	// special case digit shifts
+	/* special case digit shifts */
 	if(r == 0){
 		for(i = 0; i < b->top-d; i++)
 			res->p[i] = b->p[i+d];
diff --git a/src/libmp/port/mpsub.c b/src/libmp/port/mpsub.c
index 3fe6ca0..7976d3a 100644
--- a/src/libmp/port/mpsub.c
+++ b/src/libmp/port/mpsub.c
@@ -2,14 +2,14 @@
 #include <mp.h>
 #include "dat.h"
 
-// diff = abs(b1) - abs(b2), i.e., subtract the magnitudes
+/* diff = abs(b1) - abs(b2), i.e., subtract the magnitudes */
 void
 mpmagsub(mpint *b1, mpint *b2, mpint *diff)
 {
 	int n, m, sign;
 	mpint *t;
 
-	// get the sizes right
+	/* get the sizes right */
 	if(mpmagcmp(b1, b2) < 0){
 		sign = -1;
 		t = b1;
@@ -32,7 +32,7 @@
 	mpnorm(diff);
 }
 
-// diff = b1 - b2
+/* diff = b1 - b2 */
 void
 mpsub(mpint *b1, mpint *b2, mpint *diff)
 {
diff --git a/src/libmp/port/mptobe.c b/src/libmp/port/mptobe.c
index e08ae56..d49225e 100644
--- a/src/libmp/port/mptobe.c
+++ b/src/libmp/port/mptobe.c
@@ -2,9 +2,9 @@
 #include <mp.h>
 #include "dat.h"
 
-// convert an mpint into a big endian byte array (most significant byte first)
-//   return number of bytes converted
-//   if p == nil, allocate and result array
+/* convert an mpint into a big endian byte array (most significant byte first) */
+/*   return number of bytes converted */
+/*   if p == nil, allocate and result array */
 int
 mptobe(mpint *b, uchar *p, uint n, uchar **pp)
 {
@@ -22,7 +22,7 @@
 		*pp = p;
 	memset(p, 0, n);
 
-	// special case 0
+	/* special case 0 */
 	if(b->top == 0){
 		if(n < 1)
 			return -1;
@@ -46,7 +46,7 @@
 		}
 	}
 
-	// guarantee at least one byte
+	/* guarantee at least one byte */
 	if(s == p){
 		if(p >= e)
 			return -1;
diff --git a/src/libmp/port/mptole.c b/src/libmp/port/mptole.c
index 9421d5f..0b676ef 100644
--- a/src/libmp/port/mptole.c
+++ b/src/libmp/port/mptole.c
@@ -2,10 +2,10 @@
 #include <mp.h>
 #include "dat.h"
 
-// convert an mpint into a little endian byte array (least significant byte first)
+/* convert an mpint into a little endian byte array (least significant byte first) */
 
-//   return number of bytes converted
-//   if p == nil, allocate and result array
+/*   return number of bytes converted */
+/*   if p == nil, allocate and result array */
 int
 mptole(mpint *b, uchar *p, uint n, uchar **pp)
 {
@@ -23,7 +23,7 @@
 		return -1;
 	memset(p, 0, n);
 
-	// special case 0
+	/* special case 0 */
 	if(b->top == 0){
 		if(n < 1)
 			return -1;
diff --git a/src/libmp/port/mpvecadd.c b/src/libmp/port/mpvecadd.c
index 98fdcc9..d0fe174 100644
--- a/src/libmp/port/mpvecadd.c
+++ b/src/libmp/port/mpvecadd.c
@@ -2,7 +2,7 @@
 #include <mp.h>
 #include "dat.h"
 
-// prereq: alen >= blen, sum has at least blen+1 digits
+/* prereq: alen >= blen, sum has at least blen+1 digits */
 void
 mpvecadd(mpdigit *a, int alen, mpdigit *b, int blen, mpdigit *sum)
 {
diff --git a/src/libmp/port/mpvecdigmuladd.c b/src/libmp/port/mpvecdigmuladd.c
index 28d4205..909314f 100644
--- a/src/libmp/port/mpvecdigmuladd.c
+++ b/src/libmp/port/mpvecdigmuladd.c
@@ -11,19 +11,19 @@
 	mpdigit x, ah, al, bh, bl, p1, p2, p3, p4;
 	int carry;
 
-	// half digits
+	/* half digits */
 	ah = HI(a);
 	al = LO(a);
 	bh = HI(b);
 	bl = LO(b);
 
-	// partial products
+	/* partial products */
 	p1 = ah*bl;
 	p2 = bh*al;
 	p3 = bl*al;
 	p4 = ah*bh;
 
-	// p = ((p1+p2)<<(Dbits/2)) + (p4<<Dbits) + p3
+	/* p = ((p1+p2)<<(Dbits/2)) + (p4<<Dbits) + p3 */
 	carry = 0;
 	x = p1<<(Dbits/2);
 	p3 += x;
@@ -33,12 +33,12 @@
 	p3 += x;
 	if(p3 < x)
 		carry++;
-	p4 += carry + HI(p1) + HI(p2);	// can't carry out of the high digit
+	p4 += carry + HI(p1) + HI(p2);	/* can't carry out of the high digit */
 	p[0] = p3;
 	p[1] = p4;
 }
 
-// prereq: p must have room for n+1 digits
+/* prereq: p must have room for n+1 digits */
 void
 mpvecdigmuladd(mpdigit *b, int n, mpdigit m, mpdigit *p)
 {
@@ -66,7 +66,7 @@
 	*p = part[1] + carry;
 }
 
-// prereq: p must have room for n+1 digits
+/* prereq: p must have room for n+1 digits */
 int
 mpvecdigmulsub(mpdigit *b, int n, mpdigit m, mpdigit *p)
 {
diff --git a/src/libmp/port/mpvecsub.c b/src/libmp/port/mpvecsub.c
index db93b65..818d729 100644
--- a/src/libmp/port/mpvecsub.c
+++ b/src/libmp/port/mpvecsub.c
@@ -2,7 +2,7 @@
 #include <mp.h>
 #include "dat.h"
 
-// prereq: a >= b, alen >= blen, diff has at least alen digits
+/* prereq: a >= b, alen >= blen, diff has at least alen digits */
 void
 mpvecsub(mpdigit *a, int alen, mpdigit *b, int blen, mpdigit *diff)
 {
diff --git a/src/libmp/port/strtomp.c b/src/libmp/port/strtomp.c
index e84db79..5dced61 100644
--- a/src/libmp/port/strtomp.c
+++ b/src/libmp/port/strtomp.c
@@ -84,7 +84,7 @@
 
 	b->top = 0;
 	for(;;){
-		// do a billion at a time in native arithmetic
+		/* do a billion at a time in native arithmetic */
 		x = 0;
 		for(i = 0; i < 9; i++){
 			y = tab.t10[*(uchar*)a];
@@ -97,7 +97,7 @@
 		if(i == 0)
 			break;
 
-		// accumulate into mpint
+		/* accumulate into mpint */
 		uitomp(mppow10[i], pow);
 		uitomp(x, r);
 		mpmul(b, pow, b);
@@ -191,7 +191,7 @@
 		break;
 	}
 
-	// if no characters parsed, there wasn't a number to convert
+	/* if no characters parsed, there wasn't a number to convert */
 	if(e == a)
 		return nil;