Skip to content

Conversation

@tlepoint
Copy link
Owner

This PR addresses the task to make center_vt constant time.
It introduces a new center method which is safe, constant-time, and public.
It also introduces center_vec and updates center_vec_vt to use the constant-time implementation.
Tests are added to verify correctness.


PR created automatically by Jules for task 3415539913779892970 started by @tlepoint

- Implement `center` as a constant-time method in `Modulus`.
- Implement `center_vec` as a constant-time vector method.
- Update `center_vec_vt` to call `center_vec`.
- Remove private `center_vt`.
- Add tests.

Co-authored-by: tlepoint <[email protected]>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules bot and others added 3 commits January 31, 2026 22:58
- Implement `center` as a constant-time method in `Modulus`.
- Implement `center_vec` as a constant-time vector method.
- Update `center_vec_vt` to call `center_vec` and update its documentation.
- Remove private `center_vt`.
- Add tests for `center` and `center_vec`.
- Use `const_time_cond_select` for constant-time logic.

Co-authored-by: tlepoint <[email protected]>
- Implement `center` as a constant-time method in `Modulus`.
- Implement `center_vec` as a constant-time vector method.
- Remove `center_vec_vt` and `center_vt`.
- Update usages in `crates/fhe` and `crates/fhe-math` to use `center_vec` and remove `unsafe`.
- Add tests for `center` and `center_vec`.
- Use `const_time_cond_select` for constant-time logic.

Co-authored-by: tlepoint <[email protected]>
@tlepoint tlepoint merged commit 8d67113 into main Jan 31, 2026
6 checks passed
@tlepoint tlepoint deleted the center_vt_constant_time-3415539913779892970 branch January 31, 2026 23:23
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

Successfully merging this pull request may close these issues.

1 participant