aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPavol Žáčik <[email protected]>2019-12-02 15:08:15 +0100
committerPavol Žáčik <[email protected]>2019-12-02 19:29:25 +0100
commit805880b45096ed8b8ff4644eb908951b5d43a45d (patch)
tree9fd7d5df04ab88231dc2c25b6cd64a520fda24d0 /doc
parentdfaf450b38be59e36e4051223e525a6ea90f3fb6 (diff)
Add docs for added Python MPI functions
Diffstat (limited to 'doc')
-rw-r--r--doc/api_ref/python.rst15
1 files changed, 13 insertions, 2 deletions
diff --git a/doc/api_ref/python.rst b/doc/api_ref/python.rst
index 80c1ca89d..1fda54193 100644
--- a/doc/api_ref/python.rst
+++ b/doc/api_ref/python.rst
@@ -474,17 +474,19 @@ Multiple Precision Integers (MPI)
-------------------------------------
.. versionadded:: 2.8.0
-.. py:class:: MPI(initial_value=None)
+.. py:class:: MPI(initial_value=None, radix=None)
Initialize an MPI object with specified value, left as zero otherwise. The
``initial_value`` should be an ``int``, ``str``, or ``MPI``.
+ The ``radix`` value should be set to 16 when initializing from a base 16 `str` value.
+
Most of the usual arithmetic operators (``__add__``, ``__mul__``, etc) are
defined.
.. py:method:: inverse_mod(modulus)
- Return the inverse of ``self`` modulo modulus, or zero if no inverse exists
+ Return the inverse of ``self`` modulo ``modulus``, or zero if no inverse exists
.. py:method:: is_prime(rng, prob=128)
@@ -494,6 +496,15 @@ Multiple Precision Integers (MPI)
Return ``self`` to the ``exponent`` power modulo ``modulus``
+ .. py:method:: mod_mul(other, modulus):
+
+ Return the multiplication product of ``self`` and ``other`` modulo ``modulus``
+
+ .. py:method:: gcd(other):
+
+ Return the greatest common divisor of ``self`` and ``other``
+
+
Format Preserving Encryption (FE1 scheme)
-----------------------------------------
.. versionadded:: 2.8.0