Giter Club home page Giter Club logo

mk-tfhe's People

Contributors

ilachill 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mk-tfhe's Issues

Compile Error on Ubuntu

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!

compile error on mac

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

blindRotate bit errors in testMKbootNAND test scenarios

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.

Beyond 1 bit encryption and decryption for Multi-key?

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?

Disable 'restricted' warning in spqlios-fft-impl.cpp

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

MUX gate

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.

Parameters and Parties

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?

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.