Comments (2)
Dear Nan,
Thanks a lot for your feedback.
Indeed, the second version of the code above is the correct one.
This is so because encrypted-domain variables have to be read from the standard input in your Cingulata programs.
In the first version of your code, the matrix values are constant clear domain values and treated as such through the Integer8 type (which in such a case performs compile-time mixed clear domain/encrypted domain calculation simplifications in order to rightfully save non necessary FHE calculations).
This will result in an circuit with a constant output which does as such never need to be run in the encrypted domain (although the resulting core dump in ABC is far from graceful and should be fixed to get a more meaningful warning or error).
So in summary, if you do something like this :
Integer8 a=5,b=3;
cout<<a+b;
All is created is a circuit which always output 8 and does never require any encrypted-domain calculations, whereas if you do something like,
Integer8 a,b;
cin>>a;
cin>>b;
cout<<a+b;
Then, you create a program which takes two encrypted values and output their (encrypted) sum.
As a further subtetly, a and/or b may be still be clear-domain variables but since they are read from the standard input their values will not induce any simplification or constant progagation in the resulting circuit (the βcardioβ test case gives an example of handling mixed clear/crypto domain variables in Cingulata programs) β avoidable homomorphic operations will then be simplified as runtime.
Hope this helps clarifying,
Best regards, Renaud
from cingulata.
Hi Renaud,
Got it! Thanks very much for your time and help!
Best Regards
Nan Xiao
from cingulata.
Related Issues (20)
- how to perform division operation like multiplication HOT 2
- subtraction not giving correct result HOT 3
- select oprator issue(working correctly for positive numbers) negative numbers giving wrong result HOT 5
- in the beow program array encrypting up to a[4][0] after giving incorrect at decryption side
- corrupted size .vs. prev size error HOT 1
- ERROR TfheBitExec::read: Cannot open file '' run.sh: line 35: 8 Aborted (core dumped) ./tfhe-vector2d-encrypt 5 3 HOT 2
- 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); HOT 1
- error: could not convert 'a1.std::vector<cingulata::CiInt>::operator[](((std::vector<cingulata::CiInt>::size_type)i))' from '__gnu_cxx::__alloc_traits<std::allocator<cingulata::CiInt> >::value_type {aka cingulata::CiInt}' to 'std::vector<cingulata::CiInt>' c1[i]=add(a1[i],b1[i]); HOT 1
- terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc run.sh: line 38: 9 Aborted HOT 2
- cingulata::CiBitVector cingulata::int_ops::BinaryOper::operator()(const cingulata::CiBitVector&, const cingulata::CiBitVector&) const: Assertion `lhs.size() > 0' failed. HOT 1
- In docker mode Cingulata Bfv does not compile any more HOT 5
- Error response from deamon: unexpected error reading Dockerfile
- error: no match for 'operator>>' (operand types are 'cingulata::CiInt' and 'cingulata::CiInt') alpha[j] =temp3 >> eta;
- error: no match for 'operator=' (operand types are 'LweSample' and 'cingulata::CiBit') ciphertext2[i]=t; HOT 1
- external file data not importing properly, working fine normal c++ file
- "Select a parameter set in CinguParam" ? HOT 4
- terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 17) >= this->size() (which is 8) HOT 1
- how to read negative values in 2d array after encryption i am trying to decrypt same variable not giving exact values
- multiplicaton of negative and positive, negative and negative not working
- 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))
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cingulata.