SPU PSI Configuration#
Table of Contents#
Messages#
BucketPsiConfig#
The Bucket-psi configuration.
config = psi.BucketPsiConfig( # prepare config
psi_type=PsiType.ECDH_PSI_2PC,
broadcast_result=True,
receiver_rank=0,
input_params=psi.InputParams(path='/xxx/ccc.csv', select_fields=['c1', 'c2']),
output_params=psi.OutputParams(path='/yyyy/oooo.csv', need_sort=True),
)
report = psi.bucket_psi(lctx, config) # run psi and get report
Field |
Type |
Description |
---|---|---|
psi_type |
The psi type. |
|
receiver_rank |
Specified the receiver rank. Receiver can get psi result. |
|
broadcast_result |
Whether to broadcast psi result to all parties. |
|
input_params |
The input parameters of psi. |
|
output_params |
The output parameters of psi. |
|
curve_type |
Optional, specified elliptic curve cryptography used in psi when needed. |
|
bucket_size |
Optional, specified the hash bucket size used in psi. |
|
preprocess_path |
Optional,The path of offline preprocess file. |
|
ecdh_secret_key_path |
Optional,secret key path of ecdh_oprf, 256bit/32bytes binary file. |
|
dppsi_params |
Optional,Params for dp-psi |
DpPsiParams#
The input parameters of dp-psi.
Field |
Type |
Description |
---|---|---|
bob_sub_sampling |
bob sub-sampling bernoulli_distribution probability. |
|
epsilon |
dp epsilon |
InputParams#
The input parameters of psi.
Field |
Type |
Description |
---|---|---|
path |
The path of input csv file. |
|
select_fields |
The select fields of input data. |
|
precheck |
Whether to check select fields duplicate. |
MemoryPsiConfig#
The In-memory psi configuration.
config = psi.MemoryPsiConfig( # prepare config
psi_type=PsiType.ECDH_PSI_2PC,
broadcast_result=True,
receiver_rank=0,
)
joined_list = psi.mem_psi(
lctx, config, ['a1', 'v2', 'b3', 'v4']
) # run psi and get joined list
Field |
Type |
Description |
---|---|---|
psi_type |
The psi type. |
|
receiver_rank |
Specified the receiver rank. Receiver can get psi result. |
|
broadcast_result |
Whether to broadcast psi result to all parties. |
|
curve_type |
Optional, specified elliptic curve cryptography used in psi when needed. |
|
dppsi_params |
Optional,Params for dp-psi |
OutputParams#
The output parameters of psi.
Field |
Type |
Description |
---|---|---|
path |
The path of output csv file. |
|
need_sort |
Whether to sort output file by select fields. |
PsiResultReport#
The report of psi result.
Field |
Type |
Description |
---|---|---|
original_count |
The data count of input. |
|
intersection_count |
The count of intersection. Get |
Enums#
CurveType#
The specified elliptic curve cryptography used in psi.
Name |
Number |
Description |
---|---|---|
CURVE_INVALID_TYPE |
0 |
none |
CURVE_25519 |
1 |
Daniel J. Bernstein. Curve25519: new diffie-hellman speed records |
CURVE_FOURQ |
2 |
FourQ: four-dimensional decompositions on a Q-curve over the Mersenne prime |
CURVE_SM2 |
3 |
SM2 is an elliptic curve based cryptosystem (ECC) published as a Chinese National Standard as GBT.32918.1-2016 and published in ISO/IEC 14888-3:2018 |
CURVE_SECP256K1 |
4 |
parameters of the elliptic curve defined in Standards for Efficient Cryptography (SEC) http://www.secg.org/sec2-v2.pdf |
PsiType#
The algorithm type of psi.
Name |
Number |
Description |
---|---|---|
INVALID_PSI_TYPE |
0 |
none |
ECDH_PSI_2PC |
1 |
DDH based PSI |
KKRT_PSI_2PC |
2 |
Efficient Batched Oblivious PRF with Applications to Private Set Intersection https://eprint.iacr.org/2016/799.pdf |
BC22_PSI_2PC |
3 |
PSI from Pseudorandom Correlation Generators https://eprint.iacr.org/2022/334 |
ECDH_PSI_3PC |
4 |
Multi-party PSI based on ECDH (Say A, B, C (receiver)) notice: two-party intersection cardinarlity leak ( |
ECDH_PSI_NPC |
5 |
Iterative running 2-party ecdh psi to get n-party PSI. Notice: two-party intersection leak |
KKRT_PSI_NPC |
6 |
Iterative running 2-party kkrt psi to get n-party PSI. Notice: two-party intersection leak |
ECDH_OPRF_UB_PSI_2PC_GEN_CACHE |
7 |
ecdh-oprf 2-party Unbalanced-PSI Generate CACHE. |
ECDH_OPRF_UB_PSI_2PC_TRANSFER_CACHE |
8 |
ecdh-oprf 2-party Unbalanced-PSI transfer CACHE. |
ECDH_OPRF_UB_PSI_2PC_OFFLINE |
9 |
ecdh-oprf 2-party Unbalanced-PSI offline phase. |
ECDH_OPRF_UB_PSI_2PC_ONLINE |
10 |
ecdh-oprf 2-party Unbalanced-PSI online phase. |
ECDH_OPRF_UB_PSI_2PC_SHUFFLE_ONLINE |
11 |
ecdh-oprf 2-party Unbalanced-PSI with shuffling online phase. large set party get intersection result |
DP_PSI_2PC |
12 |
Differentially-Private PSI https://arxiv.org/pdf/2208.13249.pdf bases on ECDH-PSI, and provides: Differentially private PSI results. |
Scalar Value Types#
.proto Type |
Notes |
C++ Type |
Java Type |
Python Type |
---|---|---|---|---|
double |
double |
double |
float |
|
float |
float |
float |
float |
|
int32 |
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. |
int32 |
int |
int |
int64 |
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. |
int64 |
long |
int/long |
uint32 |
Uses variable-length encoding. |
uint32 |
int |
int/long |
uint64 |
Uses variable-length encoding. |
uint64 |
long |
int/long |
sint32 |
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. |
int32 |
int |
int |
sint64 |
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. |
int64 |
long |
int/long |
fixed32 |
Always four bytes. More efficient than uint32 if values are often greater than 2^28. |
uint32 |
int |
int |
fixed64 |
Always eight bytes. More efficient than uint64 if values are often greater than 2^56. |
uint64 |
long |
int/long |
sfixed32 |
Always four bytes. |
int32 |
int |
int |
sfixed64 |
Always eight bytes. |
int64 |
long |
int/long |
bool |
bool |
boolean |
boolean |
|
string |
A string must always contain UTF-8 encoded or 7-bit ASCII text. |
string |
String |
str/unicode |
bytes |
May contain any arbitrary sequence of bytes. |
string |
ByteString |
str |