Closed vmx closed 1 year ago
Come on! It's in the name, multi, so 1 does not qualify-) But even on a serious note, formally speaking it shouldn't come as a surprise that a subroutine that expects multiple inputs doesn't handle one. But all right. I suppose if the library qsort works with a single input, then MSM could as well. Though the comparison is not really adequate. In the sense that if MSM did if (n ==1) return
then you would complain, while qsort doing the same would qualify as doing-the-job. Sigh... Anyway, fixed.
I'm just forwarding bug reports ;) I agree though that it's meant for multiple things. Though it was still a bit unexpected to not getting an error, but really some unexpected result. Thanks for fixing!
I got a bug report on blstrs about multi-exponentiation returning the wrong result at https://github.com/filecoin-project/blstrs/issues/57. When I looked into it, I found that it's on the blst level.
Here's an example of a reproduction of the problem:
I then found that blst has tests for multi-exponentation, which makes the problem even easier to reproduce. Change this line https://github.com/supranational/blst/blob/327d30a51c858e9c34f5b6eb3a6966b2cf6bc9cc/bindings/rust/src/pippenger-test_mod.rs#L21 to
const npoints: usize = 1;
and you'll see the test fail when runningcargo test p1_multi_scalar::test_mult
.