Releases: lschoe/mpyc
Eighth major update
Major technical improvements:
- New module
mpyc.secpolsfor secure polynomials (secret coefficients and secret degree), currently over prime fields. - New demo
np_kmsurvival.py(as vectorized version ofkmsurvival.pydemo). - New demo and Jupyter notebook
PrefixOrExplained.{py,ipynb}explaining implementation ofmpyc.mpctools.accumulate(). - Support for (secure) hyperelliptic curves in
mpyc.fingroupsandmpyc.secgroups, also see updated demosdsa.pyandelgamal.py. - Continued development for secure Numpy arrays and vectorized implementations.
More technical changes:
- Introduce
mpc.peek()for "informational" purposes. Insert calls to this method pretty much anywhere in your code to inspect values of secure (secret-shared) objects. - Load balancing
mpc._reshare()for case$m>2t+1$ . - Support
ssl.VERIFY_X509_STRICTas Python 3.13+ sets this flag for default SSL contexts. We set AKI (AuthorityKeyIdentifier), SKI (SubjectKeyIdentifier), andKeyUsagefor (self-signed) certificates. See also python/cpython/issues/107361. - Migrate from
setup.pytopyproject.html. - Lots of other enhancements.
Many thanks to Noah van der Meer and Toon Segers for their collaboration and contributions.
Corresponds to package mpyc 0.11 on PyPI.
This should be the last MPyC release supporting Python 3.10 and NumPy 1.24-25, following SPEC 0 — Minimum Supported Dependencies.
Seventh major update
Major technical improvements:
- Completed support of all MPC functionality when PRSS is disabled.
- Continued development for secure Numpy arrays and vectorized implementations.
- Facilitate uvloop on Linux/Mac and its counterpart Winloop on Windows as alt event loops for (potentially) better performance.
- Secure fixed-point sine and cosine.
Command Line Interface:
- Add
--no-uvloopto disable load and use of uvloop (winloop) package.
More technical changes:
- Numpy 2.0 ready.
- Handle
integralattribute for more secure Numpy array functions. - Use primes just below powers of 2 for finite fields using
gmpy2.prev_prime(). - Refactor
mpyc.asyncoro:- moved PRSS details to
mpyc.runtime, - moved base class
SecureObjectfrommpyc.sectypes, - renamed
SharesCountertoSharesTallier.
- moved PRSS details to
- Demote use of
mpc.run()in demos, easier for use with PyScript. - Optimize doubling Edwards extended coordinates.
- Some SageMath-style methods for GFpX polynomials, e.g.,
monic(),reverse(). - Enhance
mpyc.mpctools.accumulate(). - Lots of smaller enhancements.
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.
Sixth major update: secure NumPy arrays
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.pyimplementing the Moore-Penrose pseudoinverse.sha3.pyfor 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.pyreimplement existing demos with 2-fold to 18-fold speedups.
Command Line Interface:
- Add
-Voption for MPyC version. - Add option
--log-level llwith ll=debug/info(default)/warning/error. - Support for
--output-windowson Linux/Mac. - Add
-W w, --workers wto set number of worker threads per party (experimental, see below). - Add
--no-numpyto disable load and use of numpy package. - Let
--mix32-64bitalso disable use ofpicklefor exchanging NumPy arrays. - Report
bytes_sentby party (in debug mode: per destination party as well)
More technical changes:
- Secure prime fields for any number of parties using subfields if order
$p$ does not exceed number of parties$m$ . - Vectorized modular exponentiation (experimental) using
gmpy2's new functionpowmod_base_list(). - Move import
sslto avoid dependency for PyScript. - Part of runtime setup moved to init module.
- And lots of smaller things.
Docs:
- Add "MPyC basics"
- Add "Hacking MPyC"
- Add MPyC command line documentation (using
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.
Fifth major update
New modules:
mpyc.fingroupsfor finite groups (symmetric groups, quadratic residues, Schnorr groups, elliptic curves, class groups).mpyc.secgroupsfor secure versions of finite groups by usingmpc.SecGrp().mpyc.__main__for async REPL with top-levelawaitand MPyC preloaded by usingpython -m mpyc.
New types/functions/methods:
mpyc.sectypes.SecureFloatfor secure floating-point numbers by usingmpc.SecFlt().mpc.gcd(),mpc.gcdext(),mpc.inverse()for secure (extended) gcd and modular inverse.mpyc.statisticsmodule extended with securequantiles(),covariance(),correlation(),linear_regression().mpc.find()as secure generic search for first occurrence in a list.mpyc.gmpymodule extended withratrec()and stubs forgmpy2functionsgcdext(),jacobi(),kronecker().mpc.if_swap()as convenience function for secure (oblivious) conditional swap, slightly more efficient than usingmpc.if_else().
New demos:
multilateration.pyfor privacy-preserving multilateration (MLAT), building onridgeregression.pydemo.elgamal.pyfor threshold ElGamal built from MPyC (secure) finite groups.dsa.pyfor threshold DSA and Schnorr signatures, reusing distributed key generation fromelgamal.py.
Technical changes:
- Command line option
--no-prssfor disabling PRSS (e.g., demos{helloworld,oneliners,ot,unanimous,parallelsort}.pydo not use PRSS). - Command line option
--mix32-64bit(and environment variableMPYC_MIX32_64BIT) for 32-bit/64-bit compatibility mode (e.g., to mix with MPyC parties running on a 32-bit Raspberry Pi OS). - Drop limitation to m=256 parties (see, e.g., demo
helloworld.py). - Use
pyOpenSSLonly viacryptographypackage for generating X.509 certificates, also upgrading incl. dummy.crtfiles from version 1 to 3. - Toward favoring hashable over mutable for finite fields.
- Add Read the Docs badge,
.readthedocs.yamland check if environment variableREADTHEDOCS=Truefor generating Sphinx-based documentation on Read the Docs (including an overview of the MPyC demos). - Add
.gitattributesfor platform-dependent line endings in.batand.shfiles. - And other things.
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).
Fourth major update
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 likempc.min/max/sum/prod()now do as well.mpc.transfer()for public communication of pickable objects, including objects with (dynamic) MPyC types.
Demos:
- New
unanimous.pyfor unanimous voting (generalized matchmaking) between t+1 voters and t extra parties for maximal privacy. - Revamped
lpsolver(fxp).pydemos now have.csvdatasets nicely rendered on GitHub, with objective function as "header" row. - Prettify MNIST digit printing on console.
- Use
mpc.transfer()in demoshelloworld.py,parallelsort.py,bnnmnist.py,cnnmnist.py, andridgeregresssion.py.
Technical changes:
- Automatic type conversion for
b = mpc.output(a), e.g.,aof typeSecFxptobof typefloat(set flagrawto override). - New SecureObject hierarchy in
mpyc.sectypes(NB: base classSecureObjectinstead ofSharewith slotshareinstead ofdf). - Hopping program counter of constant size (8 bytes on 64-bit Python, 4 bytes on 32-bit Python).
- Use of gmpy2 is now optional via the
--no-gmpy2command line option. - Enhancements to
mpc.to_bits()andmpc.convert(). - Add exception handling for MPyC coroutines, e.g., suppressing spurious
'Task was destroyed but it is pending!'messages. - Plus lots of other things.
Many thanks to @b-kamphorst, @niekbouman, @skorzili, @ThomasTNO, and @toonsegers for their recent contributions.
Corresponds to package mpyc 0.7 on PyPI.
Third major update
Added five new modules:
mpyc.gfpx(replacesmpyc.gf2x) for polynomial arithmetic over arbitrary prime fields.mpyc.finfields(replacesmpyc.bfieldandmpyc.pfield) to support arbitrary extension fields next to binary fields and prime fields.mpyc.mpctoolsfor reduce and accumulate with log round complexity.mpyc.statisticsmodelled after Python's statistics module.mpyc.seclistsfor 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.pyfor secure Kaplan-Meier survival analysis plus notebookKaplanMeierSurvivalExplained.ipynb.ridgeregression.pyfor secure ridge regression (and linear regression).helloworld.pyas "do nothing" demo, but with explanation how to run with up to 256 parties on Linux and Windows.oneliners.pycouple of nice MPyC oneliners.
Also extended explanation in OT and ID3 decision tree demos.
Other changes:
- Change from Apache 2.0 to MIT license.
- Ensure pypy compatibility.
- Create .travis.yml workflow, including test coverage.
- Add "launch binder" badge, Travis CI badge, codecov badge, and PyPI badge.
- Enable docs via https://lschoe.github.io/mpyc.
- Added MPyC logo in SVG and LaTeX-tikz.
- Add basic Linux scripts for docs, tests.
- Most data files are now in GitHub friendly csv.
Corresponds to package mpyc 0.6 on PyPI.
Second major update
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.
First major update
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
First public version (alpha) including several demos.
Corresponds to package mpyc 0.3 on PyPI.