ilachill / mk-tfhe Goto Github PK
View Code? Open in Web Editor NEWMulti-Key Homomophic Encryption from TFHE
License: Apache License 2.0
Multi-Key Homomophic Encryption from TFHE
License: Apache License 2.0
I ran:
mkdir build
cd build
cmake ../src -DENABLE_TESTS=on -DENABLE_FFTW=on -DCMAKE_BUILD_TYPE=debug
make
and get errors below:
make -C build make[1]: Entering directory '/home/jamesdang/MK-TFHE-master/build' -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) -- Could NOT find FFTW (missing: FFTW_LIBRARIES FFTW_INCLUDES) CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: FFTW_LIBRARIES (ADVANCED) linked by target "tfhe-fftw" in directory /home/jamesdang/MK-TFHE-master/src/libtfhe linked by target "unittests-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "testMkExternalProduct-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "test-gate-bootstrapping-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "test-decomp-tgsw-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "test-bootstrapping-fft-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "test-multiplication-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "test-tlwe-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "test-lwe-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "testMKbootNAND_FFT_details-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "test-addition-boot-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "test-long-run-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "testMKbootNAND-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "testMKbootNAND_FFT-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test linked by target "test-c-binding-fftw" in directory /home/jamesdang/MK-TFHE-master/src/test -- Configuring incomplete, errors occurred! See also "/home/jamesdang/MK-TFHE-master/build/CMakeFiles/CMakeOutput.log". See also "/home/jamesdang/MK-TFHE-master/build/CMakeFiles/CMakeError.log". make[1]: *** [Makefile:308: cmake_check_build_system] Error 1 make[1]: Leaving directory '/home/jamesdang/MK-TFHE-master/build' make: *** [Makefile:9: all] Error 2
I am new here. Please help!
The accumulated variance is not copied to the MKLweSample result value returned by MKlweKeySwitch() in mkTFHEfunctions.cpp. The attached patch fixes this.
Regards
Andreas
can u provide compilation command
running "make" gives me an error
/Users/haochen/Documents/Libraries/MK-TFHE/src/libtfhe/fft_processors/nayuki/fft_processor_nayuki.cpp:15:35: error:
implicit conversion from '_Complex double' to 'double' is not permitted in
C++
omegaxminus1[x]=cos(xM_PI/N)-1. + sin(xM_PI/N) * 1i;
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
1 error generated.
make[3]: *** [libtfhe/fft_processors/nayuki/CMakeFiles/tfhe-fft-nayuki-portable.dir/fft_processor_nayuki.cpp.o] Error 1
make[2]: *** [libtfhe/fft_processors/nayuki/CMakeFiles/tfhe-fft-nayuki-portable.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
If the number of trials is increased from 100 to 1000 in the testMKbootNAND_FFT_details test scenario using the external FFTW library then 5 decryption errors occur after the blindRotate operation as the following log excerpt shows testMKbootNAND_FFT_details-fftw.log
A bit error rate of 0.5% is just not acceptable for any serious multi-key application, so I'm hoping either for a fix in the MK-THFE software implementation or in the blindRotate algorithm itself.
The same 5 decryption errors also occur if the non-FFT version testMKbootNAND is used.
If alternatively the built-in spqlios-avx and nayuki-avx FFT implementations are used then even 12 and 15 errors, respectively, occur.
Using existing NAND operator function provided,
we pass in a integer value 2 instead of 1
we get this:
Message 1: clear = 2, decrypted = 1
Message 2: clear = 2, decrypted = 1
How can we pass in value beyond 1 bit?
Compiling branch Master under Ubuntu 20.04, gcc version 9.3.0, gives errors for tests which use the same pointer as 1st and 2nd parameters, e.g. sub4(tmp0, tmp0, tmp3);
.
$ gcc --version
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
[ 1%] Building CXX object libtfhe/fft_processors/spqlios/CMakeFiles/tfhe-fft-spqlios-fma.dir/spqlios-fft-impl.cpp.o
/mnt/hd1/geneial/project/MK-TFHE/src/libtfhe/fft_processors/spqlios/spqlios-fft-impl.cpp: In function ‘void fft_model(const void*)’:
/mnt/hd1/geneial/project/MK-TFHE/src/libtfhe/fft_processors/spqlios/spqlios-fft-impl.cpp:347:32: error: ‘-Werror=restrict’ is not an option that controls warnings [-Werror=pragmas]
347 | #pragma GCC diagnostic ignored "-Werror=restrict"
| ^~~~~~~~~~~~~~~~~~
/mnt/hd1/geneial/project/MK-TFHE/src/libtfhe/fft_processors/spqlios/spqlios-fft-impl.cpp:352:22: error: passing argument 1 to restrict-qualified parameter aliases with argument 2 [-Werror=restrict]
352 | sub4(tmp0, tmp0, tmp3); // re2
| ^~~~ ~~~~
/mnt/hd1/geneial/project/MK-TFHE/src/libtfhe/fft_processors/spqlios/spqlios-fft-impl.cpp:353:22: error: passing argument 1 to restrict-qualified parameter aliases with argument 2 [-Werror=restrict]
353 | add4(tmp1, tmp1, tmp2); // im2
| ^~~~ ~~~~
/mnt/hd1/geneial/project/MK-TFHE/src/libtfhe/fft_processors/spqlios/spqlios-fft-impl.cpp:356:22: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
356 | sub4(tmp0, re0, tmp0); // re - re
| ^~~~ ~~~~
/mnt/hd1/geneial/project/MK-TFHE/src/libtfhe/fft_processors/spqlios/spqlios-fft-impl.cpp:357:22: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
357 | sub4(tmp1, im0, tmp1); // im - im
| ^~~~ ~~~~
cc1plus: all warnings being treated as errors
Fix by adding GCC pragmas (other platforms may require alternate fixes) around the offending code (lines 346...359):
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
dotp4(tmp0, re1, tcs); // re*cos
dotp4(tmp1, re1, tsn); // re*sin
dotp4(tmp2, im1, tcs); // im*cos
dotp4(tmp3, im1, tsn); // im*sin
sub4(tmp0, tmp0, tmp3); // re2
add4(tmp1, tmp1, tmp2); // im2
add4(tmp2, re0, tmp0); // re + re
add4(tmp3, im0, tmp1); // im + im
sub4(tmp0, re0, tmp0); // re - re
sub4(tmp1, im0, tmp1); // im - im
copy4(re0, tmp2);
copy4(im0, tmp3);
copy4(re1, tmp0);
copy4(im1, tmp1);
#pragma GCC diagnostic pop
I tried to implement MUX gate with using this new MK algo.
There is no issue with AND, ANDNY and OR gates.
But errors appears when directly pass u1 and u2 over OR gates.
Errors are not consistence via different trials.
example passing 1, 1, 1, into MUX
sometime, we get logic 0, sometime we get logic 1.
How to go about adjusting the parameters and the parties values?
Parties = 1 has the least problem.
Lots of errors with Parties = 2
AVX and FMA gives different results as well.
According to the paper, which set of parameter is this, set 3?
Hi I am doing my project.I should use this MK-TFHE model to encrypt my own data,how can I do it?I have no idea about this question,if there have someone can tell Sth about it?
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.