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

feat!: bump noir-bignum to v0.5.0 #40

Merged
merged 8 commits into from
Jan 9, 2025
Merged
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
37 changes: 26 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,36 @@ on:

env:
CARGO_TERM_COLOR: always
MINIMUM_NOIR_VERSION: v1.0.0-beta.0
kashbrti marked this conversation as resolved.
Show resolved Hide resolved

jobs:
noir-version-list:
name: Query supported Noir versions
runs-on: ubuntu-latest
outputs:
noir_versions: ${{ steps.get_versions.outputs.versions }}

steps:
- name: Checkout sources
id: get_versions
run: |
# gh returns the Noir releases in reverse chronological order so we keep all releases published after the minimum supported version.
VERSIONS=$(gh release list -R noir-lang/noir --exclude-pre-releases --json tagName -q 'map(.tagName) | index(env.MINIMUM_NOIR_VERSION) as $index | if $index then .[0:$index+1] else [env.MINIMUM_NOIR_VERSION] end')
echo "versions=$VERSIONS"
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}

test:
needs: [noir-version-list]
name: Test on Nargo ${{matrix.toolchain}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [nightly, 0.36.0]
toolchain: ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}}
include:
- toolchain: nightly
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -27,14 +48,14 @@ jobs:
toolchain: ${{ matrix.toolchain }}

- name: Run Noir tests
working-directory: ./lib
working-directory: ./lib
run: nargo test

- name: Run example project
working-directory: ./example
run: nargo execute

format:
needs: [noir-version-list]
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand All @@ -43,14 +64,8 @@ jobs:
- name: Install Nargo
uses: noir-lang/noirup@v0.1.3
with:
toolchain: 0.36.0

toolchain: ${{env.MINIMUM_NOIR_VERSION}}
- name: Run formatter
working-directory: ./lib
run: nargo fmt --check

- name: Run formatter on example
working-directory: ./example
run: nargo fmt --check

# This is a job which depends on all test jobs and reports the overall status.
Expand All @@ -74,4 +89,4 @@ jobs:
fi
env:
# We treat any cancelled, skipped or failing jobs as a failure for the workflow as a whole.
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
4 changes: 2 additions & 2 deletions example/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "example"
type = "bin"
authors = [""]
compiler_version = ">=0.36.0"
compiler_version = ">=1.0.0"

[dependencies]
rsa = { path = "../lib" }
bignum = { tag = "v0.4.2", git = "https://github.com/noir-lang/noir-bignum" }
bignum = { tag = "v0.5.0", git = "https://github.com/noir-lang/noir-bignum" }
2 changes: 1 addition & 1 deletion example/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main(
let params: BigNumParams<18, 2048> =
BigNumParams::new(has_multiplicative_inverse, modulus_limbs, redc_limbs);

let signature: RBN2048 = RuntimeBigNum::from_array(params, signature_limbs);
let signature: RBN2048 = RBN2048::from_array(params, signature_limbs);

assert(verify_sha256_pkcs1v15(hash, signature, 65537));
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "noir_rsa"
type = "lib"
authors = [""]
compiler_version = ">=0.36.0"
compiler_version = ">=1.0.0"

[dependencies]
bignum = {tag = "v0.4.2", git = "https://github.com/noir-lang/noir-bignum"}
bignum = {tag = "v0.5.0", git = "https://github.com/noir-lang/noir-bignum"}
Loading