Skip to content

Conversation

vibegentt
Copy link

Replace assert with return False for proof length validation to ensure the function behaves consistently and doesn't crash when Python runs with optimization flags (-O).

This makes the validation consistent with other checks in the same function and improves robustness of the reference implementation.
Tests: All existing unit tests pass

@jonatack jonatack changed the title fix: replace assert with return False in dleq_verify_proof BIP374: replace assert with return False in dleq_verify_proof Sep 10, 2025
@jonatack jonatack added Proposed BIP modification Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified labels Sep 10, 2025
) -> bool:
if A.infinity or B.infinity or C.infinity or G.infinity:
return False
assert len(proof) == 64
Copy link
Member

@jonatack jonatack Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other places in this file with an assertion on the length; what is unique about this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified Proposed BIP modification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants