tno.mpc.mpyc.stubs

TNO PET Lab - secure Multi-Party Computation (MPC) - MPyC - Stubs

https://github.com/tno-mpc/mpyc.stubs

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary

Keywords

mpc mpc-lab mpyc multi-party-computation pet-lab secret-sharing tno
Last synced: 6 months ago · JSON representation ·

Repository

TNO PET Lab - secure Multi-Party Computation (MPC) - MPyC - Stubs

Basic Info
  • Host: GitHub
  • Owner: TNO-MPC
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 81.1 KB
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Topics
mpc mpc-lab mpyc multi-party-computation pet-lab secret-sharing tno
Created over 4 years ago · Last pushed 11 months ago
Metadata Files
Readme License Citation

README.md

TNO PET Lab - secure Multi-Party Computation (MPC) - MPyC - Stubs

This package contains stubs to use for type hinting MPyC.

PET Lab

The TNO PET Lab consists of generic software components, procedures, and functionalities developed and maintained on a regular basis to facilitate and aid in the development of PET solutions. The lab is a cross-project initiative allowing us to integrate and reuse previously developed PET functionalities to boost the development of new protocols and solutions.

The package tno.mpc.mpyc.stubs is part of the TNO Python Toolbox.

Limitations in (end-)use: the content of this software package may solely be used for applications that comply with international export control laws. This implementation of cryptographic software has not been audited. Use at your own risk.

Documentation

Documentation of the tno.mpc.mpyc.stubs package can be found here.

Install

Easily install the tno.mpc.mpyc.stubs package using pip:

console $ python -m pip install tno.mpc.mpyc.stubs

Note: If you are cloning the repository and wish to edit the source code, be sure to install the package in editable mode:

console $ python -m pip install -e 'tno.mpc.mpyc.stubs'

If you wish to run the tests you can use:

console $ python -m pip install 'tno.mpc.mpyc.stubs[tests]'

Usage

When installing this package, the package is installed twice under two different names:

  • mpyc-stubs
  • tno.mpc.mpyc.stubs

The mpyc-stubs installation is named as such by the convention <package>-stubs, which allows static type tooling to easily pick up the additional annotations. If you only use MPyC without defining custom MPyC coroutines (usually decorated by @asyncoro.mpc_coro and asyncoro.mpc_coro_no_pc in the MPyC source code), then this suffices.

The package tno.mpc.mpyc.stubs provides some convenience functions that help you with writing custom, type-checked MPyC coroutines. Most importantly, MPyC's decorator @asyncoro.mpc_coro[_no_pc] uses the type annotations of a function to determine its MPyC returnType. However, this may be undesirable for more complex functions. As such, tno.mpc.mpyc.stubs provides the following top-level import:

  • mpc_coro_ignore is a decorator that replaces mpyc.asyncoro.mpc_coro and avoids interference of type annotations with runtime behaviour. The _ignore part emphasizes that it ignores the type annotations at runtime. After stripping the type annotations, the decorator delegates the runtime logic to MPyC.

Additionally, the following top-level imports can be helpful:

  • returnType replaces mpyc.asyncoro.returnType or equivalently mpyc.runtime.Runtime.returnType. We encountered various Mypy issues in the past when annotating mpyc.runtime.Runtime.returnType as it is appended to the class with staticmethod() and that did not preserve type overloads. As such, we provide returnType directly with proper type annotations. The function itself delegates behaviour to the MPyC counterpart.
  • BaseSecureFloat is a type that represents secure floating point objects. It inherits from mpyc.sectypes.SecureNumber, and we make Mypy believe that both mpyc.sectypes.SecureFloat as well as our own tno.mpc.mpyc.floating_point.SecureFloatingPoint inherit from it. This way, the type annotations that we added will apply to both. If you develop MPyC coroutines that accept both secure floating point types, then you may use this class as a common ancestor.

Owner

  • Name: TNO - MPC Lab
  • Login: TNO-MPC
  • Kind: organization
  • Email: mpclab@tno.nl
  • Location: Anna van Buerenplein 1, 2595 DA Den Haag, The Netherlands

TNO - MPC Lab

Citation (CITATION.cff)

cff-version: 1.2.0
license: Apache-2.0
message: If you use this software, please cite it using these metadata.
authors:
  - name: TNO PET Lab
    city: The Hague
    country: NL
    email: petlab@tno.nl
    website: https://pet.tno.nl
type: software
url: https://pet.tno.nl
contact:
  - name: TNO PET Lab
    city: The Hague
    country: NL
    email: petlab@tno.nl
    website: https://pet.tno.nl
repository-code: https://github.com/TNO-MPC/mpyc.stubs
repository-artifact: https://pypi.org/project/tno.mpc.mpyc.stubs
title: TNO PET Lab - secure Multi-Party Computation (MPC) - MPyC - Stubs
version: 2.11.0
date-released: 2025-03-16

GitHub Events

Total
  • Watch event: 1
  • Push event: 2
  • Pull request event: 2
  • Fork event: 1
  • Create event: 1
Last Year
  • Watch event: 1
  • Push event: 2
  • Pull request event: 2
  • Fork event: 1
  • Create event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 5
  • Total Committers: 1
  • Avg Commits per committer: 5.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Thomas Rooijakkers t****s@t****l 5
Committer Domains (Top 20 + Academic)
tno.nl: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 month
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 month
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • SynthLuvr (2)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 219 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 8
  • Total maintainers: 1
pypi.org: tno.mpc.mpyc.stubs

Partial stubs for use with the MPyC library

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 219 Last month
Rankings
Dependent packages count: 6.6%
Average: 27.9%
Forks count: 30.5%
Dependent repos count: 30.6%
Downloads: 32.5%
Stargazers count: 39.1%
Maintainers (1)
Last synced: 6 months ago

Dependencies

pyproject.toml pypi
  • mpyc ~=0.9.0
  • typing_extensions python_version<'3.11'