Skip to content

Conversation

@nategraf
Copy link
Collaborator

@nategraf nategraf commented Jul 1, 2025

This PR is an approach to supporting adding and subtracting terms that do not include a private scalar (e.g. "5" in (x + Scalar::from(5u64)) * g).

As part of supporting this, the ScalarTerm enum is added, which can be a Var or Unit, where unit represents the constant Scalar::ONE in the proof system.

Supporting this in the LinearRelation while being able to map the relation to a standardized form from serialization to Fiat-Shamir posed some difficulty. This PR includes one possible implementation.

Additionally, in the course of writing this PR, I realized that the LinearRelation::label function on main right now is incorrect, in that if there are any terms with non-unit weight, their value will not be included in the serialization. This PR fixes this issue.

@nategraf nategraf requested a review from mmaker July 2, 2025 05:08
@mmaker mmaker merged commit 1ecd4ff into main Jul 4, 2025
6 of 7 checks passed
Chausseaumoine pushed a commit to Chausseaumoine/sigma-rs that referenced this pull request Jul 7, 2025
@mmaker mmaker deleted the victor/add-scalar-and-group-ops branch July 23, 2025 23:58
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.

3 participants