GithubHelp home page GithubHelp logo

cea-list / cingulata Goto Github PK

View Code? Open in Web Editor NEW
401.0 24.0 43.0 7.42 MB

Cingulata (pronounced "tchingulata") is a compiler toolchain and RTE for running C++ programs over encrypted data by means of fully homomorphic encryption techniques.

License: Other

CMake 5.73% C++ 74.88% Shell 10.41% Python 1.01% C 7.98%
homomorphic-encryption compiler fhe toolchain privacy encryption

cingulata's Introduction

Cingulata

Cingulata (pronounced "tchingulata") is a compiler toolchain and RTE for running C++ programs over encrypted data by means of fully homomorphic encryption techniques.

Currently, an in-house implementation of the B/FV scheme and the TFHE library are supported.

The toolchain is formerly known as the Armadillo toolchain and was introduced in this paper.

For more details, installation guide and tutorials, please check out the project's Wiki.

Enjoy,

Happy cryptocomputing!

cingulata's People

Contributors

aubrypaspro avatar cab404 avatar nanxiao avatar patrick-ruf avatar renaud-sirdey avatar renaud1239 avatar sergeshpak avatar sergiu-carpov avatar ssmiler avatar vherbert 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

cingulata's Issues

corrupted size .vs. prev size error

Hi, I got this error while I was developing our own application using cingulata.
corrupted size vs. prev_size
run.sh: line 41: 9 Aborted (core dumped) ./tfhe-$NAME-exec

Has anyone else encountered this before with cingulata? how do I work on fixing this? I will be happy to share code for my application if needed..

missing depencency on readline

Hi,

In order to compile CMakeFiles/abc.dir/src/base/main/mainUtils.c.o, libreadline-dev needs to be installed.
It would be nice to add find_package(READLINE REQUIRED) in the CMakeList.txt

Error during exec make

I found another issue during compilation
build$ make -j 8
Scanning dependencies of target abc
Scanning dependencies of target helper
Scanning dependencies of target generator
Scanning dependencies of target fhe_fv
[ 1%] Creating directories for 'abc'
[ 2%] Building CXX object runtime/fhe_apps/src/CMakeFiles/helper.dir/helper.cxx.o
[ 3%] Building CXX object circuit/generator/src/CMakeFiles/generator.dir/bit-tracker.cxx.o
[ 5%] Building CXX object circuit/generator/src/CMakeFiles/generator.dir/circuit.cxx.o
[ 5%] Building CXX object circuit/generator/src/CMakeFiles/generator.dir/node.cxx.o
[ 6%] Building CXX object runtime/fhe_fv/src/CMakeFiles/fhe_fv.dir/ciphertext.cxx.o
[ 7%] Building CXX object circuit/generator/src/CMakeFiles/generator.dir/storage.cxx.o
[ 8%] Building CXX object runtime/fhe_fv/src/CMakeFiles/fhe_fv.dir/encdec.cxx.o

[ 9%] Performing download step (hg clone) for 'abc'
[ 10%] Building CXX object runtime/fhe_fv/src/CMakeFiles/fhe_fv.dir/fhe_params.cxx.o
[ 11%] Building CXX object runtime/fhe_fv/src/CMakeFiles/fhe_fv.dir/keygen.cxx.o
abort: could not find web.cacerts: /etc/ssl/certs/ca-certificates.crt
CMake Error at /home/nguyen/DEV/CINGULATA/PRIVATE/NGUYEN/build/optim/abc/tmp/abc-hgclone.cmake:30 (message):
Failed to clone repository: 'https://bitbucket.org/alanmi/abc'

optim/CMakeFiles/abc.dir/build.make:89: recipe for target 'optim/abc/src/abc-stamp/abc-download' failed
make[2]: *** [optim/abc/src/abc-stamp/abc-download] Error 1
CMakeFiles/Makefile2:176: recipe for target 'optim/CMakeFiles/abc.dir/all' failed
make[1]: *** [optim/CMakeFiles/abc.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 12%] Building CXX object runtime/fhe_fv/src/CMakeFiles/fhe_fv.dir/keys_all.cxx.o
[ 13%] Building CXX object runtime/fhe_fv/src/CMakeFiles/fhe_fv.dir/keys_share.cxx.o

"Select a parameter set in CinguParam" ?

Hi,

when compiling a program of sorting (from thfe) using
docker run -it --rm -v $(pwd):/cingu cingulata:bfv

I get the following message :

[ 63%] Generating fhe_params.xml
TEST_NAME=bfv-wifsSort
MODE=static
The parameters with lwe-estimator commit fb7deba are not in CinguParam.
DESIRED_PARAMS=25_bkz_sieve_128_2
No parameter found with static mode. Automatically switch to interactive mode.
MODE=interactive

  1. Select a parameter set in CinguParam (using LWE-Estimator commit=3019847)
  2. Quit
    Please enter your choice: 1
    INTERACTIVE_CHOICE=
    COMMIT_ID=3019847
    Invalid choice. You can generate suitable parameter sets using CinguParam module.

And then the execution using bvf mode is very very slow (2 minutes for sorting 4 integers with 10 cores!)

Thanks
Frédéric Gava

The cxx file :

/* local includes */
//#include

//#include <bit_exec/decorator/attach.hxx>
//#include <bit_exec/decorator/depth.hxx>
//#include <bit_exec/decorator/stat.hxx>
#include <bit_exec/tracker.hxx>
#include <ci_context.hxx>
#include <ci_fncs.hxx>
#include <ci_int.hxx>
#include <int_op_gen/mult_depth.hxx>

/* namespaces */
using namespace std;
using namespace cingulata;

int main() {

CiContext::set_config(make_shared(),
make_shared());

vector a(list_size, CiInt::u8);
CiInt t{CiInt::u8};
CiBit swap;

for (int i = 0; i < list_size; ++i)
a[i].read("a_" + to_string(i));

for (int i = 0; i < list_size-1; ++i) {
for (int j = i+1; j < list_size; ++j) {
swap = a[i] > a[j];
t = select(swap, a[i], a[j]);
a[i] = select(swap, a[j], a[i]);
a[j] = t;
}
}

for (int i = 0; i < list_size; ++i)
a[i].write("r_" + to_string(i));

/* Export to file the "tracked" circuit */
CiContext::get_bit_exec_t()->export_blif(blif_name, "wifsSort");
}

and the Cmake file

cmake_minimum_required(VERSION 3.0)

set(TEST_NAME bfv-wifsSort)

set(SRCS wifsSort.cxx)
set(LIST_SIZE 4)
set(BLIF_NAME ${TEST_NAME}.blif)
set(BLOP_NAME ${TEST_NAME}-opt.blif)

add_compile_options(-Dlist_size=${LIST_SIZE} -Dblif_name="${BLIF_NAME}")

set(GEN_NAME ${TEST_NAME}-gen)

add_executable(${GEN_NAME} ${SRCS})

target_link_libraries(${GEN_NAME} common)

add_custom_command(OUTPUT ${BLIF_NAME}
COMMAND ./${GEN_NAME}
DEPENDS ${GEN_NAME})

add_custom_command(OUTPUT ${BLOP_NAME}
COMMAND python3 ${OPTIM_DIR}/abc_optimize.py -i ${BLIF_NAME} -o ${BLOP_NAME} -v
DEPENDS abc ${BLIF_NAME})

set(XML_PARAMS fhe_params.xml)
set(MUL_DEPTH_SCRIPT ${OPTIM_DIR}/graph_info.py)

add_custom_command(OUTPUT ${XML_PARAMS}
COMMAND bash ${SCRIPT_DIR}/selectParams.sh ${TEST_NAME} python3 ${MUL_DEPTH_SCRIPT} ${BLOP_NAME} --mult_depth_max ${MODEL} ${MIN_SECU} ${POLITIC}
DEPENDS ${BLOP_NAME})

