jacobi validates input arguments, and if they are invalid, it returns 0 in release build, or panics in debug build. We should rather have jacobi that returns None when provided arguments are invalid. It will help to catch unexpected behavior if it happens.
https://github.com/dfns-labs/paillier-zk/blob/5db04c4a6e36b52656c2ccd9bb9b5dc0fbd66289/src/common/sqrt.rs#L63-L72
jacobivalidates input arguments, and if they are invalid, it returns0in release build, or panics in debug build. We should rather havejacobithat returnsNonewhen provided arguments are invalid. It will help to catch unexpected behavior if it happens.https://github.com/dfns-labs/paillier-zk/blob/5db04c4a6e36b52656c2ccd9bb9b5dc0fbd66289/src/common/sqrt.rs#L63-L72