diff options
-rw-r--r-- | mpi-patches/mpi-set-mpi-word | 32 | ||||
-rw-r--r-- | mpi-patches/series | 1 |
2 files changed, 33 insertions, 0 deletions
diff --git a/mpi-patches/mpi-set-mpi-word b/mpi-patches/mpi-set-mpi-word new file mode 100644 index 00000000..acd37285 --- /dev/null +++ b/mpi-patches/mpi-set-mpi-word @@ -0,0 +1,32 @@ +Index: mpi-1.8.6/mpi.c +=================================================================== +--- mpi-1.8.6.orig/mpi.c 2011-12-10 17:41:38.000000000 -0800 ++++ mpi-1.8.6/mpi.c 2011-12-10 17:44:35.000000000 -0800 +@@ -573,6 +573,15 @@ + return MP_OKAY; + } + ++mp_err mp_set_word(mp_int *mp, mp_word w, int sign) ++{ ++ USED(mp) = 2; ++ DIGIT(mp, 0) = w & MP_DIGIT_MAX; ++ DIGIT(mp, 1) = w & MP_DIGIT_MAX; ++ SIGN(mp) = sign; ++ return MP_OK; ++} ++ + /*------------------------------------------------------------------------*/ + /* {{{ Digit arithmetic */ + +Index: mpi-1.8.6/mpi.h +=================================================================== +--- mpi-1.8.6.orig/mpi.h 2011-12-10 17:41:38.000000000 -0800 ++++ mpi-1.8.6/mpi.h 2011-12-10 17:43:56.000000000 -0800 +@@ -100,6 +100,7 @@ + mp_err mp_set_int(mp_int *mp, long z); + mp_err mp_set_intptr(mp_int *mp, int_ptr_t z); + mp_err mp_get_intptr(mp_int *mp, int_ptr_t *z); ++mp_err mp_set_word(mp_int *mp, mp_word w, int sign); + + /*------------------------------------------------------------------------*/ + /* Single digit arithmetic */ diff --git a/mpi-patches/series b/mpi-patches/series index 71aa73ba..66a58288 100644 --- a/mpi-patches/series +++ b/mpi-patches/series @@ -6,3 +6,4 @@ export-mp-eq add-mp-hash add-mpi-toradix-with-case fix-mult-bug +mpi-set-mpi-word |