add_custom_target(${TEST_NAME} ALL
DEPENDS ${XML_PARAMS} runtime)

set(APPS_DIR ${CMAKE_BINARY_DIR}/apps)
set(CIRCUIT ${BLOP_NAME})
configure_file("run.sh.in" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run.sh" @only)
file(COPY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run.sh" DESTINATION . FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
file(COPY "README.md" DESTINATION .)
file(COPY "data.txt" DESTINATION .)

make' returned a non-zero code: 100

Sending build context to Docker daemon 3.584kB
Step 1/10 : FROM ubuntu:18.04
---> a2a15febcdf3
Step 2/10 : RUN apt-get update -qq && apt-get install --no-install-recommends -y ca-certificates cmake g++ git libboost-program-options-dev make
---> Running in 7f039499a2cf
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
Package ca-certificates is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'ca-certificates' has no installation candidate
E: Unable to locate package cmake
E: Unable to locate package git
E: Unable to locate package libboost-program-options-dev
E: Unable to locate package make
The command '/bin/sh -c apt-get update -qq && apt-get install --no-install-recommends -y ca-certificates cmake g++ git libboost-program-options-dev make' returned a non-zero code: 100

after completion Configuring incomplete, errors occurred!

Sending build context to Docker daemon 3.584kB
Step 1/9 : FROM ubuntu:18.04
---> a2a15febcdf3
Step 2/9 : RUN apt-get update -qq && apt-get install --no-install-recommends -y ca-certificates cmake g++ git libboost-program-options-dev make
---> Using cache
---> 4e1950b65b54
Step 3/9 : ARG uid=1000
---> Using cache
---> 12fe7247bab5
Step 4/9 : ARG uname=cingu
---> Using cache
---> ac23c3dbfd4c
Step 5/9 : RUN useradd -u $uid $uname
---> Running in 99bf835caae0
useradd: UID 0 is not unique
The command '/bin/sh -c useradd -u $uid $uname' returned a non-zero code: 4
(base) root@user-HP-Z240-Tower-Workstation:/home/user/Cingulata# docker run -it --rm -v $(pwd):/cingu cingulata:tfheCMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find TFHE (missing: TFHE_INCLUDE_DIR TFHE_LIBRARIES)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake/FindTFHE.cmake:16 (find_package_handle_standard_args)
CMakeLists.txt:28 (find_package)

-- Configuring incomplete, errors occurred!
See also "/cingu/build_tfhe/CMakeFiles/CMakeOutput.log"

terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc run.sh: line 38: 9 Aborted

int main() {
CiContext::set_config(
make_shared<decorator::Attach<TfheBitExec, decorator::Stat>>(
"tfhe.pk", TfheBitExec::Public),
make_shared());
vector a1(6, CiInt::u8);
vector b1(6, CiInt::u8);
vector c1(6, CiInt::u8);
for(int i=0;i<6;i++)
{
a1[i].read("a"+to_string(i));
b1[i].read("b"+to_string(i));
}
c1=add(a1,b1);
for(int i=0;i<6;i++)
{
c1[i].write("c"+to_string(i));
}
CiContext::get_bit_exec_t<decorator::Stat>()->print();
}
vector add(vector& a1,vector& b1)
{
vector temp{6,CiInt::u8};
for (int i=0;i<6;i++)
{
temp[i]=a1[i]*b1[i];
}
return temp;
}

make fails

During make I get the following error:

`jim@xps:~/Documents/[MyDecFiles]/Code/Cingulata/build$ make
[ 5%] Built target generator
[ 6%] Performing download step (hg clone) for 'abc'
applying clone bundle from https://api.media.atlassian.com/file/87d21905-22e2-4eb2-ba40-f84ee25aeb4b/binary?client=fa8179bc-0876-4538-9379-3b6f652769a8&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3MiOnsidXJuOmZpbGVzdG9yZTpmaWxlOjg3ZDIxOTA1LTIyZTItNGViMi1iYTQwLWY4NGVlMjVhZWI0YiI6WyJyZWFkIl19LCJleHAiOjE1NTk4MjYxNjUsImlzcyI6ImZhODE3OWJjLTA4NzYtNDUzOC05Mzc5LTNiNmY2NTI3NjlhOCIsIm5iZiI6MTU1OTgyNTc0NX0.vXbE-tAtJU2nka8ItAr1pKGyonMTiCJisA967rmLXns
adding changesets
adding manifests
transaction abort!
rollback completed
abort: Input/output error: /home/jim/Documents/[MyDecFiles]/Code/Cingulata/build/optim/abc/src/abc/.hg/store/00manifest.d
CMake Error at /home/jim/Documents/[MyDecFiles]/Code/Cingulata/build/optim/abc/tmp/abc-hgclone.cmake:30 (message):
Failed to clone repository: 'https://bitbucket.org/alanmi/abc'

optim/CMakeFiles/abc.dir/build.make:89: recipe for target 'optim/abc/src/abc-stamp/abc-download' failed
make[2]: *** [optim/abc/src/abc-stamp/abc-download] Error 1
CMakeFiles/Makefile2:176: recipe for target 'optim/CMakeFiles/abc.dir/all' failed
make[1]: *** [optim/CMakeFiles/abc.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
`

It seems that the page in https://bitbucket.org/alanmi/abc is no longer active so make fails.

Error response from deamon: unexpected error reading Dockerfile

Hi, i'm actually a beginner on Cingulata and Docker. I have an issue with the downloading step and i don't understand why.

I work on a Virtual machine with the 18.04 Ubuntu version.
To explaine briefly the step i followed:
- I downloaded Docker
- next i created a directory named Dockerfile.bfv and run the following script

image

thanks

In docker mode Cingulata Bfv does not compile any more

Hello
I cloned the last github Cingulata . In docker mode Cingulata Bfv does not compile any more . In fact abc optimisation fails

Please find below my traces

Traceback (most recent call last):
File "/cingu/build_bfv/tests/../optim/abc_optimize.py", line 77, in
circuit = utils.readBlifFile(args.input_file)
File "/cingu/build_bfv/optim/utils.py", line 32, in readBlifFile
return parseBlif(lines)
File "/cingu/build_bfv/optim/utils.py", line 68, in parseBlif
G.nodes()[out]['gate'] = True
TypeError: list indices must be integers or slices, not str
tests/old_bfv/wiretap/CMakeFiles/old-bfv-wiretap.dir/build.make:64: recipe for target 'tests/old_bfv/wiretap/old-bfv-wiretap-opt.blif' failed
make[2]: *** [tests/old_bfv/wiretap/old-bfv-wiretap-opt.blif] Error 1
CMakeFiles/Makefile2:3026: recipe for target 'tests/old_bfv/wiretap/CMakeFiles/old-bfv-wiretap.dir/all' failed

It seems that last merged modifications « Fixed for NetworkX 2.4 » are involved.

I did a git clone + git checkout of commit id (4 th june) without these changes eb02824, in docker compilation the whole bfv compilation was succcesful.

The information i have got for python-networks in docker

crypto@is154572:~/essaie/Cingulata$ docker run -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --rm -v $(pwd):/cingu cingulata:bfv bash
cingu@d4e68dd02df2:/cingu$ apt-cache policy python3-networkx
python3-networkx:
Installed: 1.11-1ubuntu3
Candidate: 1.11-1ubuntu3
Version table:
*** 1.11-1ubuntu3 500
500 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
100 /var/lib/dpkg/status
1.11-1ubuntu2 500
500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

Regards
Patrick RUF

Assert fail in Bdc_ManAlloc function

Hi all,

Greetings from me! I want to implement a simple matrix multiplication using Cingulata, and modify hello.cxx as following:

#include <iostream>
#include <fstream>
#include <vector>

/* local includes */
#include <integer.hxx>

/* namespaces */
using namespace std;

int main()
{
	vector<vector<Integer8>> a = {{1, 2}, {3, 4}};
	vector<vector<Integer8>> b = {{5, 6}, {7, 8}};
	vector<vector<Integer8>> c(2, vector<Integer8>(2));

	for (vector<vector<Integer8>>::size_type row = 0; row < a.size(); row++) {
		for (vector<Integer8>::size_type col = 0; col < b[row].size(); col++) {
			c[row][col] = 0;
			for (vector<Integer8>::size_type i = 0; i < a[row].size(); i++) {
				c[row][col] += a[row][i] * b[i][col];
			}
		}
	}

	for (vector<vector<Integer8>>::size_type row = 0; row < a.size(); row++) {
		for (vector<Integer8>::size_type col = 0; col < b[row].size(); col++) {
			cout << c[row][col];
		}
	}
	
	FINALIZE_CIRCUIT("hello.blif");
}

Compile it and generate following core dump:

[ 27%] Built target generator
Scanning dependencies of target hello-gen
[ 33%] Building CXX object tests/hello/CMakeFiles/hello-gen.dir/hello.cxx.o
[ 38%] Linking CXX executable hello-gen
[ 38%] Built target hello-gen
[ 83%] Built target abc
[ 88%] Generating hello.blif
false false false false true true true true false false false true false false false false false false true false true false true true false false true true false false true false [ 94%] Generating hello-opt.blif
abc: /home/xiaonan/Cingulata/build/optim/abc/src/abc/src/bool/bdc/bdcCore.c:73: Bdc_ManAlloc: Assertion `pPars->nVarsMax > 1 && pPars->nVarsMax < 16' failed.
../../optim/abc_optimize.bash: line 62: 126624 Aborted                 (core dumped) $ABC_PATH/abc -c "$1"
make[2]: *** [tests/hello/CMakeFiles/hello.dir/build.make:65: tests/hello/hello-opt.blif] Error 1
make[1]: *** [CMakeFiles/Makefile2:746: tests/hello/CMakeFiles/hello.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Use gdb to check the stack backtrace:

Program terminated with signal SIGABRT, Aborted.
#0  0x00007f978fb9b860 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007f978fb9b860 in raise () from /usr/lib/libc.so.6
#1  0x00007f978fb9cec9 in abort () from /usr/lib/libc.so.6
#2  0x00007f978fb940bc in __assert_fail_base () from /usr/lib/libc.so.6
#3  0x00007f978fb94133 in __assert_fail () from /usr/lib/libc.so.6
#4  0x000055eff23e420f in Bdc_ManAlloc ()
#5  0x000055eff1c4670f in Abc_NtkBidecResyn ()
#6  0x000055eff1be73b3 in Abc_CommandBidec ()
#7  0x000055eff1d8b4aa in CmdCommandDispatch ()
#8  0x000055eff1d8ba4f in CmdApplyAlias ()
#9  0x000055eff1d7b19f in Cmd_CommandExecute ()
#10 0x000055eff1dfdf99 in Abc_RealMain ()
#11 0x000055eff1df4af1 in main ()

Could you help to check this issue? Thanks very much in advance!

Update:
If I modify the code get matrix values from input, it works:

#include <iostream>
#include <fstream>
#include <vector>

/* local includes */
#include <integer.hxx>

/* namespaces */
using namespace std;

int main()
{
	vector<vector<Integer8>> a(2, vector<Integer8>(2));
	vector<vector<Integer8>> b(2, vector<Integer8>(2));
	vector<vector<Integer8>> c(2, vector<Integer8>(2));
	
	cin >> a[0][0];
	cin >> a[0][1];
	cin >> a[1][0];
	cin >> a[1][1];
	cin >> b[0][0];
	cin >> b[0][1];
	cin >> b[1][0];
	cin >> b[1][1];
	
	for (vector<vector<Integer8>>::size_type row = 0; row < a.size(); row++) {
		for (vector<Integer8>::size_type col = 0; col < b[row].size(); col++) {
			c[row][col] = 0;
			for (vector<Integer8>::size_type i = 0; i < a[row].size(); i++) {
				c[row][col] += a[row][i] * b[i][col];
			}
		}
	}

	for (vector<vector<Integer8>>::size_type row = 0; row < a.size(); row++) {
		for (vector<Integer8>::size_type col = 0; col < b[row].size(); col++) {
			cout << c[row][col];
		}
	}
	
	FINALIZE_CIRCUIT("hello.blif");
}

So could you explain the reason? Thanks!

Best Regards
Nan Xiao

The abstract layer for back-end library

Hi all,

Greetings from me!

I check all FHE apps, such as encrypt, decrypt all include fv.hxx, so if I want to integrate other FHE libraries, e.g., HElib, I must modify all these FHE apps.

So is there possible to implement an abstract layer, such as HEAT? If I substitute the back-end library, the FHE apps won't need be changed.

Thanks in advance!

Best Regards
Nan Xiao

The question about stream template functions in sliced-integer.hxx

Hi all,

The template istream and ostream functions defined in sliced-integer.hxx:

/*! \brief implementation of the formatted read operation */
template<typename BitType>
std::istream& operator>>
  (std::istream &in_io,
   BitType &value_o)
{
  value_o.read (in_io);
  return in_io;
}

/*! \brief implementation of the formatted write operation */
template<typename BitType>
std::ostream& operator<<
  (std::ostream &out_io,
   const BitType &value_i)
{
  value_i.write (out_io);
  return out_io;
}

will cause build error when source code who includes sliced-integer.hxx and do input and output some basic data types, such as string. For example:

#include <integer.hxx>
......
string a;
cout << a;

Compile it:

error: ambiguous overload for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘std::__cxx11::string {aka std::__cxx11::basic_string<char>}’)
  cout << a;
  ~~~~~^~~~
In file included from /home/xiaonan/Cingulata/circuit/generator/src/../include/integer.hxx:30:0,
                 from /home/xiaonan/Cingulata/tests/trivium/trivium.cxx:25:
/home/xiaonan/Cingulata/circuit/generator/src/../include/sliced-integer.hxx:312:15: note: candidate: std::ostream& operator<<(std::ostream&, const BitType&) [with BitType = std::__cxx11::basic_string<char>; std::ostream = std::basic_ostream<char>]
 std::ostream& operator<<
               ^~~~~~~~
In file included from /usr/include/c++/7.2.1/string:52:0,
                 from /usr/include/c++/7.2.1/bits/locale_classes.h:40,
                 from /usr/include/c++/7.2.1/bits/ios_base.h:41,
                 from /usr/include/c++/7.2.1/ios:42,
                 from /usr/include/c++/7.2.1/ostream:38,
                 from /usr/include/c++/7.2.1/iostream:39,
                 from /home/xiaonan/Cingulata/tests/trivium/trivium.cxx:22:
/usr/include/c++/7.2.1/bits/basic_string.h:6272:5: note: candidate: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
     operator<<(basic_ostream<_CharT, _Traits>& __os,

Similar for input string:

string a;
cin >> a;

So is it really necessary to define these two template functions?

Thanks very much!

Best Regards
Nan Xiao

in the beow program array encrypting up to a[4][0] after giving incorrect at decryption side

int main(int argc, char* argv[]) {
if (argc < 3) {
cerr << "Usage: " << argv[0] << " " << endl;
exit(-1);
}

int64_t a[13][2]= {{0,1},{1,2},{2,7},{3,20},{4,54},{5,148},{6,403},{7,1096},{8,2980},{9,8103},{10,30},{20,40},{30,50}};
int64_t exp;
CiInt zero{0, 64, false};

CiContext::set_bit_exec(make_shared<TfheBitExec>("tfhe.sk", TfheBitExec::Secret));

CiInt num{exp, 64, false};
vector<vector> X(13, vector{2,64,false});

 cout<<"enter a value to compute exponent";
 cin>>exp;
  zero.encrypt().write("zero");
   num.encrypt().write("num");
 //  n.encrypt().write("n");

 for(int i=0;i<13;i++)
{
for(int j=0;j<2;j++)
 {    
      X[i][j]=a[i][j];
     X[i][j].encrypt().write("x"+to_string(i)+to_string(j));  
  }
} 

cout<<"encryption completed";

Reading data from text file after assigning to CiInt variables in 2d matrix, variables at decryption side showing zero(data contain both positive and negative numbers))

q values is 4Location: 0 : 0 Data in textFile: 51
Location: 0 : 1 Data in textFile: 25
Location: 0 : 2 Data in textFile: 30
Location: 0 : 3 Data in textFile: 11
Location: 0 : 4 Data in textFile: 1
Location: 1 : 0 Data in textFile: 47
Location: 1 : 1 Data in textFile: 32
Location: 1 : 2 Data in textFile: 13
Location: 1 : 3 Data in textFile: 2
Location: 1 : 4 Data in textFile: -1
Location: 2 : 0 Data in textFile: 57
Location: 2 : 1 Data in textFile: 28
Location: 2 : 2 Data in textFile: 41
Location: 2 : 3 Data in textFile: 13
Location: 2 : 4 Data in textFile: 1
Location: 3 : 0 Data in textFile: 46
Location: 3 : 1 Data in textFile: 31
Location: 3 : 2 Data in textFile: 15
Location: 3 : 3 Data in textFile: 2
Location: 3 : 4 Data in textFile: -1

pull & compile

Please tell me how to fix it !
build$ cmake ..
-- The C compiler identification is GNU 5.5.0
-- The CXX compiler identification is GNU 5.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake-3.5/Modules/ExternalProject.cmake:1809 (message):
error: could not find hg for clone of abc
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/ExternalProject.cmake:2459 (_ep_add_download_command)
optim/CMakeLists.txt:5 (ExternalProject_Add)

-- Configuring incomplete, errors occurred!

external file data not importing properly, working fine normal c++ file

std::ifstream fp("train.txt");
// this is for reading and opening existing file sudoku.txt
for(int row = 0; row < q; row++){
for(int column = 0; column < c; column++){
fp >> train[row][column];
// from fp we read the characters
}
}
for(int row = 0; row < q; row++){
for(int column = 0; column < c; column++){
cout << train[row][column] << " ";
}
cout << endl;
}
fp.close();

Floating point exception

Hi,
I found a big bug during key generation, please tell me how to fix it ?

~/fhe/Cingulata/build/tests/hello$ ../../apps/generate_keys
Floating point exception


OS : Ubuntu 16.04LTS

Using both configuration from wiki intall_os and specific versions as below, but this problem cannot be solved !
gmp-6.1.1.tar.bz2
mpir-2.7.2.tar.bz2
mpfr-4.0.1.tar.bz2
flint-2.5.2.tar.gz

error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<cingulata::CiInt> > >::value_type {aka std::vector<cingulata::CiInt>}' to 'std::vector<cingulata::CiInt>*' for argument '1' to 'cingulata::CiInt prediction(std::vector<cingulata::CiInt>*, std::vector<cingulata::CiInt>*, cingulata::CiInt, cingulata::CiInt, cingulata::CiInt)' y_hat[i]=prediction(X[i],W,b,p,n);

predtiction function 1st and 2nd arguments are 1dimensional vectors, remaining are variables

if possible can you please provide how to pass variables, 1d,2d vectors to functions

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.