Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ba5549b. Configure here.
| for i := range len(t) { | ||
| buf = t[i].Bytes() | ||
| written, err = enc.w.Write(buf[:]) | ||
| enc.n += int64(written) |
There was a problem hiding this comment.
G2Affine encoding cases removed, breaking serialization
High Severity
The *G2Affine, []G2Affine, and *[]G2Affine cases were removed from both encode and encodeRaw across all pairing-friendly curve marshal.go files. Since G2Affine does not implement io.WriterTo, the generic interface check at the top of these functions won't handle it. Encoding any G2 point now falls through to the default case, which returns an "unsupported type" error. The decoder still has explicit *G2Affine and *[]G2Affine cases, confirming these types need explicit handling. This breaks G2 serialization in bls12-377, bls12-381, bls24-315, bls24-317, bn254, bw6-633, and bw6-761.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit ba5549b. Configure here.


Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Note that in most cases the PR should be against the
developbranch.Fixes # (issue)
Type of change
Please delete options that are not relevant.
How has this been tested?
Please describe the tests that you ran or implemented to verify your changes. Provide instructions so we can reproduce.
How has this been benchmarked?
Please describe the benchmarks that you ran to verify your changes.
Checklist:
golangci-lintdoes not output errors locallyNote
Medium Risk
Introduces a new curve ID and a large amount of generated finite-field code, plus changes to point (de)serialization paths; mistakes here could break compatibility or arithmetic correctness across multiple curves.
Overview
Adds support for a new
KB8curve identifier across theeccpackage, including string parsing and new scalar/base field parameters.Introduces a new
ecc/kb8package withfpwrappers over thekoalabearfield and a full generatedfrimplementation (including arch-specific assembly hooks and exponentiation chains).Refactors marshaling in several curve packages by removing explicit
G2Affineand[]G2Affineencode branches (compressed and raw) and makes small generator/test updates (e.g., addsGenE4, tweaks loops/encoding checks), alongside minor generated-code cleanups (e.g.,reflect.Ptrusage and wording in grumpkin marshal errors/comments).Reviewed by Cursor Bugbot for commit ba5549b. Bugbot is set up for automated code reviews on this repo. Configure here.