Skip to content

Commit

Permalink
add binary example
Browse files Browse the repository at this point in the history
  • Loading branch information
SleepingShell committed Oct 6, 2023
1 parent f547719 commit afca092
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 10 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ on:
push:
branches: ['main']
paths:
- 'src/*'
- 'crates/**/*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main

- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 0.11.0

- name: Run tests
run: |
nargo test
nargo test
- name: Get constraint size
run: |
nargo info --package chacha20_example
9 changes: 2 additions & 7 deletions Nargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
[package]
name = "chacha20"
type = "lib"
authors = [""]
compiler_version = "0.10.5"

[dependencies]
[workspace]
members = ["crates/chacha20", "crates/chacha20_example"]
7 changes: 7 additions & 0 deletions crates/chacha20/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "chacha20"
type = "lib"
authors = ["Sleepingshell"]
compiler_version = "0.10.5"

[dependencies]
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions crates/chacha20_example/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "chacha20_example"
type = "bin"
authors = ["Sleepingshell"]
compiler_version = "0.10.5"

[dependencies]
chacha20 = { path = "../chacha20" }
4 changes: 4 additions & 0 deletions crates/chacha20_example/Prover.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
counter = ""
key = ["", "", "", "", "", "", "", ""]
nonce = ["", "", ""]
plaintext = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]
1 change: 1 addition & 0 deletions crates/chacha20_example/Verifier.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
return = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]
5 changes: 5 additions & 0 deletions crates/chacha20_example/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use dep::chacha20::ChaCha20;

fn main(key: [u32; 8], nonce: [u32; 3], counter: u32, plaintext: [u8; 128]) -> pub [u8; 128] {
ChaCha20(key, nonce, counter, plaintext)
}

0 comments on commit afca092

Please sign in to comment.