MPyC: Multiparty Computation in Python
Major technical improvements:
Command Line Interface:
--no-uvloop
to disable load and use of uvloop (winloop) package.More technical changes:
integral
attribute for more secure Numpy array functions.gmpy2.prev_prime()
.mpyc.asyncoro
:
mpyc.runtime
,SecureObject
from mpyc.sectypes
,SharesCounter
to SharesTallier
.mpc.run()
in demos, easier for use with PyScript.monic()
, reverse()
.mpyc.mpctools.accumulate()
.Many thanks to Marc Damie, Emil Nikolov, and Stan Korzilius and for their collaboration and contributions.
Corresponds to package mpyc 0.10 on PyPI.
This should be the last MPyC release supporting Python 3.9 and NumPy 1.23, following SPEC 0 — Minimum Supported Dependencies.
Many new types/functions/methods to support a substantial part of the NumPy array API.
Along with vectorized implementations of the corresponding protocols.
New mpyc.numpy
module as stub to avoid a (hard) dependency for the numpy package.
New demos -- try all with np-run-all.{bat,sh}
:
pseudoinverse.py
implementing the Moore-Penrose pseudoinverse.sha3.py
for threshold SHA-3 hash functions.np_bnnmnist.py
, np_cnnmnist.py
, np_id3gini.py
, np_aes.py
, np_onewayhashchains.py
, np_lpsolver.py
, np_lpsolverfxp.py
reimplement existing demos with 2-fold to 18-fold speedups.Command Line Interface:
-V
option for MPyC version.--log-level ll
with ll=debug/info(default)/warning/error.--output-windows
on Linux/Mac.-W w, --workers w
to set number of worker threads per party (experimental, see below).--no-numpy
to disable load and use of numpy package.--mix32-64bit
also disable use of pickle
for exchanging NumPy arrays.bytes_sent
by party (in debug mode: per destination party as well)More technical changes:
gmpy2
's new function powmod_base_list()
.ssl
to avoid dependency for PyScript.Docs:
sphinx-argparse
).Corresponds to package mpyc 0.9 on PyPI.
This should be the last MPyC release supporting Python 3.8 and NumPy 1.21, following NumPy's deprecation policy.
New modules:
mpyc.fingroups
for finite groups (symmetric groups, quadratic residues, Schnorr groups, elliptic curves, class groups).mpyc.secgroups
for secure versions of finite groups by using mpc.SecGrp()
.mpyc.__main__
for async REPL with top-level await
and MPyC preloaded by using python -m mpyc
.New types/functions/methods:
mpyc.sectypes.SecureFloat
for secure floating-point numbers by using mpc.SecFlt()
.mpc.gcd()
, mpc.gcdext()
, mpc.inverse()
for secure (extended) gcd and modular inverse.mpyc.statistics
module extended with secure quantiles()
, covariance()
, correlation()
, linear_regression()
.mpc.find()
as secure generic search for first occurrence in a list.mpyc.gmpy
module extended with ratrec()
and stubs for gmpy2
functions gcdext()
, jacobi()
, kronecker()
.mpc.if_swap()
as convenience function for secure (oblivious) conditional swap, slightly more efficient than using mpc.if_else()
.New demos:
multilateration.py
for privacy-preserving multilateration (MLAT), building on ridgeregression.py
demo.elgamal.py
for threshold ElGamal built from MPyC (secure) finite groups.dsa.py
for threshold DSA and Schnorr signatures, reusing distributed key generation from elgamal.py
.Technical changes:
--no-prss
for disabling PRSS (e.g., demos {helloworld,oneliners,ot,unanimous,parallelsort}.py
do not use PRSS).--mix32-64bit
(and environment variable MPYC_MIX32_64BIT
) for 32-bit/64-bit compatibility mode (e.g., to mix with MPyC parties running on a 32-bit Raspberry Pi OS).helloworld.py
).pyOpenSSL
only via cryptography
package for generating X.509 certificates, also upgrading incl. dummy .crt
files from version 1 to 3..readthedocs.yaml
and check if environment variable READTHEDOCS=True
for generating Sphinx-based documentation on Read the Docs (including an overview of the MPyC demos)..gitattributes
for platform-dependent line endings in .bat
and .sh
files.Many thanks to Niek Bouman, Stan Korzilius, Daniel Moser, Toon Segers, Meilof Veeningen, and Thijs Veugen for (continuous) collaboration.
Corresponds to package mpyc 0.8 on PyPI.
This will be the last release of MPyC supporting Python 3.6 and Python 3.7. As of December 23, 2021 Python 3.6 has reached end-of-life (see Python Developer’s Guide), and Numpy dropped support for Python 3.7 on December 26, 2021 (see [NumPy version support]*https://numpy.org/neps/nep-0029-deprecation_policy.html)). Also PyPy is expected to fully support Python 3.8 in the course of 2022 (see PyPy - Features).
New methods, mostly for mpyc.runtime.Runtime
alias mpc
:
mpc.sorted()
, mpyc.seclist.sort()
, using __lt__()
as fundamental comparison operator, just as in Python.mpc.argmin/argmax()
methods.mpc.all/any()
, for any iterable like mpc.min/max/sum/prod()
now do as well.mpc.transfer()
for public communication of pickable objects, including objects with (dynamic) MPyC types.Demos:
unanimous.py
for unanimous voting (generalized matchmaking) between t+1 voters and t extra parties for maximal privacy.lpsolver(fxp).py
demos now have .csv
datasets nicely rendered on GitHub, with objective function as "header" row.mpc.transfer()
in demos helloworld.py
, parallelsort.py
, bnnmnist.py
, cnnmnist.py
, and ridgeregresssion.py
.Technical changes:
b = mpc.output(a)
, e.g., a
of type SecFxp
to b
of type float
(set flag raw
to override).mpyc.sectypes
(NB: base class SecureObject
instead of Share
with slot share
instead of df
).--no-gmpy2
command line option.mpc.to_bits()
and mpc.convert()
.'Task was destroyed but it is pending!'
messages.Many thanks to @b-kamphorst, @niekbouman, @skorzili, @ThomasTNO, and @toonsegers for their recent contributions.
Corresponds to package mpyc 0.7 on PyPI.
Added five new modules:
mpyc.gfpx
(replaces mpyc.gf2x
) for polynomial arithmetic over arbitrary prime fields.mpyc.finfields
(replaces mpyc.bfield
and mpyc.pfield
) to support arbitrary extension fields next to binary fields and prime fields.mpyc.mpctools
for reduce and accumulate with log round complexity.mpyc.statistics
modelled after Python's statistics module.mpyc.seclists
for secure lists with oblivious access and updates.Also added rudimentary secure conversions (between secure int/fxp/fld), support for async with
MPyC runtime, secure unit vectors, secure abs, pos, and efficient min&max. Plus technical enhancements throughout, e.g., now supporting up to 256 parties, and some secure fixed-point arithmetic enhancements.
Added four new demos:
kmsurvival.py
for secure Kaplan-Meier survival analysis plus notebook KaplanMeierSurvivalExplained.ipynb
.ridgeregression.py
for secure ridge regression (and linear regression).helloworld.py
as "do nothing" demo, but with explanation how to run with up to 256 parties on Linux and Windows.oneliners.py
couple of nice MPyC oneliners.Also extended explanation in OT and ID3 decision tree demos.
Other changes:
Corresponds to package mpyc 0.6 on PyPI.
Added secure binary fields (module mpyc.bfield
) and binary polynomials (module mpyc.gf2x
).
New module mpyc.random
with various secure distributions, mimicking Python's random
module.
Revised core modules, dynamic PRSS setup (no static keys anymore), program counter as tuple.
Added if_else()
for efficient oblivious selection.
General integer division (//
, %
, divmod()
) with public divisor for secure ints and fxps.
Codestyle: pycodestyle, pylint.
New demos: AES and one-way hash chains, binarized neural network for MNIST.
Use of top-level await
in Jupyter notebooks.
Enhanced command-line interface, with simplified Windows batch files and Unix shell scripts.
Corresponds to package mpyc 0.5 on PyPI.
Major changes involve exact/integer division, SecFxp
.
SSL support added. Streamlined command line arguments (-H
help added).
Handling input()
, output()
enhanced.
Switched from n-party to m-party for true multiparty computation;)
Corresponds to package mpyc 0.4 on PyPI.
First public version (alpha) including several demos.
Corresponds to package mpyc 0.3 on PyPI.