csclib
秘密分散に基づく秘匿計算ライブラリ
環境
3台のPCで計算を行います(1台でも可).それぞれを server, party_1, party_2 とします. server は入力データを平文で受け取って,それをシェアに変換し,party 1, 2 に送ります.また,相関乱数を生成し party 1, 2 に送ります. 現状では,server では答え合わせ用に全ての計算を平文で行っています. party_1 と party_2 は相互に通信を行いながら計算をします.
コンパイル
C言語またはC++で #include "share.h" して使います.(LOUDSを使う場合は #include "LOUDS.h") party の番号を -1 として実行すると,全ての計算を1台で(平文で)行います.アルゴリズムの確認や,MPCによる速度低下を評価する際に使えます.
実行
config.txt に3台のPCのIPアドレスとポートを設定します.
127.0.0.1 9800 # server
127.0.0.1 9810 # party 1
127.0.0.1 9820 # party 2
各行がPCのIPアドレスと使用するポートですが,ポートはここに書かれた値から3つ分を使います. (この例ではサーバの場合,9800, 9801, 9802 を使います) 1台のPCで実行する場合,全てのIPアドレスを localhost (127.0.0.1) にします.ポート番号は全てが異なるようにします. 複数台ある場合にはそれぞれのIPアドレスを指定します.なお,他のPCと通信を行う場合にはPCのファイアーウォールの設定を変える必要があります.
実行ファイル名を share.out とすると,3台のPC(ターミナル)それぞれで実行します.
@server:$ ./share.out 0
@party_1:$ ./share.out 1
@party_2:$ ./share.out 2
Python
コンパイルと実行方法.
@server:$ python3 -m venv env
@server:$ source env/bin/activate
@server:$ cd python/csclib
@server:$ python3 setup.py build
@server:$ pip3 install .
PyPIからのインストール
@server:$ sudo apt install gcc python3.10-dev python3.10-venv python3-pip
@server:$ python3 -m venv env
@server:$ source env/bin/activate
(env) @server:$ pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ csclib
setuptools に関するエラーが出るときは
pip install wheel
pip install --no-build-isolation csclib
pythonのソース内では
from csclib import *
とする.
Metadata
Release files for csclib 202601191
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| csclib-202601191.tar.gz | 135.3 kB | Without provenance | Details for csclib-202601191.tar.gz |
Release files / csclib-202601191.tar.gz
| Download URL | csclib-202601191.tar.gz |
|---|---|
| Size | 135.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73c2a421caf4bc3e41f78a97fec9a5d58807d71b3952fcd94ffc9c113a743d0a
|
|
BLAKE2b-256 checksum How to use checksums |
dfb4f6ea5d0e1072eab2f2700e1d8d00abc0532c6096096541cc5155658ff45e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for csclib 202601191
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.