Skip to content

Potential Bug in SELECT circuit #9

@Koukyosyumei

Description

@Koukyosyumei

In select.circom, line 79 uses an assert statement to check whether field[j] is binary. However, in Circom, assert does not generate a constraint—it only checks the condition during the witness generation, which is insufficient for enforcing validity within the circuit being proven.

assert(fields[j] >= 0 && fields[j] <= 1);

To properly constrain the signal to be binary, this line should be replaced with:

(field[j] - 1) * field[j] === 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions