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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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/. */
    11 #include <stdio.h>
    12 #include <stdlib.h>
    13 #include <string.h>
    14 #include <ctype.h>
    15 #include <limits.h>
    17 #ifdef MAC_CW_SIOUX
    18 #include <console.h>
    19 #endif
    21 #include "mpi.h"
    23 int main(int argc, char *argv[])
    24 {
    25   int    ix;
    26   mp_int mp;
    28 #ifdef MAC_CW_SIOUX
    29   argc = ccommand(&argv);
    30 #endif
    32   mp_init(&mp);
    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   }
    40   mp_clear(&mp);
    41   return 0;
    42 }

mercurial