Skip to content

Commit

Permalink
chore: remove 3 unused functions warnings in the stdlib (#5973)
Browse files Browse the repository at this point in the history
# Description

## Problem

Two functions were unused, another one two but it was kind of a test so
I marked it as such.

## Summary


## Additional Context

After this 4 "unused" functions remain, but solving those is a bit more
challenging so I'm leaving that for a separate PR.

## Documentation

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
asterite authored Sep 9, 2024
1 parent 8e8e97c commit 5c74683
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
5 changes: 0 additions & 5 deletions noir_stdlib/src/hash/poseidon/bn254/consts.nr
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
// Consistent with https://github.com/iden3/circomlib/blob/master/circuits/poseidon.circom and https://github.com/iden3/circomlib/blob/master/circuits/poseidon_constants.circom
use crate::hash::poseidon::PoseidonConfig;
use crate::hash::poseidon::config;
// Number of full rounds
// Number of partial rounds
fn rp() -> [u8; 16] {
[56, 57, 56, 60, 60, 63, 64, 63, 60, 66, 60, 65, 70, 60, 64, 68]
}
// S-box power
fn alpha() -> Field {
5
Expand Down
8 changes: 0 additions & 8 deletions noir_stdlib/src/hash/poseidon/mod.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
mod bn254; // Instantiations of Poseidon for prime field of the same order as BN254
use crate::field::modulus_num_bits;
use crate::hash::Hasher;
use crate::default::Default;

Expand Down Expand Up @@ -166,13 +165,6 @@ fn sigma<let O: u32>(x: [Field; O]) -> [Field; O] {
y
}

// Check security of sponge instantiation
fn check_security(rate: Field, width: Field, security: Field) -> bool {
let n = modulus_num_bits();

((n - 1) as Field * (width - rate) / 2) as u8 > security as u8
}

struct PoseidonHasher{
_state: [Field],
}
Expand Down
1 change: 1 addition & 0 deletions noir_stdlib/src/meta/mod.nr
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ mod tests {
quote { 1 }
}

#[test]
fn returning_versus_macro_insertion() {
comptime
{
Expand Down

0 comments on commit 5c74683

Please sign in to comment.