From f846f59d9633aa43befece72576fff7bedf1b1b0 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Mon, 12 Feb 2024 11:53:08 +0100 Subject: [PATCH] circuit: remove unused templates --- circuit/binary_compare.circom | 54 ----------------------------------- 1 file changed, 54 deletions(-) diff --git a/circuit/binary_compare.circom b/circuit/binary_compare.circom index 9de09ea..3796d8c 100644 --- a/circuit/binary_compare.circom +++ b/circuit/binary_compare.circom @@ -40,57 +40,3 @@ template BinaryCompare(n) { } //------------------------------------------------------------------------------ - -// -// given two numbers in `n`-bit binary decomposition (little-endian), we compute -// -// out := (A <= B) ? 1 : 0 -// -// NOTE: we don't check that the digits are indeed binary; -// that's the responsibility of the caller! -// - -template BinaryLessOrEqual(n) { - signal input A[n]; - signal input B[n]; - signal output out; - - var phalf = 1/2; // +1/2 as field element - var mhalf = -phalf; // -1/2 as field element - - component cmp = BinaryCompare(n); - cmp.A <== A; - cmp.B <== B; - - var x = cmp.out; - out <== mhalf * (x-1) * (x+2); -} - -//------------------------------------------------------------------------------ - -// -// given two numbers in `n`-bit binary decomposition (little-endian), we compute -// -// out := (A >= B) ? 1 : 0 -// -// NOTE: we don't check that the digits are indeed binary; -// that's the responsibility of the caller! -// - -template BinaryGreaterOrEqual(n) { - signal input A[n]; - signal input B[n]; - signal output out; - - var phalf = 1/2; // +1/2 as field element - var mhalf = -phalf; // -1/2 as field element - - component cmp = BinaryCompare(n); - cmp.A <== A; - cmp.B <== B; - - var x = cmp.out; - out <== mhalf * (x+1) * (x-2); -} - -//------------------------------------------------------------------------------