Skip to content

FpVar::conditional_enforce_equal accepts unequal constants #213

Description

@1sgtpepper

Summary of Bug

FpVar::conditional_enforce_equal returns success for every constant/constant pair
without checking either value or the guard. Unequal constants with a dynamically
allocated true guard therefore add no equality obligation, and the false implication
can be satisfied and proved.

Expected behavior is !condition || left == right. Equal constants and a false guard
must remain valid, while unequal constants under a true guard must be rejected.

Open PR #196 changes the Boolean
implementation only. This report concerns the distinct FpVar constant/constant branch
in src/fields/fp/mod.rs.

Version

Steps to Reproduce

  1. Check out the isolated
    reproduction commit.

  2. Run:

    cd reproductions/field-conditional-equality
    cargo +1.85.1 test --locked --test field_conditional_equality \
      unequal_constants_must_force_public_condition_false -- --exact --nocapture
  3. The test verifies a proof for unequal constants under public condition=true.
    Disabled, equal, mixed-variable, explicit-implication, and matrix-shape controls behave
    as expected.

CI: run 29434225152,
job 87416653404.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions