Closed mratsim closed 3 years ago
As highlighted by https://github.com/status-im/nim-blscurve/pull/30/commits/6a4e452e8c9594e876a10961863c688ccfa63a5a in #30, we need better coverage of input message ranges as from time-to-time we need to call FP2 normalization to put the FP2 back in 0 ..< Prime range, especially after multiplication (norm calls)
0 ..< Prime
https://github.com/status-im/nim-blscurve/blob/501f1fc3a0d2ab7954dc294d571ffd7aa969d55d/blscurve/hash_to_curve.nim#L279-L323
One way to do that would be to add property-based testing.
Invariants that hash_to_curve should abide to are available in the test suite from:
Other relevant repo to generate test vectors:
Example property based testing: https://github.com/status-im/nim-stint/blob/9e49b00148884a01d61478ae5d2c69b543b93ceb/tests/property_based_uint256.nim
See #75 for a thorough audit.
As highlighted by https://github.com/status-im/nim-blscurve/pull/30/commits/6a4e452e8c9594e876a10961863c688ccfa63a5a in #30, we need better coverage of input message ranges as from time-to-time we need to call FP2 normalization to put the FP2 back in
0 ..< Prime
range, especially after multiplication (norm calls)https://github.com/status-im/nim-blscurve/blob/501f1fc3a0d2ab7954dc294d571ffd7aa969d55d/blscurve/hash_to_curve.nim#L279-L323
One way to do that would be to add property-based testing.
Invariants that hash_to_curve should abide to are available in the test suite from:
Other relevant repo to generate test vectors:
Example property based testing: https://github.com/status-im/nim-stint/blob/9e49b00148884a01d61478ae5d2c69b543b93ceb/tests/property_based_uint256.nim