Comments (4)
Hello, I have tried some tests with v3.4.5, and it's just working fine. I guess there are some mistakes in your evaluator
?
Here is my code
from seal import *
from seal_helper import *
print_example_banner("Example: BFV Basics")
parms = EncryptionParameters(scheme_type.BFV)
poly_modulus_degree = 4096 # you can use yours, it just fast
parms.set_poly_modulus_degree(poly_modulus_degree)
parms.set_coeff_modulus(CoeffModulus.BFVDefault(poly_modulus_degree))
parms.set_plain_modulus(1024) # any positive integer, maybe a prime number and keep it small will be better in theory
context = SEALContext.Create(parms)
print_parameters(context)
evaluator = Evaluator(context)
encoder = IntegerEncoder(context)
keygen = KeyGenerator(context)
public_key = keygen.public_key()
secret_key = keygen.secret_key()
encryptor = Encryptor(context, public_key)
decryptor = Decryptor(context, secret_key)
value1 = -7
plain1 = Plaintext(encoder.encode(value1))
value2 = 25
plain2 = Plaintext(encoder.encode(value2))
x1 = Ciphertext()
encryptor.encrypt(plain1, x1)
evaluator.add_plain_inplace(x1, plain2)
evaluator.multiply_plain_inplace(x1, plain2)
p1 = decryptor.decrypt(x1)
v1 = encoder.decode_int64(p1)
print(v1) # 450
from seal-python.
Hey,
thanks for the quick reply!
I just ran that code and it does work, however, when I add another multiplication (after the already existing one), the output is 11250
, shouldn't it be 1010
? Or am I confusing the plaintext modulus here with what would happen if I used batching?
from seal-python.
(25-7)x25x25=11250, I think it's right.
For the detail, you can refer to the notes from the example.
or the paper, which implements the BFV scheme.
from seal-python.
Ah, sorry, I got something mixed up with the parameters! Never mind, so no problem after all.
from seal-python.
Related Issues (20)
- ValueError: step count too large HOT 3
- 请问不支持整数编码吗? HOT 7
- "relinearize_inplace" doesn‘t work HOT 1
- Problem recreating 5_CKKS_Basics.py HOT 1
- How to calculate Polynomial Multiplication? HOT 10
- TypeError: cannot pickle 'seal.Ciphertext' object HOT 4
- encrypted1 and encrypted2 parameter mismatch HOT 7
- Not found the seal lib file, check the `SEAL/build/lib` HOT 14
- AttributeError: module 'seal' has no attribute 'EncryptionContext' HOT 2
- NameError: name 'EncryptionParameters' is not defined HOT 1
- Multiplication Depth analysis HOT 3
- LNK2001 with LNK1120: 88 unresolved externals
- seal-python docs HOT 3
- how to conda install after build HOT 1
- IntegerEncoder HOT 1
- 为什么样例文件夹中没有ckks方案的例子呢?如何快速上手此库呢? HOT 1
- 'seal.Ciphertext' object attribute 'scale' is read-only HOT 5
- Logistic Regression over Encrypted Data with BFV Scheme HOT 6
- How to get the coefficient of ciphertext? HOT 5
- I/O Error when trying to decrypt a loaded cipher text HOT 1
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 seal-python.