Skip to content

In ecc/bls12381, Pairing operations seems racy #493

Closed
@AnomalRoil

Description

@AnomalRoil

It seems there are internal functions in circl that are "racy", because they are passing arrays using pointers, reading from these arrays and writing to these same arrays, causing data races when multiple go routines are operating on the same points at the same time.

This was discovered in the drand/kyber repo, where we have recently accepted a PR to add circl support for BLS12-381, but sadly despite having a test for data races in pairings, we didn't catch it earlier. (we weren't using -race in CI by mistake).

To reproduce:

git clone https://github.com/drand/kyber.git
cd kyber
go test -race ./pairing/circl_bls12381/...

This should fail in the TestRacePairings test.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions