Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用ECDH/KKRT-PSI-NPC协议执行三方psi报错 #87

Open
dyx0001 opened this issue Sep 8, 2023 · 1 comment
Open

使用ECDH/KKRT-PSI-NPC协议执行三方psi报错 #87

dyx0001 opened this issue Sep 8, 2023 · 1 comment
Assignees

Comments

@dyx0001
Copy link

dyx0001 commented Sep 8, 2023

运行代码其中一个节点如下:
`import os
import sys
import time
import logging
import multiprocess
from absl import app
import spu
import secretflow as sf
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)

cluster_config ={
'parties': {
'alice': {
'address': '10.200.3.32:8002',
'listen_addr': '0.0.0.0:8002'
},
'bob': {
'address': '10.200.3.33:8012',
'listen_addr': '0.0.0.0:8012'
},
'carol': {
'address': '10.200.3.34:8022',
'listen_addr': '0.0.0.0:8022'
},
},
'self_party': 'bob'
}

cluster_def = {
'nodes': [
{'party': 'alice', 'id': 'local:0', 'address': '10.200.3.32:12945'},
{'party': 'bob', 'id': 'local:1', 'address': '10.200.3.33:12946'},
{'party': 'carol', 'id': 'local:2', 'address': '10.200.3.34:12947'},
],
'runtime_config': {
'protocol': spu.spu_pb2.SEMI2K,
'field': spu.spu_pb2.FM128,
},
}

link_desc = {
'recv_timeout_ms': 3600000,
}

def main(_):
sf.init(address='10.200.3.33:8011', log_to_driver=True, cluster_config=cluster_config, omp_num_threads=multiprocess.cpu_count())

logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)

alice = sf.PYU('alice')
bob = sf.PYU('bob')
carol = sf.PYU('carol')

key_columns = ['姓名','证件类型','证件号码']
label_columns = ['register_date','age']
spu = sf.SPU(cluster_def, link_desc)

parent_path = '/jdxk/psi'

input_path = {
    alice: f'{parent_path}/Atest.csv',
    bob: f'{parent_path}/Btest.csv',
    carol: f'{parent_path}/Ctest.csv',
}

output_path = {
    alice: f'{parent_path}/psi_output.csv',
    bob: f'{parent_path}/psi_output_bob.csv',
    carol:f'{parent_path}/psi_output_carol.csv',
}
select_keys = {
    alice: key_columns,
    bob: key_columns,
    # if run with `ECDH_PSI_3PC`, add carol
    carol: key_columns,
}

spu = sf.SPU(cluster_def=cluster_def)

start = time.time()

reports = spu.psi_csv(
    key=select_keys,
    input_path=input_path,
    output_path=output_path,
    receiver='alice',  
    protocol='ECDH_PSI_NPC', 
    precheck_input=False,  # will cost ext time if set True
    broadcast_result=True,  # will cost ext time if set True
)
print(f"psi reports: {reports}")
logging.info(f"cost time: {time.time() - start}")

sf.shutdown()

if name == 'main':
app.run(main)
`

运行卡在计算界面未出结果,其中两个节点的日志如下:
iwEcAqNwbmcDAQTRBe4F0QEgBrAq88psbJI8zwTpcusHQDEAB9MAAAAAwdHhXwgACaJpbQoAC9IACJhI png_720x720q90
lQLPJxMXeOlPqXzNAY7NBhKwjuEYUYHvks4E6W9FMQClAA_1554_398 png_720x720q90

@Chrisdehe
Copy link
Member

@dyx0001 好的我们复现一下

@anakinxc anakinxc transferred this issue from secretflow/spu Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants