fhevm icon indicating copy to clipboard operation
fhevm copied to clipboard

Fix scalar compression: handle scalars separately from ciphertexts

Open Budalebah opened this issue 2 months ago • 5 comments

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

Budalebah avatar Sep 06 '25 12:09 Budalebah

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.

cla-bot[bot] avatar Sep 06 '25 12:09 cla-bot[bot]

⚠️ The sha of the head commit of this PR conflicts with #832. Mergify cannot evaluate rules on this PR. ⚠️

mergify[bot] avatar Sep 06 '25 12:09 mergify[bot]

Your PR seems broken.

immortal-tofu avatar Sep 08 '25 09:09 immortal-tofu

⚠️ The sha of the head commit of this PR conflicts with #832. Mergify cannot evaluate rules on this PR. ⚠️

mergify[bot] avatar Sep 15 '25 15:09 mergify[bot]

⚠️ The sha of the head commit of this PR conflicts with #832. Mergify cannot evaluate rules on this PR. ⚠️

mergify[bot] avatar Oct 09 '25 10:10 mergify[bot]