mirror of
https://github.com/logos-storage/logos-storage-proofs-circuits.git
synced 2026-01-05 06:53:05 +00:00
circuit: remove unused templates
This commit is contained in:
parent
deda9da6fd
commit
f846f59d96
@ -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);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user