Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python test failures #13

Open
blossomin opened this issue Oct 14, 2024 · 4 comments
Open

Python test failures #13

blossomin opened this issue Oct 14, 2024 · 4 comments

Comments

@blossomin
Copy link

hello, I built this lib and tested the python. found many failures see the log file:
test_results.log

@lightbulb128
Copy link
Owner

lightbulb128 commented Oct 16, 2024

Does the C++ side tests fail too?

If this is only a python-side problem, try adding the debug printing lines to see what's wrong here.

    def test_add_sub(self):
        ghe = self.ghe
        message1 = ghe.random_simd_full()
        message2 = ghe.random_simd_full()
        plain1 = ghe.encoder.encode_simd(message1)
        plain2 = ghe.encoder.encode_simd(message2)
        cipher1 = ghe.encryptor.encrypt_symmetric_new(plain1, False)
        cipher2 = ghe.encryptor.encrypt_symmetric_new(plain2, False)
        added = ghe.evaluator.add_new(cipher1, cipher2)
        decoded = ghe.encoder.decode_simd(ghe.decryptor.decrypt_new(added))
        self.tester.assertTrue(ghe.near_equal(ghe.add(message1, message2), decoded))
        subtracted = ghe.evaluator.sub_new(cipher1, cipher2)
        decoded = ghe.encoder.decode_simd(ghe.decryptor.decrypt_new(subtracted))
        print(ghe.sub(message1, message2)) # added
        print(decoded)                     # added
        self.tester.assertTrue(ghe.near_equal(ghe.sub(message1, message2), decoded))

@blossomin
Copy link
Author

blossomin commented Oct 16, 2024

all the C++ tests passed, thanks, I will try.

and are the interfaces of troy repo and troy-nova kept the same?
BTW, could you simply describe which file to replace or modify for the Pencil?
if convenient for you, can I add your wechat

@lightbulb128
Copy link
Owner

Mostly the same for python interfaces. On C++/CUDA side the names are converted to snake_case from camelCase.

Yes my wx is lightbulb128.

@lightbulb128
Copy link
Owner

Python issue is a duplicate of #10. Solved by #14. Report if any further problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants