Skip to content

Sub-word operations #10

Description

@cedoor

Summary

Expose sub-word operations that extract or manipulate individual bits and bytes within a Ciphertext<T>.

Background

Poulpy's FheUint exposes the following operations that squid currently does not wrap:

  • get_bit_glwe / get_bit_lwe — extract a single encrypted bit
  • get_byte — extract one encrypted byte
  • zero_byte — zero out a specific byte in-place
  • splice_u8 / splice_u16 — copy a byte or halfword from one ciphertext into another
  • sext — sign-extend from a given byte position

Unlike BDD ops, these are linear operations on GLWE coefficients (rotate, trace, add, subtract) — they do not trigger bootstrapping and therefore accumulate noise. A chain of sub-word ops that feeds into a BDD arithmetic op is fine, as the BDD eval bootstraps automatically. If sub-word ops are the last step before decryption, an explicit Identity refresh may be needed.

Work

  • Wrap each op as a method on Context
  • Document the noise implications and when Identity is needed
  • Follow the safe-defaults convention from conventions.mdc

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions