Skip to content

Conversation

@mj850
Copy link
Contributor

@mj850 mj850 commented Dec 6, 2024

In the fix for the audit, we added validations to ensure that none of the fields of proofs should be Zero or the Identity Point. This makes sense for most fields since they are computed via randomly generated scalars and it is near impossible for them to be zero (Those fields being zero would suggest tampering with the proof)

However, in this one case, it is possible and even common for the Yd field of a zero proof to be the identity point.
Since Yd is computed as D.Mul(y) where D is the D component of a ciphertext and y is a randomly generated scalar, Yd is zero when y is generated as zero (no longer possible) or if D is zero.

D of a ciphertext is zero (identity point) when we perform a subtraction of a ciphertext on itself. This is what we do to zero out fields in apply pending balances and is not an uncommon scenario. This means that we it is possible for Yd to be identity point and we should remove that validation.

Also checked other fields and added tests for other fields where this could be possible and confirmed that this doesn't apply apply to other fields, so we can leave the rest of the validations in place.

@mj850 mj850 merged commit 8d08733 into main Dec 6, 2024
11 checks passed
@dssei dssei deleted the mj/zeroBug branch December 6, 2024 17:00
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