Skip to content

Commit

Permalink
updated comments from 16 to 15 inputs, and removed 16 inputs test result
Browse files Browse the repository at this point in the history
  • Loading branch information
ananas-block authored and vadorovsky committed Apr 9, 2023
1 parent 7c13f3b commit 8492048
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ of generating the round constants.
Parameters provided by the library are:

* x^5 S-boxes
* t = 2 - 17 (for 1 to 16 inputs)
* 8 full rounds and partial rounds depending on t [56, 57, 56, 60, 60, 63, 64, 63, 60, 66, 60, 65, 70, 60, 64, 68]
* t = 2 - 17 (for 1 to 15 inputs)
* 8 full rounds and partial rounds depending on t [56, 57, 56, 60, 60, 63, 64, 63, 60, 66, 60, 65, 70, 60, 64]

The parameters can be generated with:
```$ cargo xtask generate-poseidon-parameters``
Expand Down Expand Up @@ -89,7 +89,7 @@ but it was also inspired by the following ones:
### Performance

This repository contains a benchmark measuring the performance of this
Poseidon implementation for given 1 - 16 random 32 bytes inputs.
Poseidon implementation for given 1 - 15 random 32 bytes inputs.

To run them, simply use:

Expand Down
4 changes: 2 additions & 2 deletions light-poseidon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
//! Parameters provided by the library are:
//!
//! * x^5 S-boxes
//! * t = 2 - 17 (for 1 to 16 inputs)
//! * 8 full rounds and partial rounds depending on t [56, 57, 56, 60, 60, 63, 64, 63, 60, 66, 60, 65, 70, 60, 64, 68]
//! * t = 2 - 17 (for 1 to 15 inputs)
//! * 8 full rounds and partial rounds depending on t [56, 57, 56, 60, 60, 63, 64, 63, 60, 66, 60, 65, 70, 60, 64]
//! The parameters can be generated with:
//! ```$ cargo xtask generate-poseidon-parameters``
//! # Output type
Expand Down
6 changes: 1 addition & 5 deletions light-poseidon/tests/bn254_fq_x5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ fn test_poseidon_bn254_x5_fq_hash_bytes() {
}

// test cases were created with circomlibjs poseidon([1, ...]) for 1 to 16 inputs
const TEST_CASES: [[u8; 32]; 16] = [
const TEST_CASES: [[u8; 32]; 15] = [
[
41, 23, 97, 0, 234, 169, 98, 189, 193, 254, 108, 101, 77, 106, 60, 19, 14, 150, 164, 209,
22, 139, 51, 132, 139, 137, 125, 197, 2, 130, 1, 51,
Expand Down Expand Up @@ -151,10 +151,6 @@ const TEST_CASES: [[u8; 32]; 16] = [
27, 225, 209, 175, 237, 11, 90, 129, 139, 218, 5, 21, 20, 49, 65, 35, 218, 22, 99, 154,
152, 243, 138, 136, 36, 39, 1, 149, 158, 199, 205, 61,
],
[
35, 235, 143, 111, 217, 66, 220, 208, 175, 10, 19, 232, 111, 181, 60, 252, 121, 177, 148,
13, 210, 181, 154, 155, 141, 8, 85, 118, 43, 126, 211, 142,
],
];

#[test]
Expand Down

0 comments on commit 8492048

Please sign in to comment.