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

Is our Not well optimized (for boolean)? #678

Open
bcm-at-zama opened this issue Dec 26, 2024 · 1 comment
Open

Is our Not well optimized (for boolean)? #678

bcm-at-zama opened this issue Dec 26, 2024 · 1 comment

Comments

@bcm-at-zama
Copy link
Contributor

I see in https://docs.zama.ai/fhevm/guides/smart-contracts/gas#boolean-operations-ebool that a Not cost

not 30,000

for an ebool.

I wonder if it's expected: if a ciphertext c encrypts 0 or 1, then not c could be computed at 1 - c which is purely linear so almost free. No?

@bcm-at-zama
Copy link
Contributor Author

Maybe it's too be done directly at the TFHE-rs level, I don't know, but if I am not wrong, not should be almost free for booleans

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

1 participant