doc

Homomorphic encryption

HElib

Algorithms in HElib

Fully Homomorphic Encryption without Bootstrapping

其实还是基于RLWE的计算

example

HElib,安装参考 INSTALL.md

将helib安装到~/share/helib目录下

cd HElib
mkdir build
cd build
cmake -DPACKAGE_BUILD=ON -DCMAKE_INSTALL_PREFIX=~/share/helib ..
make -j16
make install

编译BGV_binary_arithmetic

cd HElib/examples/BGV_binary_arithmetic
mkdir build
cd build
cmake -Dhelib_DIR=/home/panll/share/helib/helib_pack/share/cmake/helib ..
make

benchmark

Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

8G DDR3

执行time ./BGV_binary_arithmetic

Initialising context object...
Building modulus chain...
m = 4095, p = 2, phi(m) = 1728
ord(p)=12
normBnd=2.25463
polyNormBnd=22.5545
factors=[3 5 7 13]
generator 2341 has order (== Z_m^*) of 6
generator 3277 has order (== Z_m^*) of 4
generator 911 has order (== Z_m^*) of 6

Security: -94.448
Creating secret key...
Number of slots: 144
Pre-encryption data:
a = 10417
b = 23765
c = 12506
a*b+c = 247572511
a+b+c = 46688
popcnt(a) = 6
./BGV_binary_arithmetic  108.11s user 0.46s system 99% cpu 1:48.85 total

执行 time ./BGV_database_lookup

Initialising context object...
Building modulus chain...
m = 33, p = 131, phi(m) = 20
ord(p)=2
normBnd=1.4602
polyNormBnd=1.77872
factors=[3 11]
generator 5 has order (== Z_m^*) of 10
T = [1 5 25 26 31 23 16 14 4 20 ]

Security: -109.911
Creating secret key...
Generating key-switching matrices...

Number of slots: 10

Please enter a name: Bob
Looking for the address of Bob

Query result: London
./BGV_database_lookup  0.21s user 0.00s system 8% cpu 2.573 total

执行time ./BGV_packed_arithmetic

Initialising context object...
Building modulus chain...
m = 32109, p = 4999, phi(m) = 16560
ord(p)=690
normBnd=2.32723
polyNormBnd=58.2464
factors=[3 7 11 139]
generator 320 has order (== Z_m^*) of 6
generator 3893 has order (== Z_m^*) of 2
generator 14596 has order (== Z_m^*) of 2
T = [1 14596 3893 21407 320 14915 25618 11023 6073 20668 9965 27479 16820 31415 10009 27523 20197 2683 24089 9494 9131 23726 2320 19834 ]

Security: 27.1558
Creating secret key...
Generating key-switching matrices...
Number of slots: 24
Initial Plaintext: [[] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23]]
Decrypted Plaintext: [[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []]
Plaintext version: [[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []]
Decrypted Plaintext: [[2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2]]
./BGV_packed_arithmetic  24.86s user 0.72s system 99% cpu 25.677 total


Published

18 July 2020

Tags


Share On