argumentcomputer / bellpepper-gadgets

A library of gadgets compatible with bellpepper and bellperson (contact: @huitseeker)
Apache License 2.0
17 stars 13 forks source link

Add collinear check function to G1 #27

Closed Nramsrud closed 8 months ago

Nramsrud commented 8 months ago

This PR adds collinearity check with test for the G1 group.

This function implements and constrains, given three G1 points, a,b,c, that a+b-c=0. This allows for calculation of G1 point addition out of circuit. Note that this is not enough to ensure the correctness of point addition, this function must be paired with a curve check to ensure all points are valid group elements.