Commit 92431e94 authored by Yuriy Polyakov's avatar Yuriy Polyakov

removed all files from the old repo

parent 12327497
Pipeline #1025 failed with stage
PALISADE TPOC:
--------------
palisade@njit.edu
Project PI:
-----------
Kurt Rohloff, rohloff@njit.edu
\ No newline at end of file
Contributors
============
Technical POC
-------------
PALISADE Project: palisade@njit.edu
Project Lead, Kurt Rohloff: rohloff@njit.edu
Members of the following organizations are or have been contributors to the PALISADE library:
* [NJIT (New Jersey Institute of Technology)](http://www.njit.edu)
* [MIT (Massachusetts Institute of Technology)](http://www.mit.edu)
* [Raytheon BBN Technologies](http://www.bbn.com)
* [UCSD (University of California San Diego)](https://ucsd.edu/)
* [Applied Communication Sciences (ACS) / Vencore Labs](http://www.appcomsci.com/)
* [LGS Innovations (Lucent Government Systems)](http://www.lgsinnovations.com/)
* [Galois, Inc.](https://galois.com/)
Thanks to Our Sponsors
----------------------
PALISADE is being developed with the generous support of our sponsors on the following projects:
* [DARPA SAFEWARE](http://www.darpa.mil/program/safeware) (2015-present) : Sponsored by the Defense Advanced Research Projects Agency (DARPA) and the Army Research Laboratory (ARL) under Contract Numbers W911NF-15-C-0226 and W911NF-15-C-0233. The views expressed are those of the authors and do not necessarily reflect the official policy or position of the Department of Defense or the U.S. Government.
* [NSA CAE](https://www.nsa.gov/resources/educators/centers-academic-excellence/cyber-defense/) (2015-2016) : Project sponsored by the National Security Agency under Grant H98230-15-1-0274. The United States Government is authorized to reproduce and distribute reprints notwithstanding any copyright notice herein.
* Simons Foundation
* IARPA RAMPARTS (2016-present) : This research is based upon work supported in part by the Office of the Director of National Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA). The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies, either express or implied, of ODNI, IARPA, or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for governmental purposes notwithstanding any copyright annotation therein.
* Sloan Foundation
License Information
-------------------
Copyright (c) 2017, 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.
\ No newline at end of file
#Multi OS makefile
ifeq ($(OS),Windows_NT)
# ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
# CCFLAGS += -D AMD64
# endif
# ifeq ($(PROCESSOR_ARCHITECTURE),x86)
# CCFLAGS += -D IA32
# endif
include Makefile.mingw64
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
#CCFLAGS += -D LINUX
include Makefile.lin
endif
ifeq ($(UNAME_S),Darwin)
#CCFLAGS += -D OSX
include Makefile.mac
endif
ifeq ($(UNAME_S),CYGWIN_NT-6.1)
#CCFLAGS += -D CYGWIN
include Makefile.mingw
endif
# UNAME_P := $(shell uname -p)
# ifeq ($(UNAME_P),x86_64)
# CCFLAGS += -D AMD64
# endif
# ifneq ($(filter %86,$(UNAME_P)),)
# CCFLAGS += -D IA32
# endif
# ifneq ($(filter arm%,$(UNAME_P)),)
# CCFLAGS += -D ARM
# endif
endif
include Makefile.common
#
#Copyright (c) 2015, 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.
#
################
# Makefile.abe builds the attribute-based encryption components of the PALISADE library
# Includes unit tests and demos
################
ABESRCDIR := src/abe
ABEBINDIR := $(BINDIR)/build/abe
ABETESTDIR := src/abe/unittest
ABEDEMODIR := src/abe/demo
ABESOURCES := $(shell find $(ABESRCDIR)/lib -name '*.cpp' ! -name '*-public.cpp')
ABEUNITSOURCES := $(wildcard $(ABESRCDIR)/unittest/*.cpp)
ABEDEMOSOURCES := $(wildcard $(ABESRCDIR)/demo/*.cpp)
ABEOBJECTSALL = $(patsubst $(ABESRCDIR)/%,$(ABEBINDIR)/%,$(patsubst %.cpp,%.o,$(ABESOURCES)))
ABEOBJECTS = $(filter %-impl.o,$(ABEOBJECTSALL))
ABEUNITOBJECTS := $(patsubst $(ABESRCDIR)/%,$(ABEBINDIR)/%,$(patsubst %.cpp,%.o,$(ABEUNITSOURCES)))
ABEDEMOOBJECTS += $(patsubst $(ABESRCDIR)/%,$(ABEBINDIR)/%,$(patsubst %.cpp,%.o,$(ABEDEMOSOURCES)))
ABE_TEST_TARGET := $(EXTTESTDIR)/abe/tests$(EXESUFFIX)
-include $(ABEOBJECTS:.o=.d)
-include $(ABEUNITOBJECTS:.o=.d)
-include $(ABEDEMOOBJECTS:.o=.d)
.PHONY: allabe
allabe: allcore $(EXTLIBDIR)/$(PALISADEABELIB) $(ABE_TEST_TARGET) allabedemos
.PHONY: allabedemos
allabedemos: $(patsubst $(ABEBINDIR)/demo/%,$(BINDIR)/demo/abe/%,$(patsubst %.o,%$(EXESUFFIX),$(ABEDEMOOBJECTS)))
$(BINDIR)/demo/abe/%$(EXESUFFIX): $(ABEBINDIR)/demo/%.o $(EXTLIBDIR)/$(PALISADEABELIB) $(EXTLIBDIR)/$(PALISADECORELIB) $(NTLLIB) $(GMPLIB)
@mkdir -p $(@D)
$(CC) -o $@ $< $(EXTLIB) -lPALISADEabe -lPALISADEcore $(NTLLIB) $(GMPLIB)
#this builds the palisade library out of the objects
$(EXTLIBDIR)/$(PALISADEABELIB): $(ABEOBJECTS) $(EXTLIBDIR)/$(PALISADECORELIB) $(NTLLIB) $(GMPLIB)
@echo " -- abe:linking $@ from ABEOBJECTS"
@mkdir -p $(EXTLIBDIR)
ifdef COVERAGE
$(LIBCMD) $@ $(ABEOBJECTS)
else
$(LIBCMD) $@ $(ABEOBJECTS) $(EXTLIB) -lPALISADEcore $(NTLLIB) $(GMPLIB)
endif
### #this builds the individual objects that make up the library .
.PRECIOUS: $(ABEBINDIR)/%
$(ABEBINDIR)/%:
@if [ "$(suffix $@)" = ".o" ] ; \
then \
mkdir -p $(@D) ;\
echo $(CC) $(CPPFLAGS) $(INC) -c -o $@ $(patsubst $(ABEBINDIR)/%,$(ABESRCDIR)/%,$(patsubst %.o,%.cpp,$@)) ;\
$(CC) -MM $(CPPFLAGS) $(INC) $(patsubst $(ABEBINDIR)/%,$(ABESRCDIR)/%,$(patsubst %.o,%.cpp,$@)) > $(patsubst %.o,%.d,$@) ;\
mv -f $(patsubst %.o,%.d,$@) $(patsubst %.o,%.d.tmp,$@) ;\
sed -e 's|.*\.o:|$(ABEBINDIR)/$*:|' < $(patsubst %.o,%.d.tmp,$@) > $(patsubst %.o,%.d,$@) ;\
rm -f $(patsubst %.o,%.d.tmp,$@) ; \
$(CC) $(CPPFLAGS) $(INC) -c -o $@ $(patsubst $(ABEBINDIR)/%,$(ABESRCDIR)/%,$(patsubst %.o,%.cpp,$@)) ;\
fi
#this target is used to cleanup, it is called from the top Makefile
.PHONY: cleanabe
cleanabe:
$(RM) -fr $(ABEBINDIR) $(EXTLIBDIR)/$(PALISADEABELIB) `dirname $(ABE_TEST_TARGET)` $(BINDIR)/demo/abe
# this links test executable from objects in the test build directory
$(ABE_TEST_TARGET): $(UNITTESTMAINOBJ) $(ABEUNITOBJECTS) $(EXTLIBDIR)/$(PALISADEABELIB) $(EXTLIBDIR)/$(PALISADECORELIB) $(NTLLIB) $(GMPLIB)
@mkdir -p `dirname $(ABE_TEST_TARGET)`
$(CC) -o $(ABE_TEST_TARGET) $(UNITTESTMAINOBJ) $(ABEUNITOBJECTS) $(EXTLIB) -lPALISADEabe -lPALISADEcore $(TEST_LIB) $(NTLLIB) $(GMPLIB)
#used to run tests from make
.PHONY: testabe
testabe: $(ABE_TEST_TARGET)
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(ROOTDIR)/$(THIRDPARTYLIBDIR):$(ROOTDIR)/$(EXTLIBDIR) $(ABE_TEST_TARGET)
.PHONY: installabe
installabe: installdirs
install -t $(LIB_DEST) $(EXTLIBDIR)/$(PALISADEABELIB)
.PHONY: uninstallabe
uninstallabe:
rm $(LIB_DEST)/$(PALISADEABELIB)
#
#Copyright (c) 2015, 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.
#
# this defines the source, build (obj) and binary directories
BMARK_SRC := benchmark/src
BMARK_BIN := $(BINDIR)/benchmark
BMARK_BUILD := $(BINDIR)/build/benchmark
BMLIB_SRCDIR := google/benchmark-master/src
BMLIB_IFLAG := -I$(BMLIB_SRCDIR)/../include
BMLIB_SRC := $(wildcard $(BMLIB_SRCDIR)/*.cc)
BMLIB_OBJ := $(patsubst $(BMLIB_SRCDIR)/%,$(BMARK_BUILD)/%,$(BMLIB_SRC:.cc=.o))
#this defines the benchmark library archive
BMLIB_LIB := $(BMARK_BIN)/libbenchmark.a
REGEX_FLAG := -DHAVE_STD_REGEX #note does not work for g++ <version 4.9
#### this warning flag should NOT be used with clang
WARNING_FLAG := -Wno-unused-but-set-variable
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
WARNING_FLAG :=
endif
LIBBENCHMARK_FLAGS := $(REGEX_FLAG) -DHAVE_STEADY_CLOCK -DNDEBUG $(WARNING_FLAG) -Wno-unused-variable ##-Wextra -Wshadow -pedantic -pedantic-errors -Wfloat-equal -Wzero-as-null-pointer-constant -fstrict-aliasing -Wstrict-aliasing -Wno-nested-anon-types
#define list of source files (all files with .cc in the BMARK_SRC
BM_SOURCES := $(wildcard $(BMARK_SRC)/*.cpp)
BM_OBJS := $(BM_SOURCES:$(BMARK_SRC)%.cpp=$(BMARK_BUILD)%.o)
-include $(BM_OBJS:.o=.d)
BMARKS := $(BM_SOURCES:$(BMARK_SRC)%.cpp=$(BMARK_BIN)%$(EXESUFFIX))
benchmark: $(BMLIB_LIB) $(BMARKS)
# this builds objects from sources for benchmark library
.PRECIOUS: $(BMLIB_SRCDIR)/%.o
$(BMARK_BUILD)/%.o: $(BMLIB_SRCDIR)/%.cc
@mkdir -p $(BMARK_BUILD)
$(CC) $(CPPFLAGS) $(LIBBENCHMARK_FLAGS) $(BMLIB_IFLAG) -o $@ -c $<
.PRECIOUS: $(BMLIB_LIB)
$(BMLIB_LIB): $(BMLIB_OBJ)
@mkdir -p $(BMARK_BIN)
ar cr $(BMLIB_LIB) $(BMLIB_OBJ)
ranlib $(BMLIB_LIB)
# this is where the benchmark library code lives
BMLIB_LIBSRCDIR := google/benchmark-master/include
########### PALISADE BENCHMARKS BUILD HERE
#this is is the Include directive for the palisade code being benchmarked
BM_IFLAG := -Isrc -Isrc/core/lib -Isrc/pke/lib $(BMLIB_IFLAG) $(THIRDPARTYINCLUDE)
PLIBS := $(EXTLIBDIR)/$(PALISADEPKELIB) $(EXTLIBDIR)/$(PALISADECORELIB) $(NTLLIB) $(GMPLIB)
# this builds executables from objects for benchmarks
$(BMARK_BIN)/%$(EXESUFFIX): $(BMARK_BUILD)/%.o $(BMLIB_LIB) $(PLIBS)
@mkdir -p $(BMARK_BIN)
$(CC) $(BM_IFLAG) $(LIBBENCHMARK_FLAGS) $(BMLIB_IFLAG) $< -o $@ $(LOADTHREADFLAG) $(RDYNAMIC) $(BMLIB_LIB) -L$(EXTLIBDIR) -lPALISADEpke -lPALISADEcore $(NTLLIB) $(GMPLIB) -lpthread $(LOADTHREADFLAG) -fopenmp -lgomp $(SHLWAPI)
# this builds objects from sources for benchmarks
.PRECIOUS: $(BMARK_BUILD)/%.o
$(BMARK_BUILD)/%.o: $(BMARK_SRC)/%.cpp
@mkdir -p $(BMARK_BUILD)
@$(CC) -MM $(CPPFLAGS) $(BM_IFLAG) $(LIBBENCHMARK_FLAGS) $(BM_IFLAG) $(patsubst $(BMARK_BUILD)/%,$(BMARK_SRC)/%,$(patsubst %.o,%.cpp,$@)) > $(patsubst %.o,%.d,$@)
@mv -f $(patsubst %.o,%.d,$@) $(patsubst %.o,%.d.tmp,$@)
@sed -e 's|.*\.o:|$@:|' < $(patsubst %.o,%.d.tmp,$@) > $(patsubst %.o,%.d,$@)
@rm -f $(patsubst %.o,%.d.tmp,$@)
$(CC) $(CPPFLAGS) $(BM_IFLAG) $(LIBBENCHMARK_FLAGS) $(BM_IFLAG) -c -o $@ $(patsubst $(BMARK_BUILD)/%,$(BMARK_SRC)/%,$(patsubst %.o,%.cpp,$@))
#this target is usesd to cleanup, it is called from the top Makefile
.PHONY: cleanbenchmark
cleanbenchmark:
@echo " Cleaning Benchmarks...";
$(RM) -r $(BMARK_BIN) $(BMARK_BUILD) $(BMLIB_OBJ) $(BMLIB_LIB)
bstrings:
@echo BMARKS is $(BMARKS)
@echo BMLIB_SRC is $(BMLIB_SRC)
@echo BMLIB_OBJ is $(BMLIB_OBJ)
@echo $(BMLIB_SRC:.cc=.o)
@echo $(BMLIB_SRCDIR)
#
#Copyright (c) 2015, 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.
#
################
# Makefile contains core definitions and then includes build instructions
# for making all the palisade components
################
TEST_LIB := $(LOADTHREADFLAG) -fopenmp $(GMPLIB) -lgomp
# NOTE select the appropriate set of CPPFLAGS
# most code is checked into git with the first line active
#CPPFLAGS += -Wall -w -g ## undefine for single thread debug NO OPTIMIZATION operation
#CPPFLAGS += -Wall -Ofast -w #-g #undefine for single thread debug operation
#CPPFLAGS += -Wall -Ofast -w -fopenmp -g ##undefine for parallel debug operation
#CPPFLAGS += -Wall -O3 -w -DNDEBUG -pg ##undefine for single thread best performance operation with gprof profiling
##parallel best performance operation with debug
##warn everything
##no threading or optimization when doing coverage testing
CPPFLAGS += -g -Wall -Werror
## handle coverage test options if user set COVERAGE to any value on the command line
ifdef COVERAGE
CPPFLAGS += --coverage -Wno-unknown-pragmas
TEST_LIB += --coverage
LIBSUFFIX=.a
LIBCMD=$(AR) crv
else
ifdef MEM
CPPFLAGS += -O0
else
CPPFLAGS += -O3
endif
CPPFLAGS += -fopenmp $(COMPTHREADFLAG) ##optimize and threads
endif