chiraag / gazelle_mpc Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Did you use regular (chosen) OT or correlated OT for the OT extension in your implementation? The code for IKNPSender::send
seems to implement regular (chosen) OT, but also labels the OT extension files "cot_recv" and "cot_send", and "cot" is often used to represent correlated OT. cot_send.h also has a set_delta
function and a block mDelta
variable which I think are used with correlated OT, but the library never seems to use either of these.
Thanks!
we con't understand some parameters in your code,such as n_circ.could you please add annotates?
I understand there does not seem to be any code in this library for loading neural network weights and running inference.
I could implement this myself, but I am unsure how I am supposed to deal with rational numbers, since all the examples work on random integers. Naively, I would store the weights and inputs in integer variables, keep track of a scaling factor for each weight and input, and then finally interpret the result as a fixed point number, where the scaling factor is the product of the scaling factors for each weight.
It would be awesome if someone could confirm, whether this is somewhat correct.
Is there some tests to reproduce the numbers in the paper?
The actual encryption function should multiply the polynomials, but seems the code is performing coefficient-wise multiply
gazelle_mpc/src/lib/pke/fv.cpp
Lines 53 to 61 in f4eb3ba
We read the codes, but we did not find the way to test your entire network, please show us more information, thanks.
Hi, I think there is a bug in SHLCircuit() and SHRCircuit() functions in src/lib/gc/circuits.cpp:
in SHLCircuit():
for(ui64 i=shift; i<n; i++){
out[i] = in[i-1];
}
should be
for(ui64 i=shift; i<n; i++){
out[i] = in[i-shift];
}
and in SHRCircuit():
for(ui64 i=0; i<(n-shift); i++){
out[i] = in[i+1];
}
should be :
for(ui64 i=0; i<(n-shift); i++){
out[i] = in[i+shift];
}
Otherwise, the shift won't be performed correctly
When I try to run the conv1d-benchmark, I get a segmentation fault. This is the command line output:
~/test_gazelle/gazelle_mpc$ ./bin/demo/ahe/conv1d-benchmark
NN Layers Benchmark (ms):
KeyGen (3 keys): 6.5802
Preprocess Vector (2 windows): 0.62092
Preprocess Filter: 0.930723
Segmentation fault (core dumped)
Do you have any idea what goes wrong here? Thanks
PS: I build gazelle as you instruct and the other demo scrips work fine
Hi chiraag, I'm trying to compile gazelle on ubuntu 20.04 LTS. But there is a problem when I use make -j8
. I have Installed cryptotools successfully. My boost version is 1.64.0. I get the following log.
/home/project/gazelle/gazelle_mpc# make -j8
-- core:linking bin/lib/libgazelle.so from COREOBJECTS
mkdir -p bin/lib
g++ -std=c++14 -fPIC -fPIC -shared -Wl,--export-dynamic,-z,defs -Lthird_party/cryptoTools/thirdparty/linux/miracl/miracl/source -Lthird_party/cryptoTools/lib -o bin/lib/libgazelle.so src/bin/lib/gc/aescircuits.o src/bin/lib/gc/circuits.o src/bin/lib/gc/common.o src/bin/lib/gc/gates.o src/bin/lib/gc/gazelle_circuits.o src/bin/lib/gc/gc.o src/bin/lib/gc/util.o src/bin/lib/math/automorph.o src/bin/lib/math/bit_twiddle.o src/bin/lib/math/discretegaussiangenerator.o src/bin/lib/math/distributiongenerator.o src/bin/lib/math/nbtheory.o src/bin/lib/math/params.o src/bin/lib/math/transfrm.o src/bin/lib/ot/cot_recv.o src/bin/lib/ot/cot_send.o src/bin/lib/ot/sr_base_ot.o src/bin/lib/ot/tools.o src/bin/lib/pke/conv1d.o src/bin/lib/pke/conv2d.o src/bin/lib/pke/encoding.o src/bin/lib/pke/fv.o src/bin/lib/pke/gemm.o src/bin/lib/pke/layers.o src/bin/lib/pke/mat_mul.o src/bin/lib/pke/square.o src/bin/lib/utils/debug.o src/bin/lib/utils/network.o src/bin/lib/utils/test.o -pthread -lcryptoTools -lmiracl -lboost_system -lboost_thread
/usr/bin/ld: src/bin/lib/gc/aescircuits.o: in function `_GLOBAL__sub_I_aescircuits.cpp':
aescircuits.cpp:(.text.startup+0x35): undefined reference to `boost::system::generic_category()'
/usr/bin/ld: aescircuits.cpp:(.text.startup+0x3a): undefined reference to `boost::system::generic_category()'
/usr/bin/ld: aescircuits.cpp:(.text.startup+0x3f): undefined reference to `boost::system::system_category()'
......
SocketAdapter.cpp:(.text.startup._GLOBAL__sub_I_SocketAdapter.cpp+0x6): undefined reference to `boost::system::generic_category()'
/usr/bin/ld: SocketAdapter.cpp:(.text.startup._GLOBAL__sub_I_SocketAdapter.cpp+0xb): undefined reference to `boost::system::generic_category()'
/usr/bin/ld: SocketAdapter.cpp:(.text.startup._GLOBAL__sub_I_SocketAdapter.cpp+0x10): undefined reference to `boost::system::system_category()'
/usr/bin/ld: SocketAdapter.cpp:(.text.startup._GLOBAL__sub_I_SocketAdapter.cpp+0x15): undefined reference to `boost::system::system_category()'
/usr/bin/ld: third_party/cryptoTools/thirdparty/linux/miracl/miracl/source/libmiracl.a(mrcore.o): relocation R_X86_64_PC32 against symbol `stdout@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile.src:37: bin/lib/libgazelle.so] Error 1
One of the most common solutions is to add -lboost_system
flag, but the flag was added.
g++ -std=c++14 -fPIC -fPIC -shared -Wl,--export-dynamic,-z,defs -Lthird_party/cryptoTools/thirdparty/linux/miracl/miracl/source -Lthird_party/cryptoTools/lib -o bin/lib/libgazelle.so src/bin/lib/gc/aescircuits.o src/bin/lib/gc/circuits.o src/bin/lib/gc/common.o src/bin/lib/gc/gates.o src/bin/lib/gc/gazelle_circuits.o src/bin/lib/gc/gc.o src/bin/lib/gc/util.o src/bin/lib/math/automorph.o src/bin/lib/math/bit_twiddle.o src/bin/lib/math/discretegaussiangenerator.o src/bin/lib/math/distributiongenerator.o src/bin/lib/math/nbtheory.o src/bin/lib/math/params.o src/bin/lib/math/transfrm.o src/bin/lib/ot/cot_recv.o src/bin/lib/ot/cot_send.o src/bin/lib/ot/sr_base_ot.o src/bin/lib/ot/tools.o src/bin/lib/pke/conv1d.o src/bin/lib/pke/conv2d.o src/bin/lib/pke/encoding.o src/bin/lib/pke/fv.o src/bin/lib/pke/gemm.o src/bin/lib/pke/layers.o src/bin/lib/pke/mat_mul.o src/bin/lib/pke/square.o src/bin/lib/utils/debug.o src/bin/lib/utils/network.o src/bin/lib/utils/test.o -pthread -lcryptoTools -lmiracl -lboost_system -lboost_thread
Do you have any suggestions? Thank you in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.