Giter Site home page Giter Site logo

homenc / helib Goto Github PK

View Code? Open in Web Editor NEW
3.1K 192.0 760.0 12.93 MB

HElib is an open-source software library that implements homomorphic encryption. It supports the BGV scheme with bootstrapping and the Approximate Number CKKS scheme. HElib also includes optimizations for efficient homomorphic evaluation, focusing on effective use of ciphertext packing techniques and on the Gentry-Halevi-Smart optimizations.

Home Page: https://homenc.github.io/HElib

License: Other

C++ 92.69% Objective-C 0.84% Makefile 0.26% C 0.13% CMake 2.00% Python 0.83% Shell 3.11% Sage 0.14%
helib privacy-enhancing-technologies cryptography privacy-by-design encryption-library encryption crypto-library crypto bgv

helib's Introduction

HElib

Build and Test

HElib is an open-source (Apache License v2.0) software library that implements homomorphic encryption (HE). Currently available schemes are the implementations of the Brakerski-Gentry-Vaikuntanathan (BGV) scheme with bootstrapping and the Approximate Number scheme of Cheon-Kim-Kim-Song (CKKS), along with many optimizations to make homomorphic evaluation run faster, focusing mostly on effective use of the Smart-Vercauteren ciphertext packing techniques and the Gentry-Halevi-Smart optimizations. See this report for a description of a few of the algorithms using in this library.

Please refer to CKKS-security.md for the latest discussion on the security of the CKKS scheme implementation in HElib.

Since mid-2018 HElib has been under extensive refactoring for Reliability, Robustness & Serviceability, Performance, and most importantly Usability for researchers and developers working on HE and its uses.

HElib supports an "assembly language for HE", providing low-level routines (set, add, multiply, shift, etc.), sophisticated automatic noise management, improved BGV bootstrapping, multi-threading, and also support for Ptxt (plaintext) objects which mimics the functionality of Ctxt (ciphertext) objects. The report Design and implementation of HElib contains additional details. Also, see CHANGES.md for more information on the HElib releases.

Full installation instructions and a list of the required dependencies can be found in INSTALL.md.

For guidance in getting started programming with HElib, take a look at the example programs and our CKKS tutorials located in the examples directory. See examples/README.md.

If you are interested in contributing to HElib, please read our Contributing Guidelines.

HElib is written in C++17 and uses the NTL mathematical library.
HElib is distributed under the terms of the Apache License v2.0.

helib's People

Contributors

ajagann avatar alebcay avatar alexanderviand avatar berserkr avatar boev avatar dnat112 avatar dubek avatar esteffin avatar faberga avatar fboemer avatar fionser avatar guillermo avatar hamishun avatar jlhcrawford avatar joechrysler avatar jubalh avatar mhillenbrand avatar nanxiao avatar olimasters avatar otto-aa avatar sajetan avatar shaih avatar tabog avatar victorshoup avatar wfus avatar xueyumusic 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

helib's Issues

Segmentation fault in Test_General

Has anyone got an idea why I get the following segmentation fault, when running Test_General

*** Bound N=6928, choosing m=8191, phi(m)=8190
*** TestIt: R=1, p=2, r=1, d=1, c=2, k=80, w=64, L=6, m=8191
m = 8191, p = 2, phi(m) = 8190
ord(p)=13
generator 39 has order (== Z_m^*) of 630

Program received signal SIGSEGV, Segmentation fault.
0x000000000040818b in cloned_ptr<IndexMapInit<NTL::Vec >, deep_clone<IndexMapInit<NTL::Vec > > >::~cloned_ptr() ()
(gdb)

division by zero crash

Hi,

I'm trying to set r=32 (I want to have arithmetic over 32-bit integers), but doing so runs into a division by zero error on decryption:

$ gdb --args ./Test_General_x R=1 k=10 p=2 r=32 d=1
[...]
Program received signal SIGABRT, Aborted.
0x00007ffff6db3425 in __GI_raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff6db3425 in __GI_raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff6db6b8b in __GI_abort () at abort.c:91
#2 0x000000000050f39e in _ntl_abort ()
#3 0x00000000004bcf6a in _ntl_gsmod ()
#4 0x000000000040a72d in rem (b=0, a=...) at /home/stephentu/ntl-6.0.0-bin/include/NTL/ZZ.h:536
#5 operator% (b=0, a=...) at /home/stephentu/ntl-6.0.0-bin/include/NTL/ZZ.h:562
#6 PolyRed (out=..., in=..., q=0, abs=true) at NumbTh.cpp:295
#7 0x000000000042f258 in PolyRed (abs=true, q=0, F=...) at NumbTh.h:136
#8 FHESecKey::Decrypt (this=0x7fffffffe050, plaintxt=..., ciphertxt=..., f=...) at FHE.cpp:641
#9 0x000000000042f3a5 in FHESecKey::Decrypt (this=, plaintxt=..., ciphertxt=...) at FHE.cpp:591
#10 0x0000000000443e7a in genericDecrypt (array=..., sKey=..., ctxt=..., this=0x7dcda0) at EncryptedArray.h:293
#11 EncryptedArrayDerived<PA_zz_p>::decrypt (this=0x7dcda0, ctxt=..., sKey=..., ptxt=...) at EncryptedArray.h:226
#12 0x0000000000405d78 in decrypt (ptxt=..., sKey=..., ctxt=..., this=0x7fffffffdb70) at EncryptedArray.h:387
#13 TestIt (R=R@entry=1, p=p@entry=2, r=r@entry=32, d=d@entry=1, c=c@entry=2, k=k@entry=10, w=w@entry=64, L=L@entry=4, m=3133) at Test_General.cpp:163
#14 0x00000000004036d9 in main (argc=, argv=) at Test_General.cpp:233

I'm not sure if this is a bug in the library, or just an error in the parameter selection. Any hints?

Is this library maintained right now?

Hi, just want to check if this library is abandoned or not, since it has been more than 6 months since the last commit. Is there any future plan with it? Is there any new theoretical schemes to be implemented other than BGV?

Assertion `empty(s1 & map.getIndexSet())' failed.

When i am trying to multiply and add some ciphertexts i get this error :

DoubleCRT.cpp:269: double DoubleCRT::addPrimesAndScale(const IndexSet&): Assertion `empty(s1 & map.getIndexSet())' failed.

Anyone knows what could be the problem ?
Thank you.

Segfaults after making HElib with FHE_DCRT_THREADS and FHE_BOOT_THREADS

After making with FHE_DCRT_THREADS, segfaults at the first ./Test_General_x in the make check. (don't have the logs, can post later).

After making with FHE_BOOT_THREADS:
./Test_EvalMap_x mvec="[7 3 221]" gens="[3979 3095 3760]" ords="[6 2 -8]"
*** TestIt: p=2, r=1, c=2, k=80, w=64, L=6, mvec=[7 3 221]
m = 4641, p = 2, phi(m) = 2304
ord(p)=24
generator 3979 has order (== Z_m^) of 6
generator 3095 has order (== Z_m^
) of 2
generator 3760 has order (!= Z_m^*) of 8
T = [1 3760 1114 2458 1849 22 3823 1303 3095 2213 4208 911 302 3116 2276 4397 3979 3097 451 1795 1186 4000 3160 640 2432 1550 3545 248 4280 2453 1613 3734 1990 1108 3103 4447 3838 2011 1171 3292 443 4202 1556 2900 2291 464 4265 1745 664 4423 1777 3121 2512 685 4486 1966 3758 2876 230 1574 965 3779 2939 419 1327 445 2440 3784 3175 1348 508 2629 4421 3539 893 2237 1628 4442 3602 1082 3316 2434 4429 1132 523 3337 2497 4618 1769 887 2882 4226 3617 1790 950 3071 ]

generating key-switching matrices... done
init, level=4, log(noise/modulus)~-66.4259
build EvalMap
apply EvalMap
Segmentation fault (core dumped)

make checks succeed without either option with these CFLAGS:
CFLAGS = -g -O2 -std=c++11 -DEVALMAP_CACHED=1 -pthread -DFHE_THREADS

My system is an x86_64 (i7), running 64 bit kernel (3.19.5-200.fc21.x86_64). Fedora 21 chrooted into an Ubuntu 14.04 dev environment.

Nslots size

I wanted to know,How is this Nslots calculated.Because when i tried to encrypt a file greater than 280 bytes.it does not happen.Is 280 the limit size of the file?.
My input parameters were.
m=0
p=3001
r=1
L=16
c=3
w=64
d=0
security=128.

HElib on Windows

I am trying to install/compile HElib on Windows using VS2008 with no luck. Can someone provide instructions on how to do that. Thx.

Unexpected semantics of multiply

It appears Ctxt::operator* and Ctxt::multiplyBy are intentionally different operations, though where this is in the paper or the source documentation is a mystery to me. I see that one is "higher-level ... that include also modulus-switching and re-linearization".

Perhaps this is an error in my expectation of exactly what amount of crypto knowledge the library intends to assume is necessary for the user.

FHESecKey::Encrypt() produces wrong ciphertext

The following code:

Ctxt myCtxt(pubKey, context.alMod.getPPowR());
secKey.Encrypt(myCtxt, ptxtPoly);

produces a wrong encryptiong of ptxtPoly. This happens because myCtxt.ctxtPrimes is empty so the line:

long QmodP = rem(context.productOfPrimes(ctxt.primeSet), ptxtSpace);

inside FHESecKey::Encrypt(), always gives the value QmodP=1.
My suggestion is to change the above line with the following:

long QmodP = rem(context.productOfPrimes(context.ctxtPrimes), ptxtSpace);

That way the encryption should be correct.

Maybe the method is correct and the user should set the primeSet of Ctxt prior to calling it. But primeSet is private and I don't see any method to access it.

Installation/Compilation of HElib

I have some problem in Installation/compilation of HElib in my ubuntu linux
main error: cc1plus: error: unrecognized command line option ‘-std=c++11’
and also: NumbTh.h:118:16: error: variable or field ‘factorize’ declared void

Is it possible to do a 'greater than' comparison on two ciphertexts?

Apologies if this is not the proper place to ask such question.

Looking at the API, I found this function in NumbTh.h

long    argmax (vector< long > &v, bool(*moreThan)(long, long))
A variant with a specialized comparison function (*moreThan)(a,b) returns the comparison a>b. 

I wish to know if the value of ciphertext a is greater than ciphertext b. Would I have to implement such a function? And if so, could I have any hints?

Use of AES implementation on HElib

I'm trying to use the AES implementation over HElib and I would like to be able to do operation like addition and multiplication on ciphertext after the encryption of an AES(m) over homomorphic encryption.
On simple HE encryption the operations are made over the object Ctxt but when we use the implementation of AES all the cipher text are vector of Ctxt and I can't figure it out how I can manupilate those vector.
Based on Test_AES.cpp I tried to encrypte a vector of 1 like this:

Vec<uint8_t> ptxt(INIT_SIZE,nBlocks*16); //Vector of 1
vector<Ctxt> doublyEncrypted;
hAES.homAESenc(doublyEncrypted,encryptedAESkey,ptxt); // Encryption of the vector store
                                                      //in doublyEncrypted

So normaly we have doublyEncrypted = Enc_HE(Enc_AES(myvector))
Now the decryption

hAES.homeAESdec(doublyEncrypted,encryptedAESkey);

and now doublyEncrypted = Enc_HE(myvector). At this point I should be able to do some operation on my encrypted vector. As doublyEncrypted is a vector of Ctxt I tried something like:

for(long i=0;i<(long)doublyEncrypted.size();i++){
    doublyEncrypted[i].addCtxt(doublyEncrypted[i]);
}

But when I decrypt it with the secret key and decode it all a got is a vector of 0.
So my question is, is it possible with this implementations of AES over the HElib to do some operation on the ciphertext or is it just for performence purpose. If it's possible, can you give a simple example doing such operation.

Thanks in advance!

Accessing individual slots in Ctxt

I know that one instantiation of Ctxt contains multiple ciphertexts in its slots. Is there a way to access specific slots? One big operation I want to do is to homomorphically add all the values in the slots in Ctxt.

'invalid machine command' during 'make check'

Hi all!

I'm trying to use your library for a studies project on a cloud server structure that uses FHE. Compilation now runs fine (it didn't a month ago and failed on PolyEval), but now the tests run by 'make check' after compilation throw an error and the whole thing stops at line 60 in the makefile with mentioning an 'invalid machine command'.
If it helps, I can provide the printout from my console (there should also be a dumped core file). My system is an ArchLinux x86 (64 Bit) with ntl 8.1.2-1 and gmp 6.0.0-2.

Can you help me?

Best,
thox

Running error

hi
I run a example on terminal,but get the error ;
Ctxt.cpp:522: void Ctxt::addCtxt(const Ctxt&, bool): Assertion `&context==&other.context && &pubKey==&other.pubKey' failed.
Aborted (core dumped)

Guide to getting started

It'd help enthusiastic developers-but-not-cryptographers like me to have some real basic documentation.

  • List the available methods
  • Tiniest proof-of-concept possible, in C code - homomorphic evaluation of a mult operation
  • Describe whether lattice-based encryption keys are necessary, and if so, how to generate them
  • Since bootstrapping is not yet available, how to pick the right parameters to cover a particular operation or set of operations

I'd really love to dig into this, make some higher level language bridge libraries, etc. It's really hard to know where to start (especially without much of a C background).

"Non - Compact" backends for HElib

consider adding "non - compact" backends for HElib, i.e. schemes with higher communications and round complexity or schemes where output will grow with size of the evaluation polynomial, such as mpc protocol SPDZ of Damgard, Pastro, Smart et. al. since there are some impressive AES benchmarks coming out of these schemes despite communication complexity

confused with secretKey.GenSecKey()

I was confused that everytime I call the secretKey.GenSecKey(),it returns the same secretKey,and so the publicKey is.as you know,the key is very long,so if you are interested in this question you can contact me and I will email you the secretKey and publicKey.
I think the reason is that one PC only generates one pair key fixedly,but I'm not sure.

FindM() function returns wrong m for several values

For example, for p = 8209, L= 8, security = 112, c = 3, , findM() returns 8191.
Then, when we try to use this value to generate the context, the assertion (p < m) fail.
When we increase L to 16, the function finds a correct m (=15709).
For bigger value of p, FindM() returns wrong m for more value of L :
p = 16411, L = 16 -> m = 13981
p = 32771, L = 32 -> m = 23377

problem compiling the HELib

i am having problem compiling the HELib. am using eclipse on ubuntu to compile the lib but am getting several error message:

Description Resource Path Location Type
make: *** [PAlgebraMod.o] Error 1 Test HElib C/C++ Problem
‘PAlgebraModTwo’ has not been declared PAlgebraMod.cpp /Test HElib line 53 C/C++ Problem
Member declaration not found PAlgebraMod.cpp /Test HElib line 53 Semantic Error
‘zmStar’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 56 C/C++ Problem
Method 'M' could not be resolved PAlgebraMod.cpp /Test HElib line 56 Semantic Error
Method 'NSlots' could not be resolved PAlgebraMod.cpp /Test HElib line 56 Semantic Error
‘PhimXmod’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 57 C/C++ Problem
type ‘’ argument given to ‘delete’, expected pointer PAlgebraMod.cpp /Test HElib line 57 C/C++ Problem
‘PhimXmod’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 58 C/C++ Problem
‘factors’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 59 C/C++ Problem
Method 'kill' could not be resolved PAlgebraMod.cpp /Test HElib line 59 Semantic Error
‘crtCoeffs’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 60 C/C++ Problem
Method 'kill' could not be resolved PAlgebraMod.cpp /Test HElib line 60 Semantic Error
‘PhimXmod’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 66 C/C++ Problem
type ‘’ argument given to ‘delete’, expected pointer PAlgebraMod.cpp /Test HElib line 66 C/C++ Problem
‘PhimXmod’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 67 C/C++ Problem
‘zmStar’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 67 C/C++ Problem
Method 'PhimX' could not be resolved PAlgebraMod.cpp /Test HElib line 67 Semantic Error
Method 'NSlots' could not be resolved PAlgebraMod.cpp /Test HElib line 70 Semantic Error
‘factors’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 72 C/C++ Problem
Method 'SetLength' could not be resolved PAlgebraMod.cpp /Test HElib line 72 Semantic Error
‘factors’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 75 C/C++ Problem
Method 'length' could not be resolved PAlgebraMod.cpp /Test HElib line 75 Semantic Error
Method 'OrdTwo' could not be resolved PAlgebraMod.cpp /Test HElib line 77 Semantic Error
‘factors’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 81 C/C++ Problem
Method 'ith_rep' could not be resolved PAlgebraMod.cpp /Test HElib line 83 Semantic Error
‘crtCoeffs’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 101 C/C++ Problem
Method 'SetLength' could not be resolved PAlgebraMod.cpp /Test HElib line 101 Semantic Error
‘PAlgebraMod2r’ has not been declared PAlgebraMod.cpp /Test HElib line 157 C/C++ Problem
Member declaration not found PAlgebraMod.cpp /Test HElib line 157 Semantic Error
Method 'save' could not be resolved PAlgebraMod.cpp /Test HElib line 160 Semantic Error
‘modTwo’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 163 C/C++ Problem
‘zmStar’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 163 C/C++ Problem
Field 'assert (&zmStar == &modTwo.zmStar)' could not be resolved PAlgebraMod.cpp /Test HElib line 163 Semantic Error
Field 'PhimXmod' could not be resolved PAlgebraMod.cpp /Test HElib line 166 Semantic Error
Method 'M' could not be resolved PAlgebraMod.cpp /Test HElib line 166 Semantic Error
Method 'NSlots' could not be resolved PAlgebraMod.cpp /Test HElib line 166 Semantic Error
‘rr’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 167 C/C++ Problem
‘PhimXmod’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 168 C/C++ Problem
type ‘’ argument given to ‘delete’, expected pointer PAlgebraMod.cpp /Test HElib line 168 C/C++ Problem
‘PhimXmod’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 169 C/C++ Problem
‘factors’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 170 C/C++ Problem
Method 'kill' could not be resolved PAlgebraMod.cpp /Test HElib line 170 Semantic Error
‘crtCoeffs’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 171 C/C++ Problem
Method 'kill' could not be resolved PAlgebraMod.cpp /Test HElib line 171 Semantic Error
Function 'init' could not be resolved PAlgebraMod.cpp /Test HElib line 176 Semantic Error
Method 'NSlots' could not be resolved PAlgebraMod.cpp /Test HElib line 179 Semantic Error
Method 'SetLength' could not be resolved PAlgebraMod.cpp /Test HElib line 182 Semantic Error
Method 'SetLength' could not be resolved PAlgebraMod.cpp /Test HElib line 183 Semantic Error
Field 'factors' could not be resolved PAlgebraMod.cpp /Test HElib line 185 Semantic Error
Method 'PhimX' could not be resolved PAlgebraMod.cpp /Test HElib line 190 Semantic Error
‘rr’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 193 C/C++ Problem
Function 'init' could not be resolved PAlgebraMod.cpp /Test HElib line 195 Semantic Error
‘mod2rContext’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 196 C/C++ Problem
Method 'save' could not be resolved PAlgebraMod.cpp /Test HElib line 196 Semantic Error
‘PhimXmod’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 198 C/C++ Problem
type ‘’ argument given to ‘delete’, expected pointer PAlgebraMod.cpp /Test HElib line 198 C/C++ Problem
‘PhimXmod’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 199 C/C++ Problem
Method 'PhimX' could not be resolved PAlgebraMod.cpp /Test HElib line 199 Semantic Error
‘factors’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 200 C/C++ Problem
Method 'SetLength' could not be resolved PAlgebraMod.cpp /Test HElib line 200 Semantic Error
‘crtCoeffs’ was not declared in this scope PAlgebraMod.cpp /Test HElib line 205 C/C++ Problem
Method 'SetLength' could not be resolved PAlgebraMod.cpp /Test HElib line 205 Semantic Error
expected initializer before ‘<’ token PAlgebraMod.cpp /Test HElib line 219 C/C++ Problem
Member declaration not found PAlgebraMod.cpp /Test HElib line 219 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 219 Semantic Error
Method 'NSlots' could not be resolved PAlgebraMod.cpp /Test HElib line 221 Semantic Error
Method 'resize' could not be resolved PAlgebraMod.cpp /Test HElib line 222 Semantic Error
Method 'resize' could not be resolved PAlgebraMod.cpp /Test HElib line 224 Semantic Error
expected ‘;’ before ‘<’ token PAlgebraMod.cpp /Test HElib line 229 C/C++ Problem
Member declaration not found PAlgebraMod.cpp /Test HElib line 229 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 229 Semantic Error
variable or field ‘PAlgebraModTmpl’ declared void PAlgebraMod.cpp /Test HElib line 229 C/C++ Problem
expected ‘;’ before ‘<’ token PAlgebraMod.cpp /Test HElib line 231 C/C++ Problem
Member declaration not found PAlgebraMod.cpp /Test HElib line 231 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 231 Semantic Error
variable or field ‘PAlgebraModTmpl’ declared void PAlgebraMod.cpp /Test HElib line 231 C/C++ Problem
expected initializer before ‘<’ token PAlgebraMod.cpp /Test HElib line 236 C/C++ Problem
Member declaration not found PAlgebraMod.cpp /Test HElib line 236 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 236 Semantic Error
Field 'zmStar' could not be resolved PAlgebraMod.cpp /Test HElib line 238 Semantic Error
Method 'M' could not be resolved PAlgebraMod.cpp /Test HElib line 238 Semantic Error
Method 'M' could not be resolved PAlgebraMod.cpp /Test HElib line 238 Semantic Error
Field 'PhimXmod' could not be resolved PAlgebraMod.cpp /Test HElib line 239 Semantic Error
Field 'factors' could not be resolved PAlgebraMod.cpp /Test HElib line 240 Semantic Error
Field 'crtCoeffs' could not be resolved PAlgebraMod.cpp /Test HElib line 241 Semantic Error
expected ‘;’ before ‘<’ token PAlgebraMod.cpp /Test HElib line 245 C/C++ Problem
explicit instantiation of non-template ‘bool PAlgebraModTmpl’ PAlgebraMod.cpp /Test HElib line 245 C/C++ Problem
Member declaration not found PAlgebraMod.cpp /Test HElib line 245 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 245 Semantic Error
expected ‘;’ before ‘<’ token PAlgebraMod.cpp /Test HElib line 246 C/C++ Problem
explicit instantiation of non-template ‘bool PAlgebraModTmpl’ PAlgebraMod.cpp /Test HElib line 246 C/C++ Problem
Member declaration not found PAlgebraMod.cpp /Test HElib line 246 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 246 Semantic Error
expected initializer before ‘<’ token PAlgebraMod.cpp /Test HElib line 253 C/C++ Problem
Member declaration not found PAlgebraMod.cpp /Test HElib line 253 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 253 Semantic Error
Method 'NSlots' could not be resolved PAlgebraMod.cpp /Test HElib line 256 Semantic Error
Function 'zero' could not be resolved PAlgebraMod.cpp /Test HElib line 257 Semantic Error
Method 'size' could not be resolved PAlgebraMod.cpp /Test HElib line 257 Semantic Error
Method 'length' could not be resolved PAlgebraMod.cpp /Test HElib line 488 Semantic Error
Function 'init' could not be resolved PAlgebraMod.cpp /Test HElib line 480 Semantic Error
Member declaration not found PAlgebraMod.cpp /Test HElib line 449 Semantic Error
expected initializer before ‘<’ token PAlgebraMod.cpp /Test HElib line 449 C/C++ Problem
Method 'length' could not be resolved PAlgebraMod.cpp /Test HElib line 430 Semantic Error
Function 'init' could not be resolved PAlgebraMod.cpp /Test HElib line 422 Semantic Error
Member declaration not found PAlgebraMod.cpp /Test HElib line 399 Semantic Error
expected initializer before ‘<’ token PAlgebraMod.cpp /Test HElib line 399 C/C++ Problem
Function 'zero' could not be resolved PAlgebraMod.cpp /Test HElib line 369 Semantic Error
Method 'indexOfRep' could not be resolved PAlgebraMod.cpp /Test HElib line 368 Semantic Error
Member declaration not found PAlgebraMod.cpp /Test HElib line 365 Semantic Error
expected initializer before ‘<’ token PAlgebraMod.cpp /Test HElib line 365 C/C++ Problem
Function 'zero' could not be resolved PAlgebraMod.cpp /Test HElib line 340 Semantic Error
Method 'indexOfRep' could not be resolved PAlgebraMod.cpp /Test HElib line 339 Semantic Error
Member declaration not found PAlgebraMod.cpp /Test HElib line 336 Semantic Error
expected initializer before ‘<’ token PAlgebraMod.cpp /Test HElib line 336 C/C++ Problem
variable or field ‘PAlgebraModTmpl’ declared void PAlgebraMod.cpp /Test HElib line 323 C/C++ Problem
Member declaration not found PAlgebraMod.cpp /Test HElib line 323 Semantic Error
expected ‘;’ before ‘<’ token PAlgebraMod.cpp /Test HElib line 323 C/C++ Problem
variable or field ‘PAlgebraModTmpl’ declared void PAlgebraMod.cpp /Test HElib line 321 C/C++ Problem
Member declaration not found PAlgebraMod.cpp /Test HElib line 321 Semantic Error
expected ‘;’ before ‘<’ token PAlgebraMod.cpp /Test HElib line 321 C/C++ Problem
Function 'zero' could not be resolved PAlgebraMod.cpp /Test HElib line 311 Semantic Error
Function 'zero' could not be resolved PAlgebraMod.cpp /Test HElib line 308 Semantic Error
Member declaration not found PAlgebraMod.cpp /Test HElib line 305 Semantic Error
expected initializer before ‘<’ token PAlgebraMod.cpp /Test HElib line 305 C/C++ Problem
variable or field ‘PAlgebraModTmpl’ declared void PAlgebraMod.cpp /Test HElib line 299 C/C++ Problem
Member declaration not found PAlgebraMod.cpp /Test HElib line 299 Semantic Error
expected ‘;’ before ‘<’ token PAlgebraMod.cpp /Test HElib line 299 C/C++ Problem
variable or field ‘PAlgebraModTmpl’ declared void PAlgebraMod.cpp /Test HElib line 297 C/C++ Problem
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 297 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 299 Semantic Error
Member declaration not found PAlgebraMod.cpp /Test HElib line 297 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 305 Semantic Error
expected ‘;’ before ‘<’ token PAlgebraMod.cpp /Test HElib line 297 C/C++ Problem
Function 'zero' could not be resolved PAlgebraMod.cpp /Test HElib line 284 Semantic Error
Method 'size' could not be resolved PAlgebraMod.cpp /Test HElib line 283 Semantic Error
Method 'size' could not be resolved PAlgebraMod.cpp /Test HElib line 283 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 321 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 279 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 323 Semantic Error
Member declaration not found PAlgebraMod.cpp /Test HElib line 279 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 336 Semantic Error
expected initializer before ‘<’ token PAlgebraMod.cpp /Test HElib line 279 C/C++ Problem
variable or field ‘PAlgebraModTmpl’ declared void PAlgebraMod.cpp /Test HElib line 272 C/C++ Problem
Type 'GF2E::init' could not be resolved PAlgebraMod.cpp /Test HElib line 343 Semantic Error
Method 'NSlots' could not be resolved PAlgebraMod.cpp /Test HElib line 307 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 365 Semantic Error
Method 'NSlots' could not be resolved PAlgebraMod.cpp /Test HElib line 282 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 272 Semantic Error
Type 'zz_pE::init' could not be resolved PAlgebraMod.cpp /Test HElib line 372 Semantic Error
Member declaration not found PAlgebraMod.cpp /Test HElib line 272 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 399 Semantic Error
Method 'NSlots' could not be resolved PAlgebraMod.cpp /Test HElib line 403 Semantic Error
Method 'size' could not be resolved PAlgebraMod.cpp /Test HElib line 404 Semantic Error
Method 'OrdTwo' could not be resolved PAlgebraMod.cpp /Test HElib line 404 Semantic Error
Method 'resize' could not be resolved PAlgebraMod.cpp /Test HElib line 405 Semantic Error
Method 'resize' could not be resolved PAlgebraMod.cpp /Test HElib line 421 Semantic Error
expected ‘;’ before ‘<’ token PAlgebraMod.cpp /Test HElib line 272 C/C++ Problem
variable or field ‘PAlgebraModTmpl’ declared void PAlgebraMod.cpp /Test HElib line 270 C/C++ Problem
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 270 Semantic Error
Symbol 'PAlgebraModTmpl' could not be resolved PAlgebraMod.cpp /Test HElib line 449 Semantic Error
Method 'NSlots' could not be resolved PAlgebraMod.cpp /Test HElib line 453 Semantic Error
Method 'size' could not be resolved PAlgebraMod.cpp /Test HElib line 454 Semantic Error
Method 'OrdTwo' could not be resolved PAlgebraMod.cpp /Test HElib line 454 Semantic Error
Method 'resize' could not be resolved PAlgebraMod.cpp /Test HElib line 455 Semantic Error
Method 'resize' could not be resolved PAlgebraMod.cpp /Test HElib line 479 Semantic Error
Member declaration not found PAlgebraMod.cpp /Test HElib line 270 Semantic Error
expected ‘;’ before ‘<’ token PAlgebraMod.cpp /Test HElib line 270 C/C++ Problem

Any solution for this errors?

Thanks

Please, produce a tutorial

I have a high level understanding of lattice encryption, I understand what homomorphic encryption achieves but I am not familiar enough with the details of the scheme to make sense of the doxygen documentation of this project.

Please produce a HeLib tutorial that introduces the different classes and methods. To start with, how about a homomorphic 2+2=4 example?

Input Level vs Real Level

capture
Hi
When I set some L as input the reported L is about 2L. For example I set L=50 and the reported L is 97, is there any thing wrong or ... ?
My app is just a *=.

Many Thanks

Semantic Security

On the face of it the HElib scheme is semantically secure - for two encryptions of the same plaintext, each encryption samples fresh randomness.
For bitstring comparison, if one encrypts an element A in a ring F_(2^d) and another element B in the same ring, then Enc(A) + Enc(B) (in F_(2^d) arithmetic) is bitstring comparison - it should return the zero element if the strings match.
In the case of identical strings, their encrypted versions incorporate distinct randomness, so I should not be able to (homorphically) tell that they are the same? But on the other hand, the scheme is additively homomorphic so Enc(A) + Enc(B) should give me a correct result for comparison. Is there a contradiction or is it a specious argument ?

How can I encrypt a file?

Hi everyone, I am interesting in HElib, I downloaded and Installed, also I followed the demo, and everything is ok. Now, I just wanted to know how I can encrypt a file (for instance: txt, doc, or xls) and modified in the encrypted domain by using HElib. As I see in the sample code, it is used a plaintextArray, but I do not really know how can I covert a file (txt, doc or xls) into plaintextArray.

Thank you for your help.

Proper parameters for key-switch

I am sorry I have to ask this question here.
I got "W.toKeyID >=0" assertion failed but I have set up add1DMatrices().
Are there other reasons it happen?

context.rcData.e value

First i generate context and print out the value of context.rcData.e , which is for example 13.
When i save the context to file and try to read it again the value of context.rcData.e is always 0.
Anyone knows what could be the problem ?
Thank you.

Code for saving&loading context :

void saveContextAndSecretKey(const char *fname, FHEcontext& context, FHESecKey& secretKey)
{ ofstream str (fname);
if (!str.is_open()){
cout << "IO error " << endl;
return;
}
writeContextBase(str, context);
str << context;
str << secretKey;
str.close();
}

void loadContextAndSecretKey(const char fname, FHEcontext& context, FHESecKey_& secretKey)
{ ifstream str (fname);
if (!str.is_open()){
cout << "IO error " << endl;
return;
}
unsigned long m, p, r;
readContextBase(str, m, p, r);
context = new FHEcontext (m, p, r);
str >> *context;
secretKey = new FHESecKey(_context);
str >> *secretKey;
str.close();
}

Decryption Performance Needs Improved

There appears to be some amount of data that can be precomputed within the decryption routines. Improvements here would be most beneficial seeing as the other necessary homomorphic operations are orders of magnitude faster.

Would performance-related patches to decrypt be accepted or would they get in the way of current in-house efforts?

Assertion `set <= (context.specialPrimes | context.ctxtPrimes)' failed.

I'm building a socket transmission program for secretKey or publicKey just like Test_IO in HElib,I reference these source codes but get error DoubleCRT.cpp:758: std::istream& operator>>(std::istream&, DoubleCRT&): Assertion 'set <= (context.specialPrimes | context.ctxtPrimes)' failed.It has tortured me two days and I have no ideas.

DNO_HALF_PRIME flag

I am confusing about the DNO_HALF_PRIME flag.

For example, I need to evaluate depth 3 function and I set parameter L = 3, however it always failed because of too large noise(I guess). I read through the code (in FHEContext.cpp buildModChain function) and found this DNO_HALF_PRIME flag.

I am wonder if I turn on the DNO_HALF_PRIME flag, how should I comprehend the parameter L in the findM function.In my comprehension this levels parameter L matters the security level a lot.

Thank you!

NTL 9.1.0 is not supported

Compilation errors arise when HElib is compiled using NTL 9.1.0

In file included from /usr/local/include/NTL/ZZ.h:20:0,
                 from NumbTh.h:34,
                 from DoubleCRT.h:21,
                 from FHE.h:24,
                 from EncryptedArray.h:25,
                 from EncryptedArray.cpp:19:
/usr/local/include/NTL/vector.h: In instantiation of ‘void NTL::conv(NTL::Vec<T>&, const NTL::Vec<S>&) [with T = NTL::ZZ; S = NTL::GF2]’:
/usr/local/include/NTL/vector.h:791:24:   required from ‘void NTL::conv(NTL::Vec<T>&, const NTL::Vec<S>&) [with T = NTL::Vec<NTL::ZZ>; S = NTL::Vec<NTL::GF2>]’
/usr/local/include/NTL/matrix.h:246:33:   required from ‘void NTL::conv(NTL::Mat<T>&, const NTL::Mat<S>&) [with T = NTL::ZZ; S = NTL::GF2]’
EncryptedArray.cpp:404:19:   required from ‘void EncryptedArrayDerived<type>::initNormalBasisMatrix() const [with type = PA_GF2]’
EncryptedArray.cpp:2124:16:   required from here
/usr/local/include/NTL/vector.h:788:25: error: ‘const class NTL::Vec<NTL::GF2>’ has no member named ‘elts’
    const S *ap = a.elts();

