Skip to content

Commit

Permalink
Add Rescue Prime Optimized (#930)
Browse files Browse the repository at this point in the history
* first commit

* first draft, save work

* first working commit, passes all tests. Save work

* save work

* save work

* fixed padding, now all test pass

* refactor

* more refactor

* added precomputed values for 160 security level

* fix typos

* fix clippy and wasm

* add std feature when needed

* save work, refactor and solved some comments

* save work

* move Mds enum and removed commented code

* remove unnecessary match

* removed commented code

---------

Co-authored-by: Diego K <43053772+diegokingston@users.noreply.github.com>
  • Loading branch information
jotabulacios and diegokingston authored Nov 11, 2024
1 parent 8dfddac commit d35c96f
Show file tree
Hide file tree
Showing 6 changed files with 1,876 additions and 6 deletions.
14 changes: 8 additions & 6 deletions crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ license.workspace = true
lambdaworks-math = { workspace = true, features = ["alloc"] }
sha3 = { version = "0.10", default-features = false }
sha2 = { version = "0.10", default-features = false }

# Optional
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"], optional = true }
serde = { version = "1.0", default-features = false, features = [
"derive",
"alloc",
], optional = true }
rayon = { version = "1.8.0", optional = true }

[dev-dependencies]
Expand All @@ -40,9 +42,9 @@ name = "iai_merkle"
harness = false

[[bench]]
name= "criterion_poseidon"
harness=false
name = "criterion_poseidon"
harness = false

[[bench]]
name= "criterion_pedersen"
harness=false
name = "criterion_pedersen"
harness = false
1 change: 1 addition & 0 deletions crypto/src/hash/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ pub mod hash_to_field;
pub mod monolith;
pub mod pedersen;
pub mod poseidon;
pub mod rescue_prime;
pub mod sha3;
11 changes: 11 additions & 0 deletions crypto/src/hash/rescue_prime/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
mod parameters;
mod rescue_prime_optimized;
mod utils;

pub use rescue_prime_optimized::MdsMethod;
pub use rescue_prime_optimized::RescuePrimeOptimized;

use lambdaworks_math::field::element::FieldElement;
use lambdaworks_math::field::fields::u64_goldilocks_field::Goldilocks64Field;

pub type Fp = FieldElement<Goldilocks64Field>;
Loading

0 comments on commit d35c96f

Please sign in to comment.