Skip to content

Commit 0e45868

Browse files
authored
Merge pull request #340 from faberga/master
V1.0.0 Jan2020
2 parents cd267e2 + 4d2f63f commit 0e45868

File tree

202 files changed

+10786
-5104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+10786
-5104
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ src/misc/*.txt
2424
!src/misc/iotest_asciiLE.txt
2525
!src/misc/iotest_binBE.bin
2626
!src/misc/iotest_binLE.bin
27+
/html/
28+
/latex/

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ project(helib_superbuild
66
# Define standard installation directories (GNU)
77
include(GNUInstallDirs)
88

9-
## Use -std=c++11 as default.
10-
set(CMAKE_CXX_STANDARD 11)
9+
## Use -std=c++14 as default.
10+
set(CMAKE_CXX_STANDARD 14)
1111
## Disable C++ extensions
1212
set(CMAKE_CXX_EXTENSIONS OFF)
1313
## Require full C++ standard
@@ -48,7 +48,6 @@ if (PACKAGE_BUILD)
4848
else (PACKAGE_BUILD)
4949
# Properties to be enabled when not using PACKAGE_BUILD
5050
option(ENABLE_LEGACY_TEST "Build the legacy test files (does not work with PACKAGE_BUILD)" OFF)
51-
option(BUILD_AES "Build homomorphic AES (does not work with PACKAGE_BUILD)" OFF)
5251
endif(PACKAGE_BUILD)
5352

5453
# Allow GMP_DIR and search in it if not using PACKAGE_BUILD or using PACKAGE_BUILD and !FETCH_GMP
@@ -235,7 +234,6 @@ if (PACKAGE_BUILD)
235234
-DFETCH_GMP=${FETCH_GMP}
236235
-DENABLE_TEST=${ENABLE_TEST}
237236
-DENABLE_LEGACY_TEST=OFF
238-
-DBUILD_AES=OFF
239237
BUILD_ALWAYS ON
240238
)
241239

Doxyfile

Lines changed: 374 additions & 2323 deletions
Large diffs are not rendered by default.

INSTALL.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ set to `OFF`, there should either exist a system-installed GMP library, or
203203

204204
### Parameters specific to option 2 (library build)
205205
- `ENABLE_LEGACY_TEST=ON/OFF` (default is OFF): Build old test system (deprecated).
206-
- `BUILD_AES=ON/OFF` (default is OFF): Build homomorphic AES.
207206
- `GMP_DIR`: Prefix of the GMP library.
208207
- `NTL_DIR`: Prefix of the NTL library.
209208

README.md

Lines changed: 23 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,32 @@
11
HElib
22
=====
3-
***September-November 2019:*** Significant refactoring and cleanup of codebase.
4-
New `helib` namespace. New `examples` and `benchmarks` directory trees.
5-
Improvements to bootstrapping.
6-
Better tests for bootsrapping and binary arithmetic in BGV.
7-
Docs and example code for binary arithmetic.
8-
Overall code and performance improvements in `NumbTh.cpp`.
9-
HElib now avoids *very bad* generators.
10-
Bug fixes.
113

12-
***August 2019:*** Improved noise management in HElib.
13-
Better and more robust bootstrapping algorithm.
14-
Ubuntu 18.04 Docker image with HElib and its dependencies.
15-
See install instructions in [DOCKER_USAGE.md](DOCKER_USAGE.md)
16-
17-
***July 2019:*** Added new bootstrapping and PGFFT tests.
18-
19-
***June 2019:*** Added implementation of PGFFT to replace Armadillo for FFTs in
20-
the CKKS scheme. See comments in `PGFFT.h` for more information.
21-
22-
***May 2019:*** CKKS bug fixes and fixed compiler warnings.
23-
24-
***April 2019:*** Moved the HElib repository on github from shaih/HElib to
25-
HomEnc/HElib. Introduced HElib-specific exceptions, replaced C `assert`, NTL
26-
Error and `std::exception` to use HElib-specific assertions that throw the new
27-
exceptions. See comments in `assertions.h` and `exceptions.h` for usage
28-
information.
29-
30-
***March 2019:*** Introduced new test framework (google test), documented in
31-
[TESTS.md](TESTS.md). Previous framework will be deprecated. Added a cmake
32-
build script for building HElib and dependencies, documented in
33-
[INSTALL.md](INSTALL.md). Added an example program, see `example program`.
34-
35-
***January 2019:*** Multiple changes: CKKS support, new modulus-chain
36-
implementation, better noise management, etc. Documented in
37-
[changes.md](changes.md)
38-
39-
***March 2018:*** Re-implementation of homomorphic linear transformations,
40-
featuring speedups of 15x to 75x.
4+
HElib is an open-source ([Apache License v2.0][5]) software library that
5+
implements [homomorphic encryption][6] (HE). Currently available schemes
6+
are the implementations of the [Brakerski-Gentry-Vaikuntanathan][1] (BGV)
7+
scheme with [bootstrapping][8] and the Approximate Number scheme of
8+
[Cheon-Kim-Kim-Song][9] (CKKS), along with many optimizations to make
9+
homomorphic evaluation run faster, focusing mostly on effective use of
10+
the [Smart-Vercauteren][2] ciphertext packing techniques and
11+
the [Gentry-Halevi-Smart][3] optimizations. See [this report][7] for a
12+
description of a few of the algorithms using in this library.
4113

42-
***Dec 2017-Jan 2018:*** Added some routines for addition/multiplication and
43-
comparisons of integers in binary representation, and for homomorphic table
44-
lookup. See the supported interfaces in `binaryArith.h`, `binaryCompare.h`,
45-
and `tableLookup.h`. Some examples are in `Test_binaryArith.cpp`,
46-
`Test_binaryCompare.cpp`, and `Test_tableLookup.cpp`.
14+
Since mid-2018 HElib has been under extensive refactoring for *Reliability*,
15+
*Robustness & Serviceability*, *Performance*, and most importantly *Usability*
16+
for researchers and developers working on HE and its uses.
4717

48-
The inputs and outputs to the new routines are logically vectors of Ctxt objects
49-
(one Ctxt per bit in the binary representation). These vectors are wrapped by
50-
the new `CtPtrs` wrapper (see `CtPtrs.h` and the underlying `PtrsVector.h` and
51-
`PtrsMatrix.h`). Hence the same logic will work for any type of input that can
52-
be mapped logically to arrays of `Ctxt`s, as long as one can wrap them with the
53-
same wrapper class. In particular, we implemented wrappers for
54-
`std::vector<Ctxt>`, `std::vector<Ctxt*>`, `NTL::Vec<Ctxt>` and
55-
`NTL::Vec<Ctxt*>`.
18+
HElib supports an *"assembly language for HE"*, providing low-level routines
19+
(set, add, multiply, shift, etc.), sophisticated automatic noise management,
20+
improved BGV bootstrapping, multi-threading, and also support for Ptxt (plaintext)
21+
objects which mimics the functionality of Ctxt (ciphertext) objects.
22+
See [changes.md](changes.md) for more details.
5623

57-
-----------------------------------------------------------------------------
58-
HElib is a software library that implements [homomorphic encryption][6] (HE).
59-
Currently available is an implementation of the
60-
[Brakerski-Gentry-Vaikuntanathan][1] (BGV) scheme, along with many
61-
optimizations to make homomorphic evaluation runs faster, focusing mostly on
62-
effective use of the [Smart-Vercauteren][2] ciphertext packing techniques and
63-
the [Gentry-Halevi-Smart][3] optimizations. See [this report][7] for a
64-
description of a few of the algorithms using in this library. Starting
65-
December 2014, the library also includes [bootstrapping][8].
24+
Full installation instructions can be found in [INSTALL.md](INSTALL.md).
6625

67-
At its present state, this library is mostly meant for researchers working on
68-
HE and its uses. Also currently it is fairly low-level, and is best thought of
69-
as "assembly language for HE". That is, it provides low-level routines (set,
70-
add, multiply, shift, etc.), with as much access to optimizations as we can
71-
give. Hopefully in time we will be able to provide higher-level routines.
26+
HElib is written in C++14 and uses the [NTL mathematical library][4]
27+
(version 11.0.0 or higher).
28+
HElib is distributed under the terms of the [Apache License v2.0][5].
7229

73-
This library is written in C++ and uses the [NTL mathematical library][4]
74-
(version 10.0.0 or higher). As of March 2015, it also supports multi-threading.
75-
HElib is distributed under the terms of the [Apache License v2.0][5].
76-
For more information see the [GitHub Pages][9].
7730

7831
[1]: http://eprint.iacr.org/2011/277 "BGV12"
7932
[2]: http://eprint.iacr.org/2011/133 "SV11"
@@ -83,4 +36,5 @@ For more information see the [GitHub Pages][9].
8336
[6]: http://en.wikipedia.org/wiki/Homomorphic_encryption "Homomorphic encryption"
8437
[7]: http://eprint.iacr.org/2014/106 "algorithms"
8538
[8]: http://eprint.iacr.org/2014/873 "bootstrapping"
86-
[9]: https://github.com/homenc/HElib "GitHubPages"
39+
[9]: http://eprint.iacr.org/2016/421 "CKKS16"
40+
[10]: https://github.com/homenc/HElib "GitHubPages"

changes.md

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,70 @@
1-
HElib 1.0.0 beta1, August 2019
1+
HElib 1.0.0, December 2019
2+
===============================
3+
(tagged as 1.0.0-Dec2019)
4+
5+
December 2019
6+
-------------
7+
* C++14 Standard (minimum level)
8+
* New `Ptxt` Plaintext class that implements the same functionality of the `Ctxt` ciphertext class.
9+
* Improved version of the `ArgMap` API for command line arguments.
10+
* Restructuring of the project directory tree.
11+
* Removed AES example - improved version on its way.
12+
* Doxygen documentation.
13+
* Bug fixes.
14+
15+
HElib 1.0.0 beta 2, November 2019
16+
===============================
17+
(tagged as 1.0.0-beta2-Nov2019)
18+
19+
September-November 2019
20+
-----------------------
21+
* Significant refactoring and cleanup of codebase.
22+
* New `helib` namespace.
23+
* New `examples` and `benchmarks` directory trees.
24+
* Improvements to bootstrapping.
25+
* Better tests for bootsrapping and binary arithmetic in BGV.
26+
* Docs and example code for binary arithmetic.
27+
* Overall code and performance improvements in `NumbTh.cpp`.
28+
* HElib now avoids *very bad* generators.
29+
* Bug fixes.
30+
31+
HElib 1.0.0 beta 1, August 2019
232
===============================
333
(tagged as 1.0.0-beta1-Aug2019)
434

5-
This version includes a new test framework (google test) and CMake build environment. It also includes much more rigorous noise management and noise estimates, making it safe to use HElib's noise estimates to avoid decryption errors. Also a beefed up GPV bootstrapping, with much more rigorous selection of parameters. Finally, Armadillo was removed and replaced with a faster and simpler complex FFT representation.
35+
August 2019
36+
-----------
37+
* Improved noise management in HElib.
38+
* Better and more robust bootstrapping algorithm.
39+
40+
July 2019
41+
---------
42+
* Added new bootstrapping and PGFFT tests.
43+
44+
June 2019
45+
---------
46+
* Added implementation of PGFFT to replace Armadillo for FFTs in
47+
the CKKS scheme. See comments in `PGFFT.h` for more information.
48+
49+
May 2019
50+
--------
51+
* CKKS bug fixes and fixed compiler warnings.
52+
53+
April 2019
54+
----------
55+
* Moved the HElib repository on github from shaih/HElib to HomEnc/HElib.
56+
* Introduced HElib-specific exceptions, replaced C `assert`, NTL
57+
* Error and `std::exception` to use HElib-specific assertions that throw the new exceptions.
58+
* See comments in `assertions.h` and `exceptions.h` for usage information.
59+
60+
March 2019
61+
----------
62+
* Introduced new test framework (google test), documented in [TESTS.md](TESTS.md).
63+
* Previous framework will be deprecated. Added a cmake build script for building HElib and dependencies, documented in [INSTALL.md](INSTALL.md).
64+
* Added an example program, see `example program`.
65+
666

7-
HElib 1.0.0 beta, January 2019
67+
HElib 1.0.0 beta 0, January 2019
868
===============================
969
(tagged as 1.0.0-beta0-Jan2019)
1070

examples/BGV_general_example/BGV_general_example.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int main(int argc, char *argv[]) {
2929

3030
std::cout << "Initialising context object..." << std::endl;
3131
// Intialise context
32-
helib::FHEcontext context(m, p, r);
32+
helib::Context context(m, p, r);
3333
// Modify the context, adding primes to the modulus chain
3434
std::cout << "Building modulus chain..." << std::endl;
3535
buildModChain(context, bits, c);
@@ -44,16 +44,16 @@ int main(int argc, char *argv[]) {
4444
// Secret key management
4545
std::cout << "Creating secret key..." << std::endl;
4646
// Create a secret key associated with the context
47-
helib::FHESecKey secret_key(context);
47+
helib::SecKey secret_key(context);
4848
// Generate the secret key
4949
secret_key.GenSecKey();
5050
std::cout << "Generating key-switching matrices..." << std::endl;
5151
// Compute key-switching matrices that we need
5252
helib::addSome1DMatrices(secret_key);
5353

5454
// Public key management
55-
// Set the secret key (upcast: FHESecKey is a subclass of FHEPubKey)
56-
const helib::FHEPubKey& public_key = secret_key;
55+
// Set the secret key (upcast: SecKey is a subclass of PubKey)
56+
const helib::PubKey& public_key = secret_key;
5757

5858
// Get the EncryptedArray of the context
5959
const helib::EncryptedArray& ea = *(context.ea);

examples/BGV_general_example/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
22

3-
## Use -std=c++11 as default.
4-
set(CMAKE_CXX_STANDARD 11)
3+
## Use -std=c++14 as default.
4+
set(CMAKE_CXX_STANDARD 14)
55
## Disable C++ extensions
66
set(CMAKE_CXX_EXTENSIONS OFF)
77
## Require full C++ standard

examples/binaryArith_example/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
22

3-
## Use -std=c++11 as default.
4-
set(CMAKE_CXX_STANDARD 11)
3+
## Use -std=c++14 as default.
4+
set(CMAKE_CXX_STANDARD 14)
55
## Disable C++ extensions
66
set(CMAKE_CXX_EXTENSIONS OFF)
77
## Require full C++ standard

examples/binaryArith_example/binaryArith_example.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int main(int argc, char* argv[])
4646

4747
std::cout << "Initialising context object..." << std::endl;
4848
// Intialise the context.
49-
helib::FHEcontext context(m, p, r, gens, ords);
49+
helib::Context context(m, p, r, gens, ords);
5050

5151
// Modify the context, adding primes to the modulus chain.
5252
std::cout << "Building modulus chain..." << std::endl;
@@ -66,16 +66,16 @@ int main(int argc, char* argv[])
6666
// Secret key management.
6767
std::cout << "Creating secret key..." << std::endl;
6868
// Create a secret key associated with the context.
69-
helib::FHESecKey secret_key(context);
69+
helib::SecKey secret_key(context);
7070
// Generate the secret key.
7171
secret_key.GenSecKey();
7272

7373
// Generate bootstrapping data.
7474
secret_key.genRecryptData();
7575

7676
// Public key management.
77-
// Set the secret key (upcast: FHESecKey is a subclass of FHEPubKey).
78-
const helib::FHEPubKey& public_key = secret_key;
77+
// Set the secret key (upcast: SecKey is a subclass of PubKey).
78+
const helib::PubKey& public_key = secret_key;
7979

8080
// Get the EncryptedArray of the context.
8181
const helib::EncryptedArray& ea = *(context.ea);

0 commit comments

Comments
 (0)