fhevm
fhevm copied to clipboard
Fix scalar compression: handle scalars separately from ciphertexts
This PR properly handles scalars separately from ciphertexts.
Problem
- Scalars are not ciphertexts, but the code was trying to compress them like ciphertexts
- This caused a panic: "cannot compress a scalar"
Solution
- Scalars are now serialized directly instead of being compressed
- Added proper handling for scalar compression/decompression in all relevant functions
- Scalars use type number 200 and are handled separately from ciphertext compression
Changes
- Updated
compress()function to handle scalars separately - Updated all
decompress()functions to handle scalar type (200) - Removed panic and replaced with proper serialization
Files Changed
coprocessor/fhevm-engine/fhevm-engine-common/src/types.rs
Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @renoschubert on file. In order for us to review and merge your code, please sign:
- For individual contribution: our CLA
- for Bounty submission, if you are an individual: our T&C
- for Bounty submission, if you are a company: our T&C to get yourself added.
If you already signed one of this document, just wait to be added to the bot config.
⚠️ The sha of the head commit of this PR conflicts with #832. Mergify cannot evaluate rules on this PR. ⚠️
Your PR seems broken.
⚠️ The sha of the head commit of this PR conflicts with #832. Mergify cannot evaluate rules on this PR. ⚠️
⚠️ The sha of the head commit of this PR conflicts with #832. Mergify cannot evaluate rules on this PR. ⚠️