security/nss/lib/freebl/mpi/tests/mptest-1.c

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:38b45cdad846
1 /*
2 * Simple test driver for MPI library
3 *
4 * Test 1: Simple input test (drives single-digit multiply and add,
5 * as well as I/O routines)
6 *
7 * This Source Code Form is subject to the terms of the Mozilla Public
8 * License, v. 2.0. If a copy of the MPL was not distributed with this
9 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
10
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <string.h>
14 #include <ctype.h>
15 #include <limits.h>
16
17 #ifdef MAC_CW_SIOUX
18 #include <console.h>
19 #endif
20
21 #include "mpi.h"
22
23 int main(int argc, char *argv[])
24 {
25 int ix;
26 mp_int mp;
27
28 #ifdef MAC_CW_SIOUX
29 argc = ccommand(&argv);
30 #endif
31
32 mp_init(&mp);
33
34 for(ix = 1; ix < argc; ix++) {
35 mp_read_radix(&mp, argv[ix], 10);
36 mp_print(&mp, stdout);
37 fputc('\n', stdout);
38 }
39
40 mp_clear(&mp);
41 return 0;
42 }

mercurial