Skip to content

Comments

chore: move cryptography code into crypto folder#2750

Closed
kevaundray wants to merge 20 commits intobluealloy:mainfrom
kevaundray:kw/move-crypto-to-folder
Closed

chore: move cryptography code into crypto folder#2750
kevaundray wants to merge 20 commits intobluealloy:mainfrom
kevaundray:kw/move-crypto-to-folder

Conversation

@kevaundray
Copy link
Contributor

@kevaundray kevaundray commented Jul 21, 2025

This PR moves all of the core cryptography into a folder called crypto.

2705 made the pure cryptography functions not reliant on revm/evm specific types or functionality, so this is mainly moving code around.

@kevaundray kevaundray changed the title chore: move code into crypto folder chore: move cryptography code into crypto folder Jul 21, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Jul 21, 2025

CodSpeed Performance Report

Merging #2750 will not alter performance

Comparing kevaundray:kw/move-crypto-to-folder (8ab6d78) with main (f8a8f18)

Summary

✅ 170 untouched benchmarks
⁉️ 1 dropped benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
⁉️ blake2/compress_12_rounds 3.3 µs N/A N/A

@kevaundray
Copy link
Contributor Author

Pulled out of #2706

});

// Benchmark just the compression function with different round counts
group.bench_function("blake2/compress_12_rounds", |b| {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might make sense to benchmark precompiles and the underlying cryptography separately -- we do still benchmark 12 rounds via the run method so we don't lose much here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm precompiles is a crypto with a gas calculation.

//! For more details check modules for each precompile.
use crate::PrecompileWithAddress;

cfg_if::cfg_if! {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

precompile/evm specific code no longer has the cfg_if code -- these were mainly being used to switch between different cryptography libraries. This now lives inside of crypto folder

@kevaundray kevaundray marked this pull request as ready for review July 21, 2025 19:49
@kevaundray
Copy link
Contributor Author

We departed from the implementation of #2705 , so this was superseded by #2786 -- we have another issue for restructuring the new code which is #2782

@kevaundray kevaundray closed this Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants