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

all: remove kilic dependency from bls12381 fuzzers #30296

Merged
merged 4 commits into from
Nov 19, 2024

Conversation

jwasinger
Copy link
Contributor

@jwasinger jwasinger commented Aug 14, 2024

The kilic bls12381 implementation has been archived. It shouldn't be necessary to include it as a fuzzing target any longer.

This also adds fuzzers for G1/G2 mul that use inputs that are guaranteed to be valid. Previously, we just did random input fuzzing for these precompiles.

@MariusVanDerWijden
Copy link
Member

Looks like this fails currently:

func TestCrossG1MultiExp(t *testing.T) {
	input := []byte("0")
	fuzzCrossG1MultiExp(input)
}

@kevaundray
Copy link
Contributor

This looks good to me!

@jwasinger
Copy link
Contributor Author

Ah there's one thing: We only fuzz the MSM precompiles using random inputs. I'm going to add two additional fuzzers that fuzz these with inputs that are known to be valid.

@kevaundray
Copy link
Contributor

kevaundray commented Aug 20, 2024

Ah there's one thing: We only fuzz the MSM precompiles using random inputs. I'm going to add two additional fuzzers that fuzz these with inputs that are known to be valid.

I think it would be good to add the identity/zero point as input to one of these, along with other known valid points

@jwasinger
Copy link
Contributor Author

Yeah definitely. Actually, I need to give the added fuzzers a longer run and prob adjust the seed corpus to increase the coverage.

@holiman
Copy link
Contributor

holiman commented Nov 8, 2024

Sorry, this seems to have been forgotten a bit, and bitrotted. Could you please rebase this?

@jwasinger
Copy link
Contributor Author

Oh, this is missing a cross fuzzer for g2 multiexp.

Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -172,6 +176,10 @@ compile_fuzzer github.com/ethereum/go-ethereum/tests/fuzzers/bls12381 \
FuzzG2Add fuzz_g2_add \
$repo/tests/fuzzers/bls12381/bls12381_test.go

compile_fuzzer github.com/ethereum/go-ethereum/tests/fuzzers/bls12381 \
FuzzCrossG2Mul fuzz_cross_g2_mul\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not work, since FuzzCrossG2Mul is a prefix of FuzzCrossG2MultiExp
Go complains on my machine about it:

go test --fuzz FuzzCrossG1Mul
testing: will not fuzz, -fuzz matches more than one fuzz test: [FuzzCrossG1MultiExp FuzzCrossG1Mul]
FAIL
exit status 1

The way I found to fix it, was to specify FuzzCrossG1Mul. with a trailing dot.
I don't how if the compile_fuzzer script will work with this, but I think we should give it a try like it is right now and fix it up if necessary

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think FuzzCrossG1Mul$ is another to way to make it work. However, we can try it as is. The compilescript passes it to gofuzz-shim. Seems to me that it's parsed literally, not regexpy: https://github.com/holiman/gofuzz-shim/blob/main/main.go#L95

@holiman holiman merged commit 61ff3a1 into ethereum:master Nov 19, 2024
3 checks passed
@holiman holiman added this to the 1.14.12 milestone Nov 19, 2024
@jwasinger jwasinger deleted the remove-kilic branch November 19, 2024 13:17
holiman pushed a commit that referenced this pull request Nov 19, 2024
The [kilic](https://github.com/kilic/bls12-381) bls12381 implementation
has been archived. It shouldn't be necessary to include it as a fuzzing
target any longer.

This also adds fuzzers for G1/G2 mul that use inputs that are guaranteed
to be valid. Previously, we just did random input fuzzing for these
precompiles.
zfy0701 pushed a commit to sentioxyz/go-ethereum that referenced this pull request Dec 3, 2024
The [kilic](https://github.com/kilic/bls12-381) bls12381 implementation
has been archived. It shouldn't be necessary to include it as a fuzzing
target any longer.

This also adds fuzzers for G1/G2 mul that use inputs that are guaranteed
to be valid. Previously, we just did random input fuzzing for these
precompiles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants