xref: /illumos-gate/usr/src/lib/libmp/common/old_mp.c (revision 89b2a9fbeabf42fa54594df0e5927bcc50a07cc9)
1 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
2 /*	  All Rights Reserved  	*/
3 
4 
5 /*
6  * Copyright (c) 1980 Regents of the University of California.
7  * All rights reserved.  The Berkeley software License Agreement
8  * specifies the terms and conditions for redistribution.
9  */
10 /* 	Portions Copyright(c) 1996, Sun Microsystems Inc.	*/
11 /*	All Rights Reserved					*/
12 
13 /*
14  * Copyright (c) 1997, by Sun Microsystems, Inc.
15  * All rights reserved.
16  */
17 
18 /* fix for bugid 1240660 redefine old libmp interfaces to go to the new */
19 /* mp_*() interfaces */
20 
21 #ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.1	*/
22 
23 /* LINTLIBRARY */
24 
25 #include <mp.h>
26 #include <sys/types.h>
27 #include "libmp.h"
28 
29 void gcd(MINT *a, MINT *b, MINT *c) { mp_gcd(a, b, c); }
30 
31 void madd(MINT *a, MINT *b, MINT *c) { mp_madd(a, b, c); }
32 
33 void msub(MINT *a, MINT *b, MINT *c) { mp_msub(a, b, c); }
34 
35 void mdiv(MINT *a, MINT *b, MINT *q, MINT *r) { mp_mdiv(a, b, q, r); }
36 
37 void sdiv(MINT *a, short n, MINT *q, short *r) { mp_sdiv(a, n, q, r); }
38 
39 int min(MINT *a) { return (mp_min(a)); }
40 
41 void mout(MINT *a) { mp_mout(a); }
42 
43 int msqrt(MINT *a, MINT *b, MINT *r) { return (mp_msqrt(a, b, r)); }
44 
45 void mult(MINT *a, MINT *b, MINT *c) { mp_mult(a, b, c); }
46 
47 void pow(MINT *a, MINT *b, MINT *c, MINT *d) { mp_pow(a, b, c, d); }
48 
49 void rpow(MINT *a, short n, MINT *b) { mp_rpow(a, n, b); }
50 
51 MINT *itom(short n) { return (mp_itom(n)); }
52 
53 int mcmp(MINT *a, MINT *b) { return (mp_mcmp(a, b)); }
54 
55 MINT *xtom(char *key) { return (mp_xtom(key)); }
56 
57 char *mtox(MINT *key) { return (mp_mtox(key)); }
58 
59 void mfree(MINT *a) { mp_mfree(a); }
60 
61 /* VARARGS */
62 short *xalloc(int nint, char *s) { return (_mp_xalloc(nint, s)); }
63 
64 void xfree(MINT *c) { _mp_xfree(c); }
65