Skip to content

Instantly share code, notes, and snippets.

@wanseob
Created February 28, 2020 07:16
Show Gist options
  • Save wanseob/24220c8b743aa1b9ca25129a012b0811 to your computer and use it in GitHub Desktop.
Save wanseob/24220c8b743aa1b9ca25129a012b0811 to your computer and use it in GitHub Desktop.
include "circomlib/circuits/if_else_then.circom";
template PointComp() {
component if_else_then = IfElseThen(2); /// compare 2 values
signal input point1[2];
signal input point2[2];
signal output out;
/// return (point1 == point2 ? 1 : 0;)
if_else_then.obj1[0] <== point1[0];
if_else_then.obj1[1] <== point1[1];
if_else_then.obj2[0] <== point2[0];
if_else_then.obj2[1] <== point2[1];
if_else_then.if_v <== 1;
if_else_then.else_v <== 0;
if_else_then.out ==> out;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment