Skip to content

Commit

Permalink
Wreck havoc with more github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaker committed Feb 6, 2024
1 parent c4d5914 commit ad2dd66
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 10 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/lint-fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Linter and Formatter

on:
pull_request:
branches:
- main
paths-ignore:
- 'README.md'


jobs:
fmt:
name: Rustfmt
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings
15 changes: 15 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Security audit
on:
schedule:
- cron: '0 0 * * 1'
pull_request:
branches:
- main
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

name: Spell checker
on: [push, pull_request]

jobs:
typos:
name: Spell Check with typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
13 changes: 8 additions & 5 deletions examples/schnorr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,12 @@ where
for<'a> Merlin<'a, H>:
GroupReader<G> + FieldReader<G::ScalarField> + FieldChallenges<G::ScalarField>,
{
// Read the protocol from the transcript:
// XXX. possible inconsistent implementations:
// if the point is not validated here (but the public key is) then the proof may fail with InvalidProof, instead of SerializationError
// Read the protocol from the transcript.
// [[Side note:
// The method `next_points` internally performs point validation.
// Another implementation that does not use nimue might choose not to validate the point here, but only validate the public-key.
// This leads to different errors to be returned: here the proof fails with SerializationError, whereas the other implementation would fail with InvalidProof.
// ]]
let [K] = merlin.next_points().unwrap();
let [c] = merlin.challenge_scalars().unwrap();
let [r] = merlin.next_scalars().unwrap();
Expand All @@ -146,8 +149,8 @@ where
Err(ProofError::InvalidProof)
}

// from here, another proof can be verified using the same merlin instance
// and proofs can be composed.
// From here, another proof can be verified using the same merlin instance
// and proofs can be composed. The transcript holds the whole proof,
}

#[allow(non_snake_case)]
Expand Down
7 changes: 3 additions & 4 deletions src/arthur.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,13 @@ where
}
}

impl<U, H, B> From<B> for Arthur<H, U, DefaultRng>
impl<U, H> From<&IOPattern<H, U>> for Arthur<H, U, DefaultRng>
where
U: Unit,
H: DuplexHash<U>,
B: core::borrow::Borrow<IOPattern<H, U>>,
{
fn from(pattern: B) -> Self {
Arthur::new(pattern.borrow(), DefaultRng::default())
fn from(io_pattern: &IOPattern<H, U>) -> Self {
Arthur::new(io_pattern, DefaultRng::default())
}
}

Expand Down
1 change: 0 additions & 1 deletion src/merlin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::DefaultHash;
/// Internally, it is a wrapper around a SAFE sponge.
/// Given as input an [`IOPattern`] and a protocol transcript, it allows to
/// de-serialize elements from the transcript and make them available to the zero-knowledge verifier.
#[derive(Clone)]
pub struct Merlin<'a, H = DefaultHash, U = u8>
where
H: DuplexHash<U>,
Expand Down

0 comments on commit ad2dd66

Please sign in to comment.