mirror of
https://github.com/luxfi/magnetar.git
synced 2026-09-24 00:25:23 +00:00
Four adversarial inputs each reached a crash or a wrong answer: - thbsseReconstructGF judged evaluation points by raw value, so x == p (the reserved secret point 0 mod p) passed the zero guard and x, x+p read as two points instead of one; the same unreduced x also underflowed the Lagrange denominator (p + x_i - x_j wraps when x_j > p). Reduce every point mod p once and guard on the reduced value. - VerifyForsThreshold never length-checked the public digest, so a short digest panicked inside forsPkFromSig. Refuse it with ErrForsShape, as the producing door already does. - AggregateShareEnvelope indexed ReceivedShares[partyIndex-1]; a zero or out-of-range 1-based index wrapped to a huge uint and panicked. An unknown party aggregates to the zero row. - slhVerify handed the zero id slhdsaIDForMode returns for an unknown mode straight to circl, which panics. An unrecognised mode is a failed verification, not a crash. Each fix has a regression test in the area's tracked test file. Co-authored-by: Hanzo Dev <[email protected]>