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

Feature: array sum circuit #31

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.elixir_ls
.vscode
.DS_Store
1 change: 1 addition & 0 deletions circuits/array_add/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
8 changes: 8 additions & 0 deletions circuits/array_add/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# array_sum.aleo

## Build Guide

To compile this Aleo program, run:
```bash
aleo build
```
22 changes: 22 additions & 0 deletions circuits/array_add/auxiliary_code_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Here the output is:
# input r0 as field;
# input r1 as field;
# ...
# input r253 as field;
for i in range(254):
print("\tinput r{} as field.public;".format(i))

# Here the output is:
# add r0 r1 into r254;
# add r254 r2 into r255;
# ...
# add r0.a253 r252 into r253;
print("\n\tadd r0 r1 into r254;")
for i in range(254, 507):
print("\tadd r{} r{} into r{};".format(i, i-253, i+1))
print("\n\toutput r507 as field.public;")

# The command for running a simple test:
print("aleo run hash_array_add ", end='')
for i in range(254):
print("{}field ".format(i), end='')
Loading