Therefore, instruction 'HElib requires NTL version 9.0.1 or higher' isn't up-to-date.

What is the meaning of "Size of the constant"

I am reading the design doc of HElib. I noticed that the ciphertext-constant multiplication/addition methods have a default parameter "size" which refers the size of the operand constant. But I am very not sure what value should I set. For example, I want to multiply just 0/1 binary, what is the "Size of the constant" should be? Thank you!

Test_General is broken (allows noise buildup)

When running Test_General.cpp with R=2, or any number of rounds >1, the cipher computations and plaintext computations get different results. This seems to be due to a lack of recryption (noise build up).

The error is "Ctxt::findBaseSet warning: already at lowest level". It wouldn't cause such a trip up, except that the test itself suggests running with more than one round (R=4).

(the title was changed when I realized what was really happening)

Context fails to terminate (`FindM()` results in large `m` when `p != 2`)

I've now been contacted by two people, and have confirmed for myself, that the typical examples do not work for cases where p>2. For example, make check fails to terminate. I notice FindM() is returning surprisingly large values (m = 21997 when p = 3) while smaller values would suffice and terminate in a timely manner (if I recall the literature correctly). I have verified this by manually setting m = 5, for example.

If you find make check does terminate for the p = 3 cases for git version baf0fc1 then I'd be happy to talk about compilation, version numbers, etc.

EDIT: I had thought this might be due to whatever the issue was with NTL 7.0.0, but I can reproduce the behavior with 7.0.1.

Remove the GPL license

Please make this library liberally licensed (MIT/zlib/BSD) so that the library can actually be used in the enterprise.

Addition Multiplication implementation in cipher text space

Which paper to refer to clearly understand how the addition and multiplication operations are used in cipher text space.?As i am trying to implement other operations in cipher text space.Need to know the addition,multiplication is implemented.

Running error

hi,
I have a new running error need help.

AltCRT.cpp:322: double AltCRT::addPrimesAndScale(const IndexSet&): Assertion `empty(s1 & map.getIndexSet())' failed

Thank you!

An NTRU back-end for HElib

HElib is probably mature enough now to start experimenting with other back-ends (i.e., other HE schemes), at least the ones that have the same plaintext spaces as BGV. In particular it would be nice to implement the homomorphic-NTRU scheme from [LTV, STOC 2012], see http://eprint.iacr.org/2013/094 (even without the multi-key option).

Several implementations of this HE schemes were reported, e.g., http://eprint.iacr.org/2014/389 and
http://www.kaynar-rohloff.com/krohloff/papers/2014/Rohloff_Cousins_WAHC_2014_final.pdf. Perhaps they can be integrated with HElib, or at least serve as a starting point for implementing an NTRU back-end for HElib.

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.