From 451fb51a0d1c67ae692f4c48128bb3876681de3f Mon Sep 17 00:00:00 2001 From: Kobi Gurkan Date: Sat, 23 Nov 2019 19:24:02 +0200 Subject: [PATCH] adds comments to binsum --- circuits/binsum.circom | 2 ++ 1 file changed, 2 insertions(+) diff --git a/circuits/binsum.circom b/circuits/binsum.circom index 3783e26..34b561f 100644 --- a/circuits/binsum.circom +++ b/circuits/binsum.circom @@ -50,6 +50,7 @@ To waranty binary outputs: This function calculates the number of extra bits in the output to do the full sum. */ +/* a must be < Nq/2, where Nq is the number of elements in the scalar field */ function nbits(a) { var n = 1; var r = 0; @@ -61,6 +62,7 @@ function nbits(a) { } +/* n must be such that (2**(n+1) -2) < Nq/ops, where Nq is the number of bits in the scalar field */ template BinSum(n, ops) { var nout = nbits((2**n -1)*ops); signal input in[ops][n];