You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FrFromOKM calls it on every hash-to-field, so essentially every BBS operation (sign, verify, NymEid audit) goes through it. Two goroutines performing their first BBS operations concurrently race on the map: the write happens only on the first use per curve, so the race is confined to that startup window — which makes it intermittent, but a process that serves concurrent verifications right after start hits exactly that window. Besides failing -race builds, unsynchronized concurrent map access can terminate the process with an unrecoverable fatal error: concurrent map read and map write.
modernization #77 turned it into the per-curve map, fixing the cross-curve value but keeping the unsynchronized access.
First released in v0.1.0 / v0.1.1. The code this was migrated from (hyperledger/aries-bbs-gobbs/fr.go) computes the value on every call and has no race.
Summary
bbs.f2192()caches the constant 2^192 per curve in a package-level map with no synchronization:https://github.com/IBM/idemix/blob/main/bbs/fr.go#L29-L38
FrFromOKMcalls it on every hash-to-field, so essentially every BBS operation (sign, verify, NymEid audit) goes through it. Two goroutines performing their first BBS operations concurrently race on the map: the write happens only on the first use per curve, so the race is confined to that startup window — which makes it intermittent, but a process that serves concurrent verifications right after start hits exactly that window. Besides failing-racebuilds, unsynchronized concurrent map access can terminate the process with an unrecoverablefatal error: concurrent map read and map write.Observed
Race detector report from a downstream CI run (LFDT-Panurus/panurus unit tests,
-race, parallel verifications; Go 1.26.3, idemix v0.1.1) — full log: https://github.com/LFDT-Panurus/panurus/actions/runs/28915702306/job/85783037774History
f2192Cached *ml.Zr(which additionally served the first curve's value to every curve).hyperledger/aries-bbs-gobbs/fr.go) computes the value on every call and has no race.