Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the \ operator and why is it used instead of / ? #41

Open
bitcartel opened this issue Apr 25, 2020 · 1 comment
Open

What is the \ operator and why is it used instead of / ? #41

bitcartel opened this issue Apr 25, 2020 · 1 comment

Comments

@bitcartel
Copy link

pedersen_old.circom
26: var nexps = ((n-1) \ 250) + 1;

escalarmulfix.circom
238: var nsegments = (n-1)\246 +1; // 249 probably would work. But I'm not sure and for security I keep 246
254: nWindows = ((nseg - 1)\3)+1;

gates.circom
81: var n1 = n\2;
82: var n2 = n-n\2;

pedersen.circom
192: var nSegments = ((n-1)\200)+1;
202: nWindows = ((nBits - 1)\4)+1;

escalarmulany.circom
135: var nsegments = (n-1)\148 +1;

sha256/sha256.circom
16: nBlocks = ((nBits + 64)\512)+1;

@lispc
Copy link

lispc commented Apr 5, 2021

"/" is divide in the finite field. For example, for a 7-mod field, 2*5 == 3, 3/2 == 5,
"" is normal divide for human. For example, 3\2 == 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants