Git Product home page Git Product logo

libpsi's People

Contributors

dd23 avatar erik-buchholz avatar fumiyukikato avatar ladnir avatar ladnir2 avatar morebtcg avatar nitrieu avatar rindalvisa avatar sourav1547 avatar tinuschen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

libpsi's Issues

network send error: Broken pipe

l run the code:frontend.exe -kkrt -in /test.csv -csv -r 1 -out /tmp/psi.out -ip 0.0.0.0:1212
then get the error :
Exception: network send error: Broken pipe
/libPSI/out/install/linux/include/cryptoTools/Network/IoBuffer.h:629

how can l figure this problem?

cuckoo stash overflow

I'm using this open source library to test 1 million pieces of data by executing . /frontend.exe -r 1 -kkrt -in . /alice.csv, I get the following error:

cuckoo stash overflow
Exception: /home/crypto/libOTe/cryptoTools/cryptoTools/Common/CuckooIndex.cpp:460

One question for kkrt: what happens if the same secret key is used to calculate the OPRF

As mentioned in the paper, both parties compute the mapping of inputs to buckets based on the same cuckoo hash, and then perform 1.2n + s times OPRF (Don't consider OTE) with different random numbers corresponding to hash buckets.

I envisioned an optimization method: if only one random number is used, one party uses this random number to execute n times PRF, and both parties perform n times OPRF with the same random number. In this way, there is no need to calculate the cuckoo hash, and the number of OPRF calculations is also reduced.

Is there any problem with this?

Some questions about PSI protocol

I'm testing some PSI protocols like kkrt, and trying to make both participants get the interaction set result, then I got some questions about this protocol.

In KKRT, the receiver has ri, and the sender has seed ki. After both parties run OPRF, the receiver receives F(ki, ri). If the receiver sends F(ki, ri) to the sender, whether the sender has a certain probability can be reversed. Receiver's private data ri?

If A and B, C perform KKRT PSI, we want A to finally obtain the intersection of A and B and the intersection of A and C, and do not want A to know which intersection comes from B and which comes from C.
Is it possible to add a coordinator? A、B run OPRF and send the PRF of both parties to the coordinator; A、C run OPRF and send the PRFs of both parties to the coordinator; the coordinator compares the PRFs, and finally returns the intersection result to A.
If the coordinator and B collide, can the coordinator deduce the set elements of A?

How to link the libPSI

Hello, I want to link the libPSI to my own project, how to write a CMakeLists to link that?

In libOTe:
I can be linked via cmake as

find_package(libOTe REQUIRED)
target_link_libraries(myProject oc::libOTe)

So is it similar to libPSI? Thanks!

problem when building libPSI

I run cmake with cmake . -DENABLE_MIRACL=ON -DENABLE_SIMPLESTOT=ON, then I run make, but it occurs the error as is shown in the following picture.
![Uploading 18KK`)}Z97R]_1]HN8HEQKJ.png…]()

libPSI/out/build/linux" does not appear to contain CMakeLists.txt.

Hi~
I encountered an error when I installed libPSI according to the installation method in README.md

More specifically, I ran python build, it threw an error as follow.

====== build.py (LIBPSI) ========
mkdir -p out/build/linux
cmake   -S . -B out/build/linux  -DSUDO_FETCH=OFF -DENABLE_ALL_PSI=ON -DFETCH_AUTO=ON -DPARALLEL_FETCH=64 -DCMAKE_BUILD_TYPE=Release 
cmake --build out/build/linux   --parallel 64 
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv


CMake Error: The source directory "/home/ubuntu/libPSI/out/build/linux" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Error: could not load cache

I don't know how to solve it, can you give me some advice. Thank you.

The problem of multi-thread

At Rr16, we output the intersection in AknMbfReceiver.cpp, and found that the intersection are correct when running the code using a single thread. But the intersection are wrong when running the code using multi-thread. Did we run it wrong?

Does this library support using a text file as data?

I have successfully compiled the library, I can run frontend.exe, and most unit tests pass. I am attempting to use either RR16, RR17, or DRRT18 to compare two .csv files comparing data.

Does this library support piping in a text file for use as data on the sender and receiver side, or is the data internally generated for testing purposes only.

I have checked out frontend.exe -u, but haven't been able to determine this yet. If this library does support this, would it be possible to provide a short example of what the required command line parameters would look like?

has no member named ‘usize’; did you mean ‘size’?

hi~
I successfully installed libOTe, but I got the following error when compiling libPSI, what should I do?

/home/crypto/libPSI/libPSI/Tools/RandomShuffle.cpp: In member function ‘void osuCrypto::RandomShuffle::parallelShuffle(osuCrypto::span<long unsigned int>, osuCrypto::u64, osuCrypto::u64)’:
/home/crypto/libPSI/libPSI/Tools/RandomShuffle.cpp:18:27: error: ‘osuCrypto::span<long unsigned int>’ {aka ‘class nonstd::span_lite::span<long unsigned int, 18446744073709551615>’} has no member named ‘usize’; did you mean ‘size’?
   18 |         auto start = vals.usize() * t / nt;
      |                           ^~~~~
      |                           size
compilation terminated due to -Wfatal-errors.
make[2]: *** [libPSI/CMakeFiles/libPSI.dir/build.make:468: libPSI/CMakeFiles/libPSI.dir/Tools/RandomShuffle.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/crypto/libPSI/libPSI/Tools/CuckooHasher.cpp: In member function ‘void osuCrypto::CuckooHasher::insertBatch(osuCrypto::span<long unsigned int>, osuCrypto::MatrixView<long unsigned int>, osuCrypto::CuckooHasher::Workspace&)’:
/home/crypto/libPSI/libPSI/Tools/CuckooHasher.cpp:180:35: error: ‘osuCrypto::span<long unsigned int>’ {aka ‘class nonstd::span_lite::span<long unsigned int, 18446744073709551615>’} has no member named ‘usize’; did you mean ‘size’?
  180 |         u64 remaining = inputIdxs.usize();
      |                                   ^~~~~
      |                                   size
compilation terminated due to -Wfatal-errors.
make[2]: *** [libPSI/CMakeFiles/libPSI.dir/build.make:454: libPSI/CMakeFiles/libPSI.dir/Tools/CuckooHasher.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:134: libPSI/CMakeFiles/libPSI.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

The collision handling code in KkrtPsiSender seems not working.

The cuckoo hash of KKRT needs to produce 3 hash locations for each input, these locations may collide. So, the function hashItems of KkrtPsiSender contains some codes for dealing the collisions. The dealing logic is as follows. If the itemIdx input got a collision, then the position perm[itemIdx] of the array myMaskBuff will fill with junk data.

// if we got a collision, then fill the final mask locations with junk data
prngs[0].get(masks.data() + (perm[itemIdx0] * mNumHashFunctions + 1) * masks.stride(), c01 * masks.stride());
prngs[1].get(masks.data() + (perm[itemIdx1] * mNumHashFunctions + 1) * masks.stride(), c11 * masks.stride());
prngs[2].get(masks.data() + (perm[itemIdx2] * mNumHashFunctions + 1) * masks.stride(), c21 * masks.stride());
prngs[3].get(masks.data() + (perm[itemIdx3] * mNumHashFunctions + 1) * masks.stride(), c31 * masks.stride());
prngs[4].get(masks.data() + (perm[itemIdx4] * mNumHashFunctions + 1) * masks.stride(), c41 * masks.stride());
prngs[5].get(masks.data() + (perm[itemIdx5] * mNumHashFunctions + 1) * masks.stride(), c51 * masks.stride());
prngs[6].get(masks.data() + (perm[itemIdx6] * mNumHashFunctions + 1) * masks.stride(), c61 * masks.stride());
prngs[7].get(masks.data() + (perm[itemIdx7] * mNumHashFunctions + 1) * masks.stride(), c71 * masks.stride());

However, ignoring the syntax mistake that the hashItems has not used the correct c02~c72, these codes for dealing with collisions seem still not working.

The reason is that during the encoding part, the encoding codes as follow will try to encode the inputIdx = mPermute[i] input into location i of array myMaskBuff.

// lets check a random item to see if it can be encoded. If so,
// we will write this item's encodings in the myMaskBuff at position i.
auto inputIdx = mPermute[i];

// for each hash function, try to encode the item.
for (u64 h = 0; h < mParams.mNumHashes; ++h)
{
    auto& bIdx = binIdxs(inputIdx, h);

    // if the bin index is less than r, then we have received
    // the correction and can encode it
    if (bIdx < r)
    {
        // write the encoding into myMaskBuff at position  i, h
        auto encoding = myMaskBuff.data() + (i * mParams.mNumHashes + h) * myMaskBuff.stride();
        mOtSender->encode(bIdx, &inputs[inputIdx], encoding, myMaskBuff.stride());

        // make this location as already been encoded
        bIdx = -1;
    }
}

This permutation logic of encoding is different from the permutation logic used to fill junk data in hashItems, one is using perm[itemIdx](itemIdx is index of input) and the other is using mPermute[i](i is the current location of myMaskBuff), and will result in the junk data being rewritten while the actual location of the collision will not be filled.

Here is a toy example

  • Assuming that the permutation array is perm[3]=9, perm[9]=19, perm[19]=7, and the 9th input gots a collision.
  • Then, in the hashItems function, the location myMaskBuff[perm[9]=19] will be filled with junk data.
  • Then, during the encoding part, only when i is equal to 3, the inputIdx used for encoding will equal to perm[3]=9. In other words, the 9th input where the collision occurred will be encoded to the myMaskBuff[3]. However, in the subsequent code, only the positions where no collisions occurred will be encoded, and the positions where collisions occurred will be ignored. This is reasonable, because the collision is expected to have been handled by filling myMaskBuff [19] with junk data, and this is where the problem lies, the filled junk data is actually in a wrong location.
  • When i equals 19, the inputIdx used for encoding will be equal to perm[19]=7, then the junk data filled in myMaskBuff[19] will be rewritten by encoding the 7th input, and the collision handling code in the hashItems is totally disabled.

We also run a test using command line ./frontend.exe -kkrt -n 1000000, and following is our observation.

  • When i is equal to 209718 or 474447, collision is found. And the inputIdx=mPermute[i] is equal to 172890 and 42021.
  • We output myMaskBuff[209718] and myMaskBuff[474447] into console before encoding part, and found that all of them are initially zero as follow.

截屏2023-01-04 16 25 33

  • After the encoding part, we output myMaskBuff[209718] and myMaskBuff[474447] into console again, and found that the first and second location is successfully encoded into mask, however, the third location is still zero. This means that collisions are not handled, as we described in the toy example.

截屏2023-01-04 16 31 13

Overall, because the collision handling code in hashItems places the junk data in the wrong position, and the encoding part ignores the collisions, the myMaskBuff that send to the receiver contains zero values, which might leak the information of collisions.

Conversion Error

System: Windows10
IDE: Visual Studio 2022
Problem: When I try to compile the project, following problems show up, and I'm confused that mOtSender->recvCorrection method takes a Channel as input, while its definition is Socket.

Severity Code Description Project File Line Suppression State
Error C2664 'macoro::task<void,true> osuCrypto::NcoOtExtSender::recvCorrection(osuCrypto::Socket &,osuCrypto::u64)': cannot convert argument 1 from 'T' to 'osuCrypto::Socket &' libPSI C:\Users\ceezous\Desktop\libPSI-private\libPSI\PSI\Kkrt\KkrtPsiSender.cpp 374

Severity Code Description Project File Line Suppression State
Error C2664 'macoro::task<void,true> osuCrypto::NcoOtExtSender::init(osuCrypto::u64,osuCrypto::PRNG &,osuCrypto::Socket &)': cannot convert argument 3 from 'T' to 'osuCrypto::Socket &' libPSI C:\Users\ceezous\Desktop\libPSI-private\libPSI\PSI\Kkrt\KkrtPsiSender.cpp 86

Severity Code Description Project File Line Suppression State
Error C2664 'macoro::task<void,true> osuCrypto::NcoOtExtReceiver::sendCorrection(osuCrypto::Socket &,osuCrypto::u64)': cannot convert argument 1 from 'T' to 'osuCrypto::Socket &' libPSI C:\Users\ceezous\Desktop\libPSI-private\libPSI\PSI\Kkrt\KkrtPsiReceiver.cpp 189

Severity Code Description Project File Line Suppression State
Error C2664 'macoro::task<void,true> osuCrypto::NcoOtExtReceiver::init(osuCrypto::u64,osuCrypto::PRNG &,osuCrypto::Socket &)': cannot convert argument 3 from 'T' to 'osuCrypto::Socket &' libPSI C:\Users\ceezous\Desktop\libPSI-private\libPSI\PSI\Kkrt\KkrtPsiReceiver.cpp 105

Segmentation fault

I run frontend.exe -kkrt -in t2.csv -csv -r 1 -out test.out -ip xxxx, I encountered the following error,

network send error: Connection reset by peer
at /libPSI/thirdparty/libOTe/cryptoTools/cryptoTools/Network/Channel.cpp:871
Segmentation fault

what is the reason.Thank you very much.

Segmatation fault when running -kkrt

haoche@Toshiba-Linux:~/Documents/Libraries/libPSI$ ./bin/frontend.exe -kkrt
protocol     n      threads      total(ms)    online(ms)     comm (MB)        bandwidth (Mbps)
------------------------------------------------------------------------------------------------
  kkrt     2561 1.000000            36             0              0.05        6.26, 4.64
Segmentation fault (core dumped)

I tried -kkrt -r 0 and also it gives some errors...

problem about balls to bins

Hi,
I have a problem about the function BallsAndBins in main.cpp, m denotes the number of bin, n is the number of balls, s is the binScaler, it satisfies m=n*binScaler , but it seems that the code auto m = n / mm in line 373 is wrong. should it be auto m = n * mm?

what's more, Given the number of the bin b, the number of balls n, and one hash function,PSZ16 shows how to get the max binsize according to Equation(3) in Page13(simple hash).

But now if I use two hash function to map n balls into b bins(simple hash). each ball appears at two bins, now if I use Equation(3) to find the max binsize, should I plug the number of balls 2*n and b in the Equation(3)? because the number of hash functions is 2, therefore the real number of balls turns out to be 2*n.

Generally,if I use k hash functions(simple hash), should I plug the balls k*n and b in the Equation(3)? suppose b is fixed.

Does KKRT16 and Mea86 support two party psi with different count of id?

I find that the frontend.exe has a limit that count of id in two party must be the same, otherwise an error occurs in each party, below is error of each party in this case:

root@psi:~/libPSI/out/build/linux/frontend# ./frontend.exe -r 1 -ecdh -ip 172.16.0.161  -t 30 -nn 2 

ERROR in ep_read_bin() at /root/libPSI/thirdparty/libOTe/cryptoTools/thirdparty/relic/src/ep/relic_ep_util.c,276: invalid value passed as input.
terminate called after throwing an instance of 'std::runtime_error'
  what():  Relic ep_read error /root/libPSI/thirdparty/libOTe/cryptoTools/cryptoTools/Crypto/RCurve.cpp:687
Aborted (core dumped)
root@psi:~/libPSI/out/build/linux/frontend# ./frontend.exe -r 0 -ecdh -ip 172.16.0.161  -t 30 -nn 1 
protocol     n      threads      total(ms)    online(ms)     comm (MB)        bandwidth (Mbps)
------------------------------------------------------------------------------------------------
error @ /root/libPSI/libPSI/PSI/ECDH/EcdhPsiReceiver.cpp:118
terminate called after throwing an instance of 'std::runtime_error'
  what():  /root/libPSI/libPSI/PSI/ECDH/EcdhPsiReceiver.cpp:119
Aborted (core dumped)

I think it is normal that count of each party is different, so does this limit come from the code of frontend.exe, not the psi implement?

Some problems were encountered when entering ./frontend.exe -drrt

Hi,
I want to test the performance of drrt protocol. When I enter. /frontend.exe -drrt, the following two errors occur:
(1)

krusty@DESKTOP-NALLGES:/mnt/d/ubuntu/libPSI/out/build/linux/frontend$ ./frontend.exe -drrt
protocol     n      threads      total(ms)    online(ms)     comm (MB)        bandwidth (Mbps)
------------------------------------------------------------------------------------------------
network receive error._autoName_0 ): No buffer space available
terminate called after throwing an instance of ' at  /mnt/d/ubuntu/libOTe/cryptoTools/cryptoTools/Network/Channel.cpp:819
osuCrypto::BadReceiveBufferSize'
  what():  Bad receive buffer size.
  Size transmitted: 870400 bytes
  Size of buffer:   1 bytes

Aborted (core dumped)

(2)

krusty@DESKTOP-NALLGES:/mnt/d/ubuntu/libPSI/out/build/linux/frontend$ ./frontend.exe -drrt
protocol     n      threads      total(ms)    online(ms)     comm (MB)        bandwidth (Mbps)
------------------------------------------------------------------------------------------------

Note: It's stuck at this interface with no output and seems to be blocked somewhere.

In addition, when I enter ./frontend.exe -u, the intersection result is displayed incorrectly:

...
140 - Psi_drrn_SingletonSet_Test_Impl       Failed - Known issue with incorrect result. Ok to ignore for benchmarking...   12ms
141 - Psi_drrn_FullSet_Test_Impl            Failed - Known issue with incorrect result. Ok to ignore for benchmarking...   18ms
142 - Psi_drrn_EmptySet_Test_Impl             Passed   26ms
...

#############################################
           Failed (4)
           Passed (126)
            skipped (37)
#############################################

What causes the above problems? How can I avoid or fix it? How can I enter commands to get the correct intersection? Look forward to your reply.

build issue on linux

Got this error message when running make. I built the libOTe with the simplestOT enabled.

/home/haoche/Documents/Libraries/libOTe/lib/liblibOTe.a(SimplestOT.cpp.o): In function osuCrypto::SimplestOT::send(gsl::span<std::array<long long __vector(2), 2ul>, -1l>, osuCrypto::PRNG&, osuCrypto::Channel&)': SimplestOT.cpp:(.text._ZN9osuCrypto10SimplestOT4sendEN3gsl4spanISt5arrayIDv2_xLm2EELln1EEERNS_4PRNGERNS_7ChannelE+0x6d): undefined reference to sender_genS'
SimplestOT.cpp:(.text._ZN9osuCrypto10SimplestOT4sendEN3gsl4spanISt5arrayIDv2_xLm2EELln1EEERNS_4PRNGERNS_7ChannelE+0x17e): undefined reference to sender_keygen' /home/haoche/Documents/Libraries/libOTe/lib/liblibOTe.a(SimplestOT.cpp.o): In function osuCrypto::SimplestOT::receive(osuCrypto::BitVector const&, gsl::span<long long __vector(2), -1l>, osuCrypto::PRNG&, osuCrypto::Channel&)':
SimplestOT.cpp:(.text._ZN9osuCrypto10SimplestOT7receiveERKNS_9BitVectorEN3gsl4spanIDv2_xLln1EEERNS_4PRNGERNS_7ChannelE+0x72): undefined reference to receiver_procS' SimplestOT.cpp:(.text._ZN9osuCrypto10SimplestOT7receiveERKNS_9BitVectorEN3gsl4spanIDv2_xLln1EEERNS_4PRNGERNS_7ChannelE+0x7a): undefined reference to receiver_maketable'
SimplestOT.cpp:(.text._ZN9osuCrypto10SimplestOT7receiveERKNS_9BitVectorEN3gsl4spanIDv2_xLln1EEERNS_4PRNGERNS_7ChannelE+0x111): undefined reference to receiver_rsgen' SimplestOT.cpp:(.text._ZN9osuCrypto10SimplestOT7receiveERKNS_9BitVectorEN3gsl4spanIDv2_xLln1EEERNS_4PRNGERNS_7ChannelE+0x1e0): undefined reference to receiver_keygen'

how to use multi thread?

l try to run code ./frontend.exe -ecdh -t 16 ,but when l check cpu,l found it only use one thread.
ls there any problem in my code?

Building Errors

I followed the install instructions and got this error:
error: static assertion failed: ENABLE_SIMPLESTOT flag does not match with libOTe

I compiled using this command:
cmake . -DENABLE_MIRACL=ON && make

When I compiled using the same flags as I compiled libOTe as suggested at #9, I received another error:
Failed to find libSimplestOT.a at: libPSI/../libOTe//lib/
I compiled libOTe by: cmake . -DENABLE_MIRACL=ON -DENABLE_SIMPLESTOT=ON

OS Version: Ubuntu 18.04
Compiler: GCC 8.4.0

error: no matching function for call to 'std::min' in 'Dcw' Module

Errors
$ python build.py 
Consolidate compiler generated dependencies of target libPSI
[  1%] Building CXX object libPSI/CMakeFiles/libPSI.dir/PSI/ECDH/EcdhPsiSender.cpp.o
[  3%] Building CXX object libPSI/CMakeFiles/libPSI.dir/PSI/Kkrt/KkrtPsiReceiver.cpp.o
[  7%] Building CXX object libPSI/CMakeFiles/libPSI.dir/PSI/Dcw/DcwRBfPsiSender.cpp.o
[  7%] Building CXX object libPSI/CMakeFiles/libPSI.dir/PSI/Dcw/DcwRBfPsiReceiver.cpp.o
/Users/tinus.chen/Documents/dev/envs/psi/libPSI/libPSI/PSI/Dcw/DcwRBfPsiReceiver.cpp:76:29: fatal error: no matching function for call to 'min'
                u64 start = std::min(roundUpTo(i * mMessages.size() / total, 128), mMessages.size());
/Users/tinus.chen/Documents/dev/envs/psi/libPSI/libPSI/PSI/Dcw/DcwRBfPsiReceiver.cpp:77:29: fatal error: no matching function for call to 'min'
                u64 start = std::min(roundUpTo(i * mMessages.size() / total, 128), mMessages.size());

……
……
	
/Users/tinus.chen/Documents/dev/envs/psi/libPSI/libPSI/PSI/Dcw/DcwRBfPsiSender.cpp:77:29: fatal error: no matching function for call to 'min'
                u64 start = std::min(roundUpTo(i * mSendOtMessages.size() / total, 128), mSendOtMessages.size());
	
/Users/tinus.chen/Documents/dev/envs/psi/libPSI/libPSI/PSI/Dcw/DcwRBfPsiSender.cpp:78:27: fatal error: no matching function for call to 'min'
                u64 end = std::min(roundUpTo((i + 1) * mSendOtMessages.size() / total, 128), mSendOtMessages.size());

toolchain:

c++ --version
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

$ uname -a
Darwin TD-tinus.chen 16.7.0 Darwin Kernel Version 16.7.0: Sun Jun  2 20:26:31 PDT 2019; root:xnu-3789.73.50~1/RELEASE_X86_64 x86_64
Reason & Fix

std::min is a function template on T which is the type of both parameters of the function. It seem to pass the function arguments of different type in DcwRBfPsiSender.cpp & DcwRBfPsiReceiver.cpp.

I could fix it by adding explicitly type parameter.

u64 start = std::min<u64>(roundUpTo(i * mMessages.size() / total, 128), mMessages.size());
u64 end = std::min<u64>(roundUpTo((i + 1) * mMessages.size() / total, 128), mMessages.size());

I have tested successfully like this. I can help to fix it later.

does libpsi support nginx proxy?

Does the communication between the two parties in libpsi support the Nginx proxy? I simulated two participants in the internal network environment, and proxyed port 1212 through Nginx four-layer proxy, here is the config

stream {
upstream party {
server 192.168.254.13:1212;
}

server {
listen 1212;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass party;
}
}

receiver:
frontend.exe -kkrt -in /tmp/user1.csv -csv -r 1 -out /tmp/psi.out -ip 0.0.0.0:1212

sender:
frontend.exe -kkrt -in /tmp/user2.csv -csv -r 0 -ip 60.174.229.145:1212

Assuming that the content of the user1.csv file is 1,2, and the content of the user2.csv file is 2,3, the content of the result file /tmp/psi.out should have a value, but in fact the content of /tmp/psi.out is empty.

Question about correctness

i created two .csv as input of psi.
The contents of one csv is 1 to 1048576, another contents is 800001 to (1048576+800000).
but the result is not the last 200000 items of 1 to 1048576. why?

i am not good at English , sorry. But i hope you can understand my means.

Confusion on implementions of KKRT-PSI

I found that the implemention process is slightly different from the original paper DOI:10.1145/2976749.2978381
Here are my questions:

  1. When doing KKRT-PSI we first do an OPRF protocol. After the OPRF ,the sender will get keys(or called seeds)
    image
    and the receiver will get F(k,d)
    image
    I want to do something with these two items, but I couldn't find where they are in the code.

  2. After OPRF, do keys, F(k,d) and the data that I inputted correspond in order? Or the output of keys, F(k,d) are disordered?

Any ideas help explaining?

Is there any way to see the logs?

Is there any way to see the logs? I tried adding frontend.exe -kkrt -in t2.csv -csv -r 0 --debug -v 1 -out -ip xxxx, but I can't see the log output.

I can't solve this problem

frontend/CMakeFiles/frontend.exe.dir/build.make:364: recipe for target 'bin/frontend.exe' failed
make[2]: *** [bin/frontend.exe] Error 1
CMakeFiles/Makefile2:196: recipe for target 'frontend/CMakeFiles/frontend.exe.dir/all' failed
make[1]: *** [frontend/CMakeFiles/frontend.exe.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Is it possible to print the intersection elements?

I have compiled and run the frontend.exe iwth kkrt successfully. I tried to supply two csv files to compute the intersection. However, the output file doesn't contain the intersected element but some numbers.
I am running the frontend.exe using
./bin/frontend.exe -kkrt -r 1 -in bob.csv -v
./bin/frontend.exe -kkrt -r 1 -in alice.csv -v

the input files look like this

aaa
bbb
ccc
ddd
eee

the output file looks like this: (I think this stands for the intersection size?)

2
1
0
3
4

Is it possible to print the intersection elements?
Thanks in advance!

Does libPSI support drrt?

l try to run the code ./frontend.exe -drrt, but it shows exception.
"Please add one of the protocol flags, -kkrt, -rr17a, -ecdh"
Does libPSI support drrt?

Is there any examples or demos?

Hi, I cannot find any example codes or demos under this repo, so it's a bit hard for users like me came from Python world to run a specific PSI protocol. So would you please provide some tutorials on how to use this library and how to switch from one protocol to another?

Thanks in advance for your help.

How to runing libPSI on different terminals?

Hello,
Excuse me,How to runing libPSI on different terminals?
When I run on a different terminal and specify the command-line arguments:

server:
./frontend.exe -kkrt -in /tmp/data1.csv -csv -r 0
result is:
waiting for connection.client socket connect error (hangs).
.client socket connect error (hangs).
done

client:
./frontend.exe -kkrt -in /tmp/data2.csv -csv -r 1
It doesn't output anything

Thanks for your early reply!

the test case DktPsi_FullSet_Test_Impl failed

Hi guys,
I enabled the protocol DKT of libPSI then commented all the test cases except the following case in the file UnitTests.cpp
t.add("DktPsi_FullSet_Test_Impl ", DktMPsi_FullSet_Test_Impl);

After building the whole project, and run the command in the directory libPSI/bin
frontend.exe -u

got the following errors:

[dev@localhost bin]$ ./frontend.exe -u
0 - DktPsi_FullSet_Test_Impl Bad sigma Proof 795B6FE39BA1EE290EAE99806AE99A8C90356CE3D9B40DDF7CA6CC24DE3A080D
s sigmaPhis 795B6FE39BA1EE290EAE99806AE99A8C90356CE3D9B40DDF7CA6CC24DE3A080D
s expected (6C17616E4F2BFB525BB81048BD735E2CE82E8A764E7E97CD9A892F07315AF366, C7F8268F77D4182A4DE3138F9C7B2B3F3B08BF62F8B6AB69EA61874C9A710F95, 1 )
s actual (99CFE7A1A10514A068FAE3DA42F9C22B470CB787518A9D4B05E60EBF8B2D6159, D5E0B597A5C449DD18256DE76E4822B6AE0BDCA5ECD56AAD102C8BBABAB5F8A2, 1 )
terminate called without an active exception

I found this error was reported by this file DktMPsiSender.cpp, so was it something wrong with the sender or receiver ? Hope for a reply. Thank you!

build error for dependencies

Hi, I trying to compile LibPSI in ubuntu 20.04 with AUTO_FETCH=ON, then I got those errors:

/home/dengqi/Source/langs/cpp/libPSI/thirdparty/libOTe/cryptoTools/thirdparty/relic/src/md/blake2.h:101:23:
    error: size of array element of type 'blake2s_state' (aka 'struct
    __blake2s_state') (185 bytes) isn't a multiple of its alignment (64 bytes)

  

        blake2s_state S[8][1]
                          ^

  

    
    /home/dengqi/Source/langs/cpp/libPSI/thirdparty/libOTe/cryptoTools/thirdparty/relic/src/md/blake2.h:102:20:
    error: size of array element of type 'blake2s_state' (aka 'struct
    __blake2s_state') (185 bytes) isn't a multiple of its alignment (64 bytes)

  

        blake2s_state R[1]
                       ^

  

    
    /home/dengqi/Source/langs/cpp/libPSI/thirdparty/libOTe/cryptoTools/thirdparty/relic/src/md/blake2.h:109:23:
    error: size of array element of type 'blake2b_state' (aka 'struct
    __blake2b_state') (361 bytes) isn't a multiple of its alignment (64 bytes)

  

        blake2b_state S[4][1]
                          ^

  

    
    /home/dengqi/Source/langs/cpp/libPSI/thirdparty/libOTe/cryptoTools/thirdparty/relic/src/md/blake2.h:110:20:
    error: size of array element of type 'blake2b_state' (aka 'struct
    __blake2b_state') (361 bytes) isn't a multiple of its alignment (64 bytes)

  

        blake2b_state R[1]
                       ^

  

    
    /home/dengqi/Source/langs/cpp/libPSI/thirdparty/libOTe/cryptoTools/thirdparty/relic/src/md/blake2s-ref.c:329:18:
    error: size of array element of type 'blake2s_state' (aka 'struct
    __blake2s_state') (185 bytes) isn't a multiple of its alignment (64 bytes)

  

      blake2s_state S[1]
                     ^

  

    5 errors generated.

the error seems came from the relic library depended by cryptoTools, I try to update the tag of getRelic.cmake to the newest stable version of relic as 0.6.0. Then this error disappear , but there came another error for cryptoTools`:

libPSI/thirdparty/libOTe/cryptoTools/cryptoTools/Crypto/RCurve.cpp:230:9:
  fatal error: use of undeclared identifier 'bn_init'

          bn_init(mVal, static_cast<int>(sizeDigits()))
          ^

  1 error generated.

Then I try to update the version of cryptoTools, but it does not help, and will introduce another errors.

Execute bash build.sh to report an error

-- Relic_LIB: /home/psi/Documents/psi/libOTe/out/install/linux/lib/librelic_s.a
-- Relic_inc: /home/psi/Documents/psi/libOTe/out/install/linux/include

-- SODIUM_INCLUDE_DIRS: /home/psi/Documents/psi/libOTe/out/install/linux/include
-- SODIUM_LIBRARIES: /home/psi/Documents/psi/libOTe/out/install/linux/lib/libsodium.a
-- SODIUM_MONTGOMERY: ON

-- Could NOT find Boost: missing: thread (found /home/psi/Documents/psi/libOTe/out/install/linux/lib/cmake/Boost-1.77.0/BoostConfig.cmake (found suitable version "1.77.0", minimum required is "1.77.0"))
CMake Error at /home/psi/Documents/psi/libOTe/out/build/linux/cryptoTools/cryptoToolsDepHelper.cmake:223 (message):
Failed to find boost 1.77. Add -DFETCH_BOOST=ON or -DFETCH_ALL=ON to auto
download.
Call Stack (most recent call first):
/home/psi/Documents/psi/libOTe/out/build/linux/cryptoTools/cryptoToolsConfig.cmake:22 (include)
/home/psi/Documents/psi/libOTe/out/build/linux/libOTeConfig.cmake:27 (find_package)
/home/psi/Documents/psi/libOTe/cmake/libOTeConfig.cmake:20 (include)
CMakeLists.txt:65 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/psi/Documents/psi/libPSI/out/build/linux/CMakeFiles/CMakeOutput.log".
See also "/home/psi/Documents/psi/libPSI/out/build/linux/CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found. Stop.

How to configure the development environment and debug the source code?

When I tried to do a simple debugging of the source code, I found that there was no way to perform single-step debugging because there were a large number of files that needed to be precompiled. Other functions except the main function have no change after modification.(I have tried to comment out the entire fileBased.cpp file, and then rebuild, but the program can still execute normally and output the result.)
So I would like to ask how to debug libPSI, and what kind of development environment is required? (eg. what is the version of VS)
Looking forward to your answer, thank you.

Wrong spelling

I'm trying KKRT's PSI recently, and i found several wrong spellings in:

libPSI/PSI/Kkrt/KkrtPsiReceiver.cpp,
libPSI/PSI/Kkrt/KkrtPsiSender.cpp

may i pull request to fix them?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.