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

Unify signed bit extraction via gadget #482

Closed
hero78119 opened this issue Oct 28, 2024 · 0 comments · Fixed by #515
Closed

Unify signed bit extraction via gadget #482

hero78119 opened this issue Oct 28, 2024 · 0 comments · Fixed by #515
Assignees

Comments

@hero78119
Copy link
Collaborator

hero78119 commented Oct 28, 2024

We have signed bit extraction implementation in various place, especially in some gadget
E.g.

  • SRAI
  • InnerSignedLtConfig
    let is_lhs_neg = IsLtConfig::construct_circuit(
    cb,
    || "lhs_msb",
    max_signed_limb_expr.clone(),
    lhs.limbs.iter().last().unwrap().expr(), // msb limb
    1,
    )?;
    let is_rhs_neg = IsLtConfig::construct_circuit(
    cb,
    || "rhs_msb",
    max_signed_limb_expr,
    rhs.limbs.iter().last().unwrap().expr(), // msb limb
    1,
    )?;
  • msb_decompose
    pub fn msb_decompose<F: SmallField>(

By switch to SignedExtendConfig introduced in this PR #455 we can save wit from 2 -> 1 with same lookup cost (1 bit + 1 limb check)

@hero78119 hero78119 changed the title Unify signed bit extraction via Unify signed bit extraction via gadget Oct 28, 2024
@KimiWu123 KimiWu123 self-assigned this Oct 30, 2024
matthiasgoergens added a commit that referenced this issue Nov 1, 2024
matthiasgoergens added a commit that referenced this issue Nov 1, 2024
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 a pull request may close this issue.

2 participants