Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect input to batch verification causes panic #208

Open
nazar-pc opened this issue Mar 27, 2023 · 3 comments
Open

Incorrect input to batch verification causes panic #208

nazar-pc opened this issue Mar 27, 2023 · 3 comments

Comments

@nazar-pc
Copy link
Contributor

This happened when I created polynomial from 8 scalars and then created proof with compute_proof_multi, but then during verification only sent a single value and n == 1 when calling check_proof_multi. Library must detect incorrect input and returning error rather than panicking

thread 'X' panicked at 'index out of bounds: the len is 1 but the index is 1', ../.cargo/git/checkouts/rust-kzg-f871e5172d08c353/49e7b60/blst-from-scratch/src/types/kzg_settings.rs:143:32

This line specifically: https://github.com/sifraitech/rust-kzg/blob/f014df818fbb3e4f45d66c4224fe000975fdee41/blst-from-scratch/src/types/kzg_settings.rs#L143

@sauliusgrigaitis
Copy link
Member

It could simply call a single proof check function if n == 1. Feel free to open PR.

@nazar-pc
Copy link
Contributor Author

It panics the same way with n == 2 🙂

@sauliusgrigaitis
Copy link
Member

Then it needs more love :)

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

No branches or pull requests

2 participants