mratsim / constantine

Constantine: modular, high-performance, zero-dependency cryptography stack for verifiable computation, proof systems and blockchain protocols.
Other
408 stars 43 forks source link

Fuzzing: Pairing BN254_Nogami failure #143

Closed mratsim closed 2 years ago

mratsim commented 3 years ago

https://github.com/mratsim/constantine/runs/1797454504?check_suite_focus=true#step:16:1498 After merging #142 which is not in the codepath.

test_pairing_BN254_Nogami_optate xoshiro512** seed: 1612013399

[Suite] Pairing - Optimal Ate on BN254_Nogami [64-bit mode]
/home/runner/work/constantine/constantine/constantine/tests/t_pairing_template.nim(92) t_pairing_bn254_nogami_optate
/home/runner/work/constantine/constantine/constantine/tests/t_pairing_template.nim(80) test_bilinearity_double_impl
/home/runner/work/constantine/constantine/nim/lib/system/assertions.nim(30) failedAssertImpl
/home/runner/work/constantine/constantine/nim/lib/system/assertions.nim(23) raiseAssert
/home/runner/work/constantine/constantine/nim/lib/system/fatal.nim(53) sysFatal

    Unhandled exception: /home/runner/work/constantine/constantine/constantine/tests/t_pairing_template.nim(80, 16) `bool(not r.isOne())`  [AssertionDefect]
  [FAILED] Bilinearity e([2]P, Q) = e(P, [2]Q) = e(P, Q)^2
mratsim commented 2 years ago

Fuzzer generated an all zero input which should be filtered out by calling protocol.

image