blob: 38830fba9a27569138a986bd36b48605be549124 [file] [log] [blame]
Alexandre Lision7fd5d3d2013-12-04 13:06:40 -05001#ifndef BNPRINT_H
2#define BNPRINT_H
3
4#include <stdio.h>
5
6#ifdef __cplusplus
7extern "C"
8{
9#endif
10
11struct BigNum;
12
Alexandre Lision7fd5d3d2013-12-04 13:06:40 -050013int bnPrint(FILE *f, char const *prefix, struct BigNum const *bn,
14 char const *suffix);
Alexandre Lision7fd5d3d2013-12-04 13:06:40 -050015
16/**
Alexandre Lisionddd731e2014-01-31 11:50:08 -050017 * Convert and ASCII string into a BigNum.
Alexandre Lision7fd5d3d2013-12-04 13:06:40 -050018 *
19 * This function converts an ASCII string into a Big number. If the first
20 * character of the string is a minus sign the big number is a negative number.
21 *
22 * @param X the BigNum that stores the result
23 *
24 * @param s the ASCII string in big-endian format (first digit is most significant)
25 *
26 * @param radix the function can use radix between 2 and 16
27 */
28int bnReadAscii(struct BigNum *X, char *s, int radix);
29#ifdef __cplusplus
30}
31#endif
32
33#endif /* BNPRINT_H */