Skip to content

Commit bcc689e

Browse files
fabergahamishunJack L Crawford
authored and
GitHub Enterprise
committed
HElib v1.1.0 (#380)
HElib 1.1.0 Beta 0, August 2020 =============================== (tagged as v1.1.0-beta.0) June-August 2020 ------------------ * Utils * create-context * encrypt/decrypt * encode/decode examples * Improvements to noise management * Move to CMake >= 3.10.2 * Doxygen improved look and feel * Improved docs * New examples and mini-tutorial on private preserving db query * Configurable PSI/PIR beta * Some tools in `misc/` for code formatting and algebra generation * `Warning` messages are now logged (default `helib.log`) * Bug fixes Co-authored-by: Hamish C Hunt <HAMISHUN@uk.ibm.com> Co-authored-by: Jack L Crawford <Jack.Crawford@ibm.com>
1 parent 424480f commit bcc689e

Some content is hidden

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

48 files changed

+793
-249
lines changed

changes.md CHANGES.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
HElib 1.1.0, August 2020
2+
===============================
3+
(tagged as v1.1.0)
4+
5+
June-August 2020
6+
------------------
7+
* Utils
8+
* create-context
9+
* encrypt/decrypt
10+
* encode/decode examples
11+
* Improvements to noise management
12+
* Move to CMake >= 3.10.2
13+
* Doxygen improved look and feel
14+
* Improved docs
15+
* New examples and mini-tutorial on private preserving db query
16+
* Configurable PSI/PIR beta
17+
* Some tools in `misc/` for code formatting and algebra generation
18+
* `Warning` messages are now logged (default `helib.log`)
19+
* Bug fixes
20+
121
HElib 1.0.2, June 2020
222
===============================
323
(tagged as v1.0.2)

ISSUES.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Known Issues
2+
3+
These issues listed below are known to be current and are expected to be
4+
addressed.
5+
6+
The function in BinaryArith `fifteenOrLess4Four` is known to not be currently
7+
thread safe. Therefore set NTL's thread pool to 1 to avoid this issue. The
8+
function `NTL::SetNumThreads` can be used to set the number of threads in the
9+
pool and `NTL::AvailableThreads` gives the current available threads in the
10+
pool.

LICENSE LICENSE.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# LICENSE
2+
3+
```
14
25
Apache License
36
Version 2.0, January 2004
@@ -200,3 +203,5 @@
200203
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201204
See the License for the specific language governing permissions and
202205
limitations under the License.
206+
207+
```

TESTS.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Building and running the new tests
2-
1. To build and run the new tests, one must pass `-DENABLE_TEST=on` to cmake -
2+
3+
To build and run the new tests, one must pass `-DENABLE_TEST=on` to cmake -
34
see [INSTALL.md](INSTALL.md). The google test library will then be downloaded
45
and the correct targets will be defined for cmake. 2. To compile them, `make`
56
as normal from a build directory. 3. The entire set of tests can be run with

doc/Readme.md

-1
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

documentation/Doxyfile

+10-3
Original file line numberDiff line numberDiff line change
@@ -698,14 +698,14 @@ MAX_INITIALIZER_LINES = 30
698698
# list will mention the files that were used to generate the documentation.
699699
# The default value is: YES.
700700

701-
SHOW_USED_FILES = YES
701+
SHOW_USED_FILES = NO
702702

703703
# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
704704
# will remove the Files entry from the Quick Index and from the Folder Tree View
705705
# (if specified).
706706
# The default value is: YES.
707707

708-
SHOW_FILES = YES
708+
SHOW_FILES = NO
709709

710710
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
711711
# page. This will remove the Namespaces entry from the Quick Index and from the
@@ -824,9 +824,16 @@ WARN_LOGFILE =
824824
# Note: If this tag is empty the current directory is searched.
825825

826826
INPUT = ./mainpage.dox \
827+
../CONTRIBUTING.md \
828+
../CODE_OF_CONDUCT.md \
829+
../LICENSE.md \
830+
../INSTALL.md \
831+
../TESTS.md \
827832
../include/helib \
828833
../src \
829-
../examples/*
834+
../utils \
835+
../misc/psi \
836+
../ISSUES.md
830837

831838
# This tag can be used to specify the character encoding of the source files
832839
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

examples/BGV_binary_arithmetic/BGV_binary_arithmetic.cpp

+35-5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
* See the License for the specific language governing permissions and
1010
* limitations under the License. See accompanying LICENSE file.
1111
*/
12+
13+
// This is a sample program for education purposes only.
14+
// It attempts to demonstrate the use of the API for the
15+
// binary arithmetic operations that can be performed.
16+
1217
#include <iostream>
1318

1419
#include <helib/helib.h>
@@ -44,15 +49,32 @@ int main(int argc, char* argv[])
4449
// Orders of the previous generators.
4550
std::vector<long> ords = {6, 4, 6};
4651

52+
std::cout << "\n*********************************************************";
53+
std::cout << "\n* Basic Binary Arithmetic Example *";
54+
std::cout << "\n* =============================== *";
55+
std::cout << "\n* *";
56+
std::cout << "\n* This is a sample program for education purposes only. *";
57+
std::cout << "\n* It attempts to demonstrate the use of the API for the *";
58+
std::cout << "\n* binary arithmetic operations that can be performed. *";
59+
std::cout << "\n* *";
60+
std::cout << "\n*********************************************************";
61+
std::cout << std::endl;
62+
4763
std::cout << "Initialising context object..." << std::endl;
4864
// Initialize the context.
65+
// This object will hold information about the algebra created from the
66+
// previously set parameters.
4967
helib::Context context(m, p, r, gens, ords);
5068

5169
// Modify the context, adding primes to the modulus chain.
70+
// This defines the ciphertext space.
5271
std::cout << "Building modulus chain..." << std::endl;
5372
buildModChain(context, bits, c);
5473

5574
// Make bootstrappable.
75+
// Modify the context, providing bootstrapping capabilities.
76+
// Boostrapping has the affect of 'refreshing' a ciphertext back to a higher
77+
// level so more operations can be performed.
5678
context.makeBootstrappable(
5779
helib::convert<NTL::Vec<long>, std::vector<long>>(mvec));
5880

@@ -94,9 +116,17 @@ int main(int argc, char* argv[])
94116
// the result.
95117
// Next, calculate a + b + c with HElib's binary arithmetic functions, then
96118
// decrypt the result.
97-
// Finally, calculate popcnt(a) with HElib's binary arithmetic functions, then
98-
// decrypt the result. Note that popcnt, also known as hamming weight or bit
99-
// summation, returns the count of non-zero bits.
119+
// Finally, calculate popcnt(a) with HElib's binary arithmetic functions,
120+
// then decrypt the result. Note that popcnt, also known as hamming weight
121+
// or bit summation, returns the count of non-zero bits.
122+
123+
// Each bit of the binary number is encoded into a single ciphertext. Thus
124+
// for a 16 bit binary number, we will represent this as an array of 16
125+
// unique ciphertexts.
126+
// i.e. b0 = [0] [0] [0] ... [0] [0] [0] ciphertext for bit 0
127+
// b1 = [1] [1] [1] ... [1] [1] [1] ciphertext for bit 1
128+
// b2 = [1] [1] [1] ... [1] [1] [1] ciphertext for bit 2
129+
// These 3 ciphertexts represent the 3-bit binary number 110b = 6
100130

101131
// Note: several numbers can be encoded across the slots of each ciphertext
102132
// which would result in several parallel slot-wise operations.
@@ -153,8 +183,8 @@ int main(int argc, char* argv[])
153183
product_wrapper,
154184
helib::CtPtrs_vectorCt(encrypted_a),
155185
helib::CtPtrs_vectorCt(encrypted_b),
156-
/*rhsTwosComplement=*/false, // This means the rhs is unsigned rather than
157-
// 2's complement.
186+
/*rhsTwosComplement=*/false, // This means the rhs is unsigned rather
187+
// than 2's complement.
158188
outSize, // Outsize is the limit on the number of bits in the output.
159189
&unpackSlotEncoding); // Information needed for bootstrapping.
160190

examples/BGV_binary_arithmetic/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
2020

2121
project(BGV_binary_arithmetic LANGUAGES CXX)
2222

23-
find_package(helib 1.0.0 EXACT REQUIRED)
23+
find_package(helib 1.1.0 EXACT REQUIRED)
2424

2525
add_executable(BGV_binary_arithmetic BGV_binary_arithmetic.cpp)
2626

0 commit comments

Comments
 (0)