Comments (8)
Hi siaaron045
I tested as the following command.
// Encrypt mvec
Ciphertext cipher = scheme.encrypt(mvec, slots, L);
// Multiple negative value (= -0.1)
Ciphertext cmultCipher = scheme.multByConst(cipher, -0.1);
scheme.reScaleByAndEqual(cmultCipher, 1);
I checked the decrypted result. And It seems correct.
It would be better if you can attach some part of your code.
Best, Kyoohyung Han
from fullrns-heaan.
I test your code and the answer is right,
but when ''cipher'' is a negative number's ciphertext or make multiplication of two negative ciphertext,the answer is wrong.
like this:
//Encrypt mvec=-5 Ciphertext cipher1 = scheme.encrypt(mvec, slots, L); Ciphertext cipher2=cipher1; Ciphertext cmultCipher = scheme.multByConst(cipher1, -1); //or Ciphertext cmultCipher = scheme.mult(cipher1, cipher2); scheme.reScaleByAndEqual(cmultCipher, 1);
both of the answers are wrong.
So the encrypted number can't be negative?
from fullrns-heaan.
Oh... when I put -1 instead of -5 it works.
This problem came from the negate function in Context.cpp.
I will fix this problem soon.
Thanks for the report.
from fullrns-heaan.
Yes,but it works only when mvec=-1, i put -2,-3,-4 the answers are wrong.
And the function scheme.mult(cipher1, cipher2) does not work when make multiplication of two negative ciphertext expect -1.
Thanks.
from fullrns-heaan.
The error still exist.
I hope you can take some time to fix it.
Thank you.
from fullrns-heaan.
@KyoohyungHan Looks like you found the error source. Can you be more specific where is it? I think I can submit a patch.
from fullrns-heaan.
The error still exist. I hope you can take some time to fix it. Thank you.
Hi~ is this problem solved? I found the same error too,but i have no idea how to fix it?Where exactly does this problem occur?
from fullrns-heaan.
This problem is not because of the negate function, but because of a problem with encode, where for copying simply adding the modulus leads to an encoding error. You can fix it by referring to the encoding functions of OPENFHE or Lattigo.
from fullrns-heaan.
Related Issues (5)
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 fullrns-heaan.