diff options
Diffstat (limited to 'mpi-patches/add-mpi-toradix-with-case')
-rw-r--r-- | mpi-patches/add-mpi-toradix-with-case | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/mpi-patches/add-mpi-toradix-with-case b/mpi-patches/add-mpi-toradix-with-case new file mode 100644 index 00000000..6fe9c191 --- /dev/null +++ b/mpi-patches/add-mpi-toradix-with-case @@ -0,0 +1,54 @@ +Index: mpi-1.8.6/mpi.c +=================================================================== +--- mpi-1.8.6.orig/mpi.c 2011-12-09 19:16:58.000000000 -0800 ++++ mpi-1.8.6/mpi.c 2011-12-09 19:19:23.000000000 -0800 +@@ -2624,9 +2624,9 @@ + + /* }}} */ + +-/* {{{ mp_toradix(mp, str, radix) */ ++/* {{{ mp_toradix_case(mp, str, radix, low) */ + +-mp_err mp_toradix(mp_int *mp, unsigned char *str, int radix) ++mp_err mp_toradix_case(mp_int *mp, unsigned char *str, int radix, int low) + { + int ix, pos = 0; + +@@ -2657,7 +2657,7 @@ + } + + /* Generate digits, use capital letters */ +- ch = s_mp_todigit(rem, radix, 0); ++ ch = s_mp_todigit(rem, radix, low); + + str[pos++] = ch; + } +@@ -2685,10 +2685,15 @@ + + return MP_OKAY; + +-} /* end mp_toradix() */ ++} /* end mp_toradix_case() */ + + /* }}} */ + ++mp_err mp_toradix(mp_int *mp, unsigned char *str, int radix) ++{ ++ return mp_toradix_case(mp, str, radix, 0); ++} ++ + /* {{{ mp_char2value(ch, r) */ + + int mp_char2value(char ch, int r) +Index: mpi-1.8.6/mpi.h +=================================================================== +--- mpi-1.8.6.orig/mpi.h 2011-12-09 19:16:58.000000000 -0800 ++++ mpi-1.8.6/mpi.h 2011-12-09 19:28:38.000000000 -0800 +@@ -213,6 +213,7 @@ + int mp_radix_size(mp_int *mp, int radix); + int mp_value_radix_size(int num, int qty, int radix); + mp_err mp_toradix(mp_int *mp, unsigned char *str, int radix); ++mp_err mp_toradix_case(mp_int *mp, unsigned char *str, int radix, int low); + + int mp_char2value(char ch, int r); + |