-
Notifications
You must be signed in to change notification settings - Fork 18k
x/crypto/bn256: TestG1Marshal fails with Go tip #25199
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
Comments
Presumably a result of CL 108996. |
Yes, it was CL 108996. |
essentially restores the old behavior and makes the test pass. But I don't know if this is the correct fix. (If the ModInverse does not exist, in the past the returned value was undefined/the behavior of ModInverse was not specified.) @agl ? |
Change https://golang.org/cl/110695 mentions this issue: |
I honestly have no idea how it used to work. I think it relied on the fact that |
When c = ∞, z = 0 and 0 does not have a modular inverse, triggering undefined behavior (recently changed to returning nil) in ModInverse. Unclear how this used to work anyway. Looks like ModInverse was leaving the receiver untouched, making zInv = 0 when pool = nil. Fixes golang/go#25199 Change-Id: Ib39abf59f0e71cf43cdb5836142ebdd3b206fb3f Reviewed-on: https://go-review.googlesource.com/110695 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
When c = ∞, z = 0 and 0 does not have a modular inverse, triggering undefined behavior (recently changed to returning nil) in ModInverse. Unclear how this used to work anyway. Looks like ModInverse was leaving the receiver untouched, making zInv = 0 when pool = nil. Fixes golang/go#25199 Change-Id: Ib39abf59f0e71cf43cdb5836142ebdd3b206fb3f Reviewed-on: https://go-review.googlesource.com/110695 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
When c = ∞, z = 0 and 0 does not have a modular inverse, triggering undefined behavior (recently changed to returning nil) in ModInverse. Unclear how this used to work anyway. Looks like ModInverse was leaving the receiver untouched, making zInv = 0 when pool = nil. Fixes golang/go#25199 Change-Id: Ib39abf59f0e71cf43cdb5836142ebdd3b206fb3f Reviewed-on: https://go-review.googlesource.com/110695 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
When c = ∞, z = 0 and 0 does not have a modular inverse, triggering undefined behavior (recently changed to returning nil) in ModInverse. Unclear how this used to work anyway. Looks like ModInverse was leaving the receiver untouched, making zInv = 0 when pool = nil. Fixes golang/go#25199 Change-Id: Ib39abf59f0e71cf43cdb5836142ebdd3b206fb3f Reviewed-on: https://go-review.googlesource.com/110695 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
When c = ∞, z = 0 and 0 does not have a modular inverse, triggering undefined behavior (recently changed to returning nil) in ModInverse. Unclear how this used to work anyway. Looks like ModInverse was leaving the receiver untouched, making zInv = 0 when pool = nil. Fixes golang/go#25199 Change-Id: Ib39abf59f0e71cf43cdb5836142ebdd3b206fb3f Reviewed-on: https://go-review.googlesource.com/110695 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
When c = ∞, z = 0 and 0 does not have a modular inverse, triggering undefined behavior (recently changed to returning nil) in ModInverse. Unclear how this used to work anyway. Looks like ModInverse was leaving the receiver untouched, making zInv = 0 when pool = nil. Fixes golang/go#25199 Change-Id: Ib39abf59f0e71cf43cdb5836142ebdd3b206fb3f Reviewed-on: https://go-review.googlesource.com/110695 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
This package calls
math/big.ModInverse
and does not check that the result is non-nil, which appears to result in a segmentation fault when it is tested against Go tip.See https://storage.googleapis.com/go-build-log/9ecf899b/freebsd-amd64-11_1_a2ef6f73.log for an example.
The text was updated successfully, but these errors were encountered: