bellman icon indicating copy to clipboard operation
bellman copied to clipboard

Left shift overflow when calculating `max_degree`

Open dark64 opened this issue 2 years ago • 0 comments

https://github.com/matter-labs/bellman/blob/3aa6226d04d60c539ff4ee480479ac5b92871a20/src/domain.rs#L64 https://github.com/matter-labs/bellman/blob/3aa6226d04d60c539ff4ee480479ac5b92871a20/src/domain.rs#L116

This code fails when compiled to wasm with

panicked at 'attempt to shift left with overflow', 
/home/darko/.cargo/registry/src/github.com-1ecc6299db9ec823/bellman_ce-0.3.5/src/domain.rs:64:26

when E::Fr::S is greater or equal to 32, which seems to be the case with curve bls12_381.

dark64 avatar Feb 08 '23 18:02 dark64