Commit a68ee988 authored by Fabian Boemer's avatar Fabian Boemer Committed by Yuriy Polyakov

Dev to master

parent 8c5d86ad
stages:
#- format
- build
- unit_test
- benchmark
......@@ -16,6 +17,30 @@ before_script:
- export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(pwd)/build/third-party/lib:$(pwd)/build/lib
# - export DO_CI="OFF"
#cpplint:
# stage: format
# only:
# refs:
# - master
# - merge_requests
# script:
# - whoami
# - sudo apt install python3-pip
# - pip install cpplint
# - cpplint --recursive ./src > cpplint.txt
# - if grep -xq "Total errors" cpplint.txt; then echo "cpplint passed"; else echo "cpplint failed" && exit 1; fi
#clang-format:
# stage: format
# only:
# refs:
# - master
# - merge_requests
# script:
# - whoami
# - sudo apt-get install clang-format
# - ./maint/check-code-format.sh
default_build:
stage: build
only:
......
exclude: 'android'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: local
hooks:
- id: clang-format
name: clang-format
entry: clang-format
language: system
files: \.(c|cc|cxx|cpp|h|hpp|hxx|js|proto)$
args: ["-i", "--style=Google", "--sort-includes=false"]
- id: cpplint
name: cpplint
entry: cpplint
language: system
files: \.(c|cc|cxx|cpp|h|hpp|hxx)$
args:
- --recursive
......@@ -29,5 +29,5 @@ link_libraries( ${PALISADE_LIBRARIES} )
### ADD YOUR EXECUTABLE(s) HERE
### add_executable( EXECUTABLE-NAME SOURCES )
###
### EXAMPLE:
### EXAMPLE:
### add_executable( test demo-simple-example.cpp )
......@@ -32,11 +32,11 @@ option( WITH_BE2 "Include Backend 2 in build by setting WITH_BE2 to TRUE" TRUE )
option( WITH_BE4 "Include Backend 4 in build by setting WITH_BE4 to TRUE" TRUE )
option( WITH_NTL "Include Backend 6 and NTL in build by setting WITH_NTL to TRUE" FALSE )
option( WITH_NATIVE64
option( WITH_NATIVE64
"Include 64 bit native integer in build by setting WITH_NATIVE64 to TRUE" TRUE )
option( WITH_NATIVE32
option( WITH_NATIVE32
"Include 32 bit native integer in build by setting WITH_NATIVE32 to TRUE" TRUE )
option( WITH_NATIVE16
option( WITH_NATIVE16
"Include 16 bit native integer in build by setting WITH_NATIVE16 to TRUE" TRUE )
option( WITH_TCM "Activate tcmalloc by setting WITH_TCM to TRUE" FALSE )
......@@ -72,7 +72,7 @@ if(CMAKE_HOST_UNIX OR MINGW)
else()
set(ARCHITECTURE "unknown")
endif()
if(ARCHITECTURE)
message("-- Architecture is " ${ARCHITECTURE})
endif()
......@@ -184,7 +184,7 @@ if(APPLE AND USE_OpenMP)
set(OpenMP_libomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
endif()
endif()
### several of the third-party tools use auto-make and autoconf
### we need to make sure that they are installed
execute_process(COMMAND autogen --version OUTPUT_VARIABLE AUTOGEN_VER)
......@@ -192,7 +192,7 @@ execute_process(COMMAND autogen --version OUTPUT_VARIABLE AUTOGEN_VER)
if(MINGW)
execute_process(COMMAND sh autoconf --version OUTPUT_VARIABLE AUTOCONF_VER)
else()
execute_process(COMMAND autoconf --version OUTPUT_VARIABLE AUTOCONF_VER)
execute_process(COMMAND autoconf --version OUTPUT_VARIABLE AUTOCONF_VER)
endif()
string(LENGTH "${AUTOCONF_VER}" AUTOCONF_VER_LEN)
......@@ -285,7 +285,7 @@ find_package (Git REQUIRED)
find_package (Doxygen QUIET COMPONENTS dot)
if (DOXYGEN_FOUND)
add_custom_target( apidocs
add_custom_target( apidocs
COMMAND sh -c "( cat ${CMAKE_CURRENT_SOURCE_DIR}/lbcrypto-doxy-config && echo PROJECT_NUMBER=${PALISADE_VERSION} ) | ${DOXYGEN_EXECUTABLE} -"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating API documentation with Doxygen"
......@@ -349,7 +349,7 @@ add_custom_target(
add_custom_target(
gmp_all
COMMAND make
COMMAND make
COMMAND make install
WORKING_DIRECTORY ${GMPSRCDIR}
)
......@@ -462,7 +462,7 @@ add_custom_target(
add_custom_target(
tcm_clean
COMMAND rm -rf include/gperftools include/google lib/libtcmalloc_minimal* lib/pkgconfig/libtcmalloc* lib/pkgconfig/libprofiler.pc share/doc/gperftools
COMMAND rm -rf include/gperftools include/google lib/libtcmalloc_minimal* lib/pkgconfig/libtcmalloc* lib/pkgconfig/libprofiler.pc share/doc/gperftools
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/third-party
)
......@@ -613,4 +613,3 @@ install(FILES
# Install the export set for use with the install-tree
install(EXPORT PalisadeTargets DESTINATION
"${INSTALL_CMAKE_DIR}" COMPONENT dev)
......@@ -48,19 +48,19 @@ further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported
by contacting the project team at [contact@palisade-crypto.org](mailto:contact@palisade-crypto.org). contact@palisade-crypto.org
Alternatively, you may report individually to one of the members of the Steering Council.
Complaints will be reviewed and investigated and will result in a response that is deemed
necessary and appropriate to the circumstances. The project team is obligated to
maintain confidentiality with regard to the reporter of an incident.
Alternatively, you may report individually to one of the members of the Steering Council.
Complaints will be reviewed and investigated and will result in a response that is deemed
necessary and appropriate to the circumstances. The project team is obligated to
maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith
may face temporary or permanent repercussions as determined by other members of the
Project maintainers who do not follow or enforce the Code of Conduct in good faith
may face temporary or permanent repercussions as determined by other members of the
project's leadership.
If you feel that your report has not been followed up satisfactorily, then you may
If you feel that your report has not been followed up satisfactorily, then you may
contact our sponsor organisation NumFOCUS at [info@numfocus.org](mailto:info@numfocus.org) for further redress.
## Attribution
......
......@@ -4,7 +4,7 @@
contacting the palisade team at PALISADE-crypto.org to plan your
modifications so that they can be implemented efficiently and in a
way that doesn't conflict with any other planned future development
* Fork the `palisade-development` repository on GitLab
* Clone your new repository or add it as a remote to an existing repository
* Check out the existing `master` branch, then start a new feature branch for
......@@ -74,7 +74,7 @@
* Code may make use of most C++11 features. The minimum required
compiler versions are GCC X.Y and Clang X.Y.
* Avoid manual memory management (i.e. `new` and `delete`), preferring to use
standard library containers, as well as `std::unique_ptr` and
`std::shared_ptr` when dynamic allocation is required.
......@@ -100,4 +100,4 @@
#Acknowlegement
We would like to Acknowlege the Cantera Project. We have modeled this
document on their examples.
\ No newline at end of file
document on their examples.
......@@ -48,7 +48,7 @@ names, contact info, and date of first inclusion into the team.
of the Steering team are the face of the project, and are
responsible for officially interfacing with external communities,
organizations, non-profits, and companies. The Steering team
may create new teams, as appropriate. Each member of the Steering
may create new teams, as appropriate. Each member of the Steering
team is entitled to one vote on all elected matters.
* **Pre-release:** The Pre-release team administers the current
......@@ -196,7 +196,7 @@ are permitted. Sample voting topics are as follows (but are not limited to this
Votes can happen on the following topics with passing contingent on a majority.
At least 2/3 of the Steering team members should vote, but abstentions
are permitted. Sample voting topics are as follows (but are not limited to this list):
are permitted. Sample voting topics are as follows (but are not limited to this list):
* Approving an expedited release testing schedule
* Approving a Major Pre-release
......@@ -244,4 +244,4 @@ the latest pre-release will be considered active.
Once a pre-release is accepteqd for stable release, that pre-release
is considered inactive.
Governance.md
Displaying Governance.md.
\ No newline at end of file
Displaying Governance.md.
......@@ -9,4 +9,4 @@ Redistribution and use in source and binary forms, with or without modification,
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
......@@ -18,7 +18,7 @@ set(PALISADE_LIBRARIES PALISADEcore PALISADEpke @THIRDPARTYLIBS@ @OpenMP_CXX_FLA
set(OPENMP_INCLUDES "@OPENMP_INCLUDES@" )
set(OPENMP_LIBRARIES "@OPENMP_LIBRARIES@" )
set(PALISADE_CXX_FLAGS "@CMAKE_CXX_FLAGS@ @OpenMP_CXX_FLAGS@")
set(PALISADE_CXX_FLAGS "@CMAKE_CXX_FLAGS@ @OpenMP_CXX_FLAGS@")
set(PALISADE_C_FLAGS "@CMAKE_C_FLAGS@ @OpenMP_C_FLAGS@")
if( "@WITH_NTL@" STREQUAL "Y" )
......
......@@ -9,4 +9,3 @@ else()
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
set (CMAKE_GENERATOR "Unix Makefiles" CACHE INTERNAL "" FORCE)
\ No newline at end of file
set (CMAKE_GENERATOR "Unix Makefiles" CACHE INTERNAL "" FORCE)
......@@ -2,7 +2,7 @@ PALISADE Lattice Cryptography Library
=====================================
PALISADE is a general lattice cryptography library that currently includes efficient implementations of the following lattice cryptography capabilities:
* Homomorphic Encryption (HE):
* Homomorphic Encryption (HE):
* Brakerski/Fan-Vercauteren scheme (3 variants)
* Brakerski-Gentry-Vaikuntanathan scheme
* Cheon-Kim-Kim-Song scheme
......@@ -13,7 +13,7 @@ PALISADE is a general lattice cryptography library that currently includes effic
* Identity-Based Encryption
* Ciphertext-Policy Attribute-Based Encryption
PALISADE is a cross-platform C++11 library supporting Linux, Windows, and macOS. The supported compilers are g++ v6.1 or later and clang++ v6.0 or later.
PALISADE is a cross-platform C++11 library supporting Linux, Windows, and macOS. The supported compilers are g++ v6.1 or later and clang++ v6.0 or later.
The library also includes unit tests and sample application demos.
......@@ -22,13 +22,13 @@ PALISADE is available under the BSD 2-clause license.
The library is based on modular architecture with the following layers:
* Math operations layer supporting low-level modular arithmetic, number theoretic transforms, and integer sampling. This layer is implemented to be portable to multiple hardware computation substrates.
* Lattice operations layer supporting lattice operations, ring algebra, and lattice trapdoor sampling.
* Lattice operations layer supporting lattice operations, ring algebra, and lattice trapdoor sampling.
* Crypto layer containing efficient implementations of lattice cryptography schemes.
* Encoding layer supporting multiple plaintext encodings for cryptographic schemes.
A major focus is on the usability of the schemes. For instance, all HE schemes with packing use the same common API, and are implemented using runtime polymorphism.
PALISADE implements efficient Residue Number System (RNS) algorithms to achieve high performance, e.g., PALISADE was used as the library for a winning genome-wide association studies solution at iDASH’18.
PALISADE implements efficient Residue Number System (RNS) algorithms to achieve high performance, e.g., PALISADE was used as the library for a winning genome-wide association studies solution at iDASH’18.
By default, the library is built without external dependencies. But the user is also provided options to add GMP/NTL and/or tcmalloc third-party libraries if desired.
......@@ -66,23 +66,23 @@ mkdir build
cd build
cmake ..
```
Note that CMake will check for any system dependencies that are needed for the build process. If the CMake build does not complete successfully, please review the error CMake shows at the end. If the error does not go away (even though you installed the dependency), try running "make clean" to clear the CMake cache.
5. If you want to use any external libraries, such as NTL/GMP or tcmalloc, install these libraries.
6. Build PALISADE by running the following command (this will take few minutes; using the -j make command-line flag is suggested to speed up the build)
```
make
```
If you want to build only library files or some other subset of PALISADE, please review the last paragraph of this page.
If you want to build only library files or some other subset of PALISADE, please review the last paragraph of this page.
After the "make" completes, you should see the PALISADE library files in the lib folder, binaries of demos in bin/demo, binaries of benchmarks in bib/benchmark, and binaries for unit tests in the unittest folder.
7. Install PALISADE to a system directory (if desired or for production purposes)
```
make install
```
```
You would probably need to run "sudo make install" unless you are specifying some other install location. You can change the install location by running
"cmake -DCMAKE_INSTALL_PREFIX=/your/path ..". The header files are placed in the "include/palisade" folder of the specified path, and the binaries of the library are copied directly to the "lib" folder. For example, if no installation path is provided in Ubuntu (and many other Unix-based OSes), the header and library binary files will be placed in "/usr/local/inlude/palisade" and "/usr/local/lib", respectively.
......@@ -94,7 +94,7 @@ Run unit tests to make sure all capabilities operate as expected
make testall
```
Run sample code to test, e.g.,
Run sample code to test, e.g.,
```
bin/examples/pke/simple-integers
```
......@@ -116,14 +116,14 @@ PALISADE CI continually tests our builds on the following operating systems:
PALISADE users have reported successful operation on the following systems:
* Free BSD
* Free BSD
* Ubuntu [16.04]
Please let us know the results if you have run PALISADE any additional systems not listed above.
Please let us know the results if you have run PALISADE any additional systems not listed above.
Detailed information about building PALISADE
------------------------------
More detailed steps for some common platforms are provided in the following Wiki articles:
[Instructions for building PALISADE in Linux](https://gitlab.com/palisade/palisade-development/wikis/Instructions-for-building-PALISADE-in-Linux)
......@@ -138,5 +138,4 @@ PALISADE provides many CMake/make configuration options, such as installing spec
[Configuration flags to customize the build](https://gitlab.com/palisade/palisade-development/wikis/Configuration-flags-to-customize-the-build)
[Instructions for building C++ projects that use PALISADE](https://gitlab.com/palisade/palisade-development/wikis/Instructions-for-building-projects-that-use-PALISADE)
[Instructions for building C++ projects that use PALISADE](https://gitlab.com/palisade/palisade-development/wikis/Instructions-for-building-projects-that-use-PALISADE)
......@@ -14,7 +14,7 @@
01/30/2020: PALISADE v1.8.0 (development) is released
* Adds the Gama-Izabachene-Nguyen-Xie (GINX) bootstrapping to the FHEW implementation
* Includes other FHEW optimizations: now the bootstrapping key size is 20x times smaller and runtime about 2.5x faster
* Includes other FHEW optimizations: now the bootstrapping key size is 20x times smaller and runtime about 2.5x faster
* Adds XOR and XNOR gates to FHEW
01/22/2020: PALISADE v1.7.4 (stable) is released in the palisade-release repo
......@@ -42,7 +42,7 @@
* Adds an optimized implementation of the FHEW scheme for Boolean-circuit homomorphic encryption, supporting standard HE parameters. Performs bootstrapping for each binary gate, and hence supports the evaluation of arbitrary Boolean circuits.
* Adds the ring dimension as an option when generating crypto contexts for BFV variants.
* Improves the noise growth of the BEHZ variant of BFV (referred to as the BFVrnsB scheme in PALISADE).
* Fixes several bugs.
* Fixes several bugs.
9/12/2019: PALISADE v1.6.0 is released
......@@ -54,7 +54,7 @@
3/20/2019: PALISADE v1.5.0 is released
* Fixes the vulnerability found in https://eprint.iacr.org/2017/785 (PKC'19) for the PRE schemes based on BGV/BFV
* Fixes the vulnerability found in https://eprint.iacr.org/2017/785 (PKC'19) for the PRE schemes based on BGV/BFV
* Adds PRE modes for BGV/BFV that are secure under honest re-reencryption attacks (recommended security for practical use)
* Adds support for splitting lattice trapdoor sampling into offline and online phases (used by digital signatures, IBE, and ABE constructions)
* Fixes bugs related to the multi-threaded mode of operation
......
This diff is collapsed.
# Ignore all filters for now
filter=-build
filter=-legal
filter=-readability
filter=-runtime
filter=-whitespace
......@@ -3,37 +3,41 @@
*
* @copyright Copyright (c) 2019, New Jersey Institute of Technology (NJIT)
* All rights reserved.
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. THIS SOFTWARE IS
* PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
Description:
This code exercises the Proxy Re-Encryption capabilities of the NJIT Lattice crypto library.
In this code we:
- Generate a key pair.
- Encrypt a string of data.
- Decrypt the data.
- Generate a new key pair.
- Generate a proxy re-encryption key.
- Re-Encrypt the encrypted data.
- Decrypt the re-encrypted data.
We configured parameters (namely the ring dimension and ciphertext modulus) to provide a level of security roughly equivalent to a root hermite factor of 1.007 which is generally considered secure and conservatively comparable to AES-128 in terms of computational work factor and may be closer to AES-256.
This code exercises the Proxy Re-Encryption capabilities of the NJIT
Lattice crypto library. In this code we:
- Generate a key pair.
- Encrypt a string of data.
- Decrypt the data.
- Generate a new key pair.
- Generate a proxy re-encryption key.
- Re-Encrypt the encrypted data.