diff options
author | ed <ed@FreeBSD.org> | 2009-02-26 21:43:15 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-02-26 21:43:15 +0000 |
commit | fa4082de198dcb08fb0798fdf991d3c880c765e3 (patch) | |
tree | 5b0afd074d7bb26b1e443eb2abbda20979f70b42 /usr.bin | |
parent | bb22735cfd8d9750d7d63bbe7a69bb5e7f68060c (diff) | |
download | FreeBSD-src-fa4082de198dcb08fb0798fdf991d3c880c765e3.zip FreeBSD-src-fa4082de198dcb08fb0798fdf991d3c880c765e3.tar.gz |
Rename all symbols in libmp(3) to mp_*, just like Solaris.
The function pow() in libmp(3) clashes with pow(3) in libm. We could
rename this single function, but we can just take the same approach as
the Solaris folks did, which is to prefix all function names with mp_.
libmp(3) isn't really popular nowadays. I suspect not a single
application in ports depends on it. There's still a chance, so I've
increased the SHLIB_MAJOR and __FreeBSD_version.
Reviewed by: deischen, rdivacky
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/chkey/Makefile | 2 | ||||
-rw-r--r-- | usr.bin/newkey/Makefile | 2 | ||||
-rw-r--r-- | usr.bin/newkey/generic.c | 40 |
3 files changed, 24 insertions, 20 deletions
diff --git a/usr.bin/chkey/Makefile b/usr.bin/chkey/Makefile index 847e5c9..2813ca1 100644 --- a/usr.bin/chkey/Makefile +++ b/usr.bin/chkey/Makefile @@ -13,4 +13,6 @@ CFLAGS+= -DYP DPADD= ${LIBRPCSVC} ${LIBMP} ${LIBCRYPTO} LDADD= -lrpcsvc -lmp -lcrypto +WARNS?= 6 + .include <bsd.prog.mk> diff --git a/usr.bin/newkey/Makefile b/usr.bin/newkey/Makefile index b3b5b51..1460f87 100644 --- a/usr.bin/newkey/Makefile +++ b/usr.bin/newkey/Makefile @@ -11,4 +11,6 @@ MAN= newkey.8 DPADD= ${LIBRPCSVC} ${LIBMP} ${LIBCRYPTO} LDADD= -lrpcsvc -lmp -lcrypto +WARNS?= 6 + .include <bsd.prog.mk> diff --git a/usr.bin/newkey/generic.c b/usr.bin/newkey/generic.c index 3572df9..3626960 100644 --- a/usr.bin/newkey/generic.c +++ b/usr.bin/newkey/generic.c @@ -79,12 +79,12 @@ genkeys(char *public, char *secret, char *pass) # define BASEBITS (8*sizeof (short) - 1) # define BASE (1 << BASEBITS) - MINT *pk = itom(0); - MINT *sk = itom(0); + MINT *pk = mp_itom(0); + MINT *sk = mp_itom(0); MINT *tmp; - MINT *base = itom(BASE); - MINT *root = itom(PROOT); - MINT *modulus = xtom(HEXMODULUS); + MINT *base = mp_itom(BASE); + MINT *root = mp_itom(PROOT); + MINT *modulus = mp_xtom(HEXMODULUS); short r; unsigned short seed[KEYSIZE/BASEBITS + 1]; char *xkey; @@ -92,24 +92,24 @@ genkeys(char *public, char *secret, char *pass) getseed((char *)seed, sizeof (seed), (u_char *)pass); for (i = 0; i < KEYSIZE/BASEBITS + 1; i++) { r = seed[i] % BASE; - tmp = itom(r); - mult(sk, base, sk); - madd(sk, tmp, sk); - mfree(tmp); + tmp = mp_itom(r); + mp_mult(sk, base, sk); + mp_madd(sk, tmp, sk); + mp_mfree(tmp); } - tmp = itom(0); - mdiv(sk, modulus, tmp, sk); - mfree(tmp); - pow(root, sk, modulus, pk); - xkey = mtox(sk); + tmp = mp_itom(0); + mp_mdiv(sk, modulus, tmp, sk); + mp_mfree(tmp); + mp_pow(root, sk, modulus, pk); + xkey = mp_mtox(sk); adjust(secret, xkey); - xkey = mtox(pk); + xkey = mp_mtox(pk); adjust(public, xkey); - mfree(sk); - mfree(base); - mfree(pk); - mfree(root); - mfree(modulus); + mp_mfree(sk); + mp_mfree(base); + mp_mfree(pk); + mp_mfree(root); + mp_mfree(modulus); } /* |