Giter Site home page Giter Site logo

osu-crypto / bark-oprf Goto Github PK

View Code? Open in Web Editor NEW
76.0 76.0 34.0 2.1 MB

Efficient Batched Oblivious PRF with Applications to Private Set Intersection (CCS 2016)

Home Page: http://eprint.iacr.org/2016/799

License: The Unlicense

C++ 97.64% Makefile 1.66% Dockerfile 0.71%
2psi oprf

bark-oprf's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar

bark-oprf's Issues

Running all_win.ps1 on Windows failed

This is what I got. I suppose boost is messed up somehow but can't quite fix it.

Exception calling "ExtractToDirectory" with "2" argument(s): "Could not find a part of the path 'C:\Users\haoche\Source
\Repos\BaRK-OPRF\thirdparty\win\boost_1_63_0\libs\geometry\doc\html\geometry\reference\spatial_indexes\boost__geometry_
_index__rtree\rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.htm
l'."
At C:\Users\haoche\Source\Repos\BaRK-OPRF\thirdparty\win\getBoost.ps1:34 char:5
+     [io.compression.zipfile]::ExtractToDirectory($destination, $PWD)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : DirectoryNotFoundException

build fails on fresh Ubuntu 16.04 VM

Hi.

Running on Ubuntu 16.04 gcc 5.3. I needed to do two tweaks to link correctly:

  • mpir.get failed silently. when I ran it directly from a console, i saw m4 was missing. best if you state m4 as a requirement and avoid failing silently

  • boost installation also fails silently.

    • I ran the instructions in boost.get manually with the following changes:
      - added libboost_filesystem.a
      - removed "stage
      - added boost path to linker path

Best,

Assi

Build project meet an error

Hello~I study the BaRK-OPRF this time. But when I build the project at ubuntu-20.04 gcc-9.5 cmake-3.20:
when I git clone the package and type python build.py in terminal:

collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:858: libmpir.la] Error 1
make[2]: Leaving directory '/home/starkirby/BaRK-OPRF/BaRK-OPRF/thirdparty/linux/mpir'
make[1]: *** [Makefile:948: all-recursive] Error 1
make[1]: Leaving directory '/home/starkirby/BaRK-OPRF/BaRK-OPRF/thirdparty/linux/mpir'
make: *** [Makefile:744: all] Error 2
all done!

How to solve that? Thank you!

Having trouble with build.

Hi.

I'm trying to build BaRK-OPRF on a fresh Ubuntu install. Here are the commands I executed:
$ git clone https://github.com/osu-crypto/BaRK-OPRF
$ cd BaRK-OPRF/thirdparty/
$ bash all_linux.get
[Get sudo prompt. Enter user (admin)'s password.]
$ cd ..
$ make

I then get the following error:
g++ -ggdb -ffunction-sections -O3 -Wall -std=c++11 -maes -msse2 -msse4.1 -mpclmul -Wfatal-errors -pthread -Wno-narrowing -I./bOPRFlib -I./thirdparty/linux -I./thirdparty/linux/boost/includes -I./thirdparty/linux/miracl -I./thirdparty/linux/mpir -I./thirdparty/linux/cryptopp -std=c++11 -DNDEBUG -DRELEASE -c bOPRFlib/Crypto/PRNG.cpp -o Release/./bOPRFlib/Crypto/PRNG.o -MD -MF Release/./bOPRFlib/Crypto/PRNG.dep
bOPRFlib/Crypto/PRNG.cpp: In member function ‘void bOPRF::PRNG::refillBuffer()’:
bOPRFlib/Crypto/PRNG.cpp:152:50: error: ‘_mm_cvtsi64_si128’ was not declared in this scope
mIndexArray[i] = _mm_cvtsi64_si128(mBlockIdx++);
^
compilation terminated due to -Wfatal-errors.
makefile:119: recipe for target 'Release/./bOPRFlib/Crypto/PRNG.o' failed
make: *** [Release/./bOPRFlib/Crypto/PRNG.o] Error 1

Any idea what is going wrong here? Or how I can fix it?

compile on arm64 error

g++ -o Release/bOPRFmain.exe -Wl,-gc-sections -pthread -LRelease -L/root/compile/kkrt16/bark-oprf/Release -L./thirdparty/linux/boost/stage/lib -L./thirdparty/linux/cryptopp -L./thirdparty/linux/miracl/miracl_osmt/source -L./thirdparty/linux/miracl/miracl/source -L./thirdparty/linux/mpir/.libs -L./thirdparty/linux/ntl/src -L./bin/ -Wl,--start-group Release/./bOPRFlib/Common/BitIterator.o Release/./bOPRFlib/Common/BitVector.o Release/./bOPRFlib/Common/ByteStream.o Release/./bOPRFlib/Common/Defines.o Release/./bOPRFlib/Common/Log.o Release/./bOPRFlib/Common/Timer.o Release/./bOPRFlib/Crypto/AES.o Release/./bOPRFlib/Crypto/Commit.o Release/./bOPRFlib/Crypto/PRNG.o Release/./bOPRFlib/Crypto/sha1.o Release/./bOPRFlib/PSI/BopPsiReceiver.o Release/./bOPRFlib/PSI/BopPsiSender.o Release/./bOPRFlib/PSI/CuckooHasher.o Release/./bOPRFlib/PSI/SimpleHasher.o Release/./bOPRFlib/OT/BaseSSOT.o Release/./bOPRFlib/OT/IknpOtExtReceiver4k.o Release/./bOPRFlib/OT/IknpOtExtSender4k.o Release/./bOPRFlib/OT/SSOTReceiver.o Release/./bOPRFlib/OT/SSOTSender.o Release/./bOPRFlib/OT/Base/BaseOT.o Release/./bOPRFlib/OT/Base/naor-pinkas.o Release/./bOPRFlib/OT/Base/PvwBaseOT.o Release/./bOPRFlib/OT/Base/Tools.o Release/./bOPRFlib/OT/Base/Math/bigint.o Release/./bOPRFlib/OT/Base/Math/DMC.o Release/./bOPRFlib/OT/Base/Math/modp.o Release/./bOPRFlib/OT/Base/Math/Zp_Data.o Release/./bOPRFlib/OT/Base/crypto/crypto.o Release/./bOPRFlib/OT/Base/crypto/ecc-pk-crypto.o Release/./bOPRFlib/Network/BtAcceptor.o Release/./bOPRFlib/Network/BtChannel.o Release/./bOPRFlib/Network/BtEndpoint.o Release/./bOPRFlib/Network/BtIOService.o Release/./bOPRFlib/Network/Channel.o Release/./bOPRFmain/main.o
-Wl,-Bstatic -lmiracl -lboost_system -lboost_filesystem -lboost_thread -lmpir -lcryptopp -lbOPRF -lmiracl
-Wl,-Bdynamic -lpthread -lrt
-Wl,--as-needed -Wl,--end-group
/usr/bin/ld: Release/./bOPRFlib/OT/Base/BaseOT.o: in function Miracl::Miracl(int, unsigned int)': /root/compile/kkrt16/bark-oprf/./thirdparty/linux/miracl/miracl/include/big.h:129: undefined reference to mirsys'
/usr/bin/ld: Release/./bOPRFlib/OT/Base/BaseOT.o: in function _GLOBAL__sub_I__ZN5bOPRF10precision2E': /root/compile/kkrt16/bark-oprf/bOPRFlib/OT/Base/BaseOT.cpp:10: undefined reference to mr_init_threading'
/usr/bin/ld: Release/./bOPRFlib/OT/Base/crypto/ecc-pk-crypto.o: in function ecc_num::set_si(int)': /root/compile/kkrt16/bark-oprf/bOPRFlib/OT/Base/crypto/ecc-pk-crypto.cpp:231: undefined reference to convert'
/usr/bin/ld: Release/./bOPRFlib/OT/Base/crypto/ecc-pk-crypto.o: in function Big::Big()': /root/compile/kkrt16/bark-oprf/./thirdparty/linux/miracl/miracl/include/big.h:173: undefined reference to mirvar'
/usr/bin/ld: /root/compile/kkrt16/bark-oprf/./thirdparty/linux/miracl/miracl/include/big.h:173: undefined reference to mirvar' /usr/bin/ld: /root/compile/kkrt16/bark-oprf/./thirdparty/linux/miracl/miracl/include/big.h:173: undefined reference to mirvar'
/usr/bin/ld: Release/./bOPRFlib/OT/Base/crypto/ecc-pk-crypto.o: in function Big::operator=(int)': /root/compile/kkrt16/bark-oprf/./thirdparty/linux/miracl/miracl/include/big.h:202: undefined reference to convert'
/usr/bin/ld: Release/./bOPRFlib/OT/Base/crypto/ecc-pk-crypto.o: in function ecc_field::init(securitylevel, unsigned char*)': /root/compile/kkrt16/bark-oprf/bOPRFlib/OT/Base/crypto/ecc-pk-crypto.cpp:53: undefined reference to irand'

thanks.

Making without sudo privileges

Hi

I'm trying to install BaRK-OPRF on an Ubuntu system on which I do not have sudo privileges. Is this possible?

Here is what I tried. I looked at thirdparty/all_linux.get. I saw that it uses sudo to install certain libraries. Most of these were already installed:
$ which bzip2
/bin/bzip2
$ which unzip
/usr/bin/unzip
$ which m4
/usr/bin/m4

I assume the command "sudo apt-get install gcc-c++" installs g++ and/or gcc, both of which are installed.
$ gcc --version
gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
$ g++ --version
g++ (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005

The remaining sudo command is to "apt-get install libboost-all-dev". I was not able to run this. But I saw that there seem to be some commands to install libboost locally, so I skipped over this and hoped for the best.

I ran:
$ bash all_linux.get
I then CTRL-C'ed over all of the sudo commands.

I then navigated to BaRK-OPRF path and ran:
$ make

At first I experienced something to the effect of the following error when running all_linux.get:
wake.cpp: 34:15 narrowing conversion of "38...420u" from "unsigned int" to "int" inside { } [-Wnarrowing].
When I then tried to run make this resulted in the error:
error: "cannot find -lcryptopp"
I modified the source file cryptopp/wake.cpp line 26 to make the tt[] array an unsigned int. I then ran make inside the cryptopp directory again. This solved this error.

I then experienced an error when I ran make:
error: "cannot find -lboost_filesystem".
I modified boost.get, line 15, to include --with-filesystem:
./b2 stage --with-system --with-thread --with-filesystem link=static -mt
I removed the boost directory and re-ran boost.get
$ bash boost.get
This fixed this error.

However when I ran make again I got the following error:
/usr/bin/ld: ./thirdparty/linux/miracl/miracl_osmt/source/libmiracl.a(mrcore.o): relocation R_X86_64_32 against symbol `mr_key' can not be used when making a shared object; recompile with -fPIC

For this one I am at a loss. Any ideas what I need to do? Is what I'm trying to do possible?

Note: The reason in my previous question I asked about installing on a vm is that I was having trouble installing on this environment in which I don't have sudo privileges, so I tried first to install on an environment where I did have sudo privileges (a vm).

An Issue about the Code

Hi! Thank you for offering the source code!
I'm studying PSI and OPRF these days and I have read the paper about BaRK-OPRF. I have a problem about the program, so can you tell me the reason and the way to solve it?

issue

build problems

Hello, an error occurred while running this program, as follows:
image
image
I look forward to your reply. Thank you very much!

the Data Type “block”

Hello! I'm trying to modify the file main.cpp for inputting my own datasets. However, I find the input datatype in BopTest() to be "block". So what does the type "block" refer to? And how to change other data types( for example, string) to "block"? Thank you!

Having trouble building the project

I am having trouble with the mpir dependency and was wondering if you had run into this issue previously. When I run make, I get the following output:
g++ -ggdb -ffunction-sections -O3 -Wall -std=c++11 -maes -msse2 -msse4.1 -mpclmul -Wfatal-errors -pthread -Wno-narrowing -I./bOPRFlib -I./thirdparty/linux -I./thirdparty/linux/boost/includes -I./thirdparty/linux/miracl -I./thirdparty/linux/mpir -I./thirdparty/linux/cryptopp -std=c++11 -DNDEBUG -DRELEASE -c bOPRFlib/Common/ByteStream.cpp -o Release/./bOPRFlib/Common/ByteStream.o -MD -MF Release/./bOPRFlib/Common/ByteStream.dep In file included from ./bOPRFlib/OT/Base/Math/modp.h:17:0, from ./bOPRFlib/Crypto/PRNG.h:2, from ./bOPRFlib/Crypto/Commit.h:5, from bOPRFlib/Common/ByteStream.cpp:5: ./bOPRFlib/OT/Base/Math/bigint.h:14:25: fatal error: mpir/mpirxx.h: No such file or directory #include "mpir/mpirxx.h" ^ compilation terminated. make: *** [Release/./bOPRFlib/Common/ByteStream.o] Error 1

batch processing

Thanks for your open source code!
When I read this code, I found that there is a batch processing in the SSOTSender.cpp(SSOTReceiver.cpp). Instead of sending a message of m length, this code send BASE_OT_COUNT length for each batches. But the "mGens" is always same in each batches, which means that there will be a lot of identical outputs of the OPRF. Did I miss any details that make me got this false conclusion? Or it's some trick of achieving the fast implementation?

miracle_osmt library

Thanks for providing the source code.
However, I got this error when I tried to compile the code. Any idea on how to fix it?

/usr/bin/ld: ./thirdparty/linux/miracl/miracl_osmt/source/libmiracl.a(mrcore.o): relocation R_X86_64_32 against symbol `mr_key' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ./thirdparty/linux/miracl/miracl_osmt/source/libmiracl.a(mrgf2m.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE

I used: g++ (GCC) 10.2.0

How to understand the output intersection?

Hello,

I set senderSize = (1 << 3) and recverSize = (1 << 3) , and run BopTest(), the output recvPSIs.mIntersection is [6, 3], not the elements in sendSet and recvSet. What is the meaning of [6, 3], how to understand the output intersection?

Compilation having an error

Thanks for providing the source code.
I found an error when compilating the code. as follow

./bOPRFlib/Network/BtSocket.h:75:3: error: invalid use of template-name ‘boost::asio::strand’ without an argument list
boost::asio::strand mSendStrand, mRecvStrand;
compilation terminated due to -Wfatal-errors.
makefile:119: recipe for target 'Release/./bOPRFlib/Network/BtEndpoint.o' failed
make: *** [Release/./bOPRFlib/Network/BtEndpoint.o] Error 1

How can i do?

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.