Mpyc

Latest version: v0.10

Safety actively analyzes 621776 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.9

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:
* Add `-V` option for MPyC version.
* Add option `--log-level ll` with ll=debug/info(default)/warning/error.
* Support for `--output-windows` on Linux/Mac.
* Add `-W w, --workers w` to set number of worker threads per party (experimental, see below).
* Add `--no-numpy` to disable load and use of numpy package.
* Let `--mix32-64bit` also disable use of `pickle` for exchanging NumPy arrays.
* Report `bytes_sent` by 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 function `powmod_base_list()`.
* Move import `ssl` to 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](https://numpy.org/neps/nep-0029-deprecation_policy.html).

0.8

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:
* Command line option `--no-prss` for disabling PRSS (e.g., demos `{helloworld,oneliners,ot,unanimous,parallelsort}.py` do not use PRSS).
* Command line option `--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).
* Drop limitation to m=256 parties (see, e.g., demo `helloworld.py`).
* Use `pyOpenSSL` only via `cryptography` package for generating X.509 certificates, also upgrading incl. dummy `.crt` files from version 1 to 3.
* Toward favoring hashable over mutable for finite fields.
* Add Read the Docs badge, `.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).
* Add `.gitattributes` for platform-dependent line endings in `.bat` and `.sh` files.
* 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](https://pypi.org/).

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](https://devguide.python.org/)), 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](https://www.pypy.org/features.html)).

0.7

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:
* New `unanimous.py` for unanimous voting (generalized matchmaking) between t+1 voters and t extra parties for maximal privacy.
* Revamped `lpsolver(fxp).py` demos now have `.csv` datasets nicely rendered on GitHub, with objective function as "header" row.
* Prettify MNIST digit printing on console.
* Use `mpc.transfer()` in demos `helloworld.py`, `parallelsort.py`, `bnnmnist.py`, `cnnmnist.py`, and `ridgeregresssion.py`.

Technical changes:
* Automatic type conversion for `b = mpc.output(a)`, e.g., `a` of type `SecFxp` to `b` of type `float` (set flag `raw` to override).
* New SecureObject hierarchy in `mpyc.sectypes` (NB: base class `SecureObject` instead of `Share` with slot `share` instead of `df`).
* 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-gmpy2` command line option.
* Enhancements to `mpc.to_bits()` and `mpc.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](https://github.com/b-kamphorst), [niekbouman](https://github.com/niekbouman), [skorzili](https://github.com/skorzili), [ThomasTNO](https://github.com/ThomasTNO), and [toonsegers](https://github.com/toonsegers) for their recent contributions.

Corresponds to package **mpyc 0.7** on [PyPI](https://pypi.org/).

0.6

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:
* 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](https://pypi.org/).

0.5

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](https://pypi.org/).

0.4

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 *m*ultiparty computation;)

Corresponds to package **mpyc 0.4** on [PyPI](https://pypi.org/).

Page 1 of 2

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.