GithubHelp home page GithubHelp logo

Comments (2)

renaud-sirdey avatar renaud-sirdey commented on May 16, 2024

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.

NanXiao avatar NanXiao commented on May 16, 2024

Hi Renaud,

Got it! Thanks very much for your time and help!

Best Regards
Nan Xiao

from cingulata.

Related Issues (20)

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.