Skip to content

evp_hash: add freeze option#74

Closed
npajkovsky wants to merge 2 commits into
openssl:mainfrom
npajkovsky:evp-hash-freeze
Closed

evp_hash: add freeze option#74
npajkovsky wants to merge 2 commits into
openssl:mainfrom
npajkovsky:evp-hash-freeze

Conversation

@npajkovsky

Copy link
Copy Markdown

$ ./evp_hash -o evp_isolated -a SHA1 64
Average time per hash: 20.361076us

$ ./evp_hash -o evp_isolated -a SHA1 64 -f
Average time per hash: 4.336028us

Fixes openssl/project#1728

Note: Build with openssl feature branch upstream/feature/method-store-freeze

@npajkovsky npajkovsky marked this pull request as draft February 11, 2026 09:38
Comment thread source/evp_hash.c
Comment thread source/evp_hash.c Outdated
Comment thread README.md Outdated
@andrewkdinh

Copy link
Copy Markdown
Contributor

I think you also need to update the CMakeLists.txt to use the new flag

@jogme jogme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CI failures happening because it does not build against the feature branch.

IMO it would be better to ifdef it and check if the symbol is present with cmake, so we don't break functionality with older versions.

Comment thread source/evp_hash.c Outdated
Comment thread source/evp_hash.c Outdated
@npajkovsky

Copy link
Copy Markdown
Author

CI failures happening because it does not build against the feature branch.

IMO it would be better to ifdef it and check if the symbol is present with cmake, so we don't break functionality with older versions.

It's a draft and will be merged once the OpenSSL freeze is complete. I'll probably change the pr title, and consolidate all evp_* freezing options into one pr.

@andrewkdinh feel free to push into the branch.

Comment thread source/evp_hash.c Outdated
@andrewkdinh

Copy link
Copy Markdown
Contributor

@npajkovsky IMO we should merge this in, with the ifdef for OSSL_LIB_CTX_freeze. And afterwards we do the same for all the perftools. We want to use the freeze flag in perftools to test the freeze changes as they’re going in. Each EVP_* freeze addition will go in one PR at a time.

@npajkovsky

Copy link
Copy Markdown
Author

CMake

I'll put in TBD because I don't know how to run commands only for openssl >= 4.

@Sashan

Sashan commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

CMake

I'll put in TBD because I don't know how to run commands only for openssl >= 4.

IMO the compile time check for OPENSSL_VERSION is sufficient. the cmake is complex enough. enabling the code upon the version check is sufficient once the freeze feature will land ro master.

  $ ./evp_hash -o evp_isolated -a SHA1 64
  Average time per hash: 20.361076us

  $ ./evp_hash -o evp_isolated -a SHA1 64 -f
  Average time per hash: 4.336028us

Fixes openssl/project#1728
Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
@npajkovsky npajkovsky marked this pull request as ready for review February 12, 2026 13:26
@npajkovsky

Copy link
Copy Markdown
Author

@andrewkdinh @Sashan @jogme, please do review once more. I hope I have addressed everything.

@Sashan Sashan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good to me.

@andrewkdinh andrewkdinh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Otherwise LGTM

Comment thread README.md Outdated
@@ -228,6 +228,7 @@ Three modes of operation:
Usage: evp_hash [-h] [-t] [-o operation] [-u update-times] [-a algorithm] thread-count

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Usage: evp_hash [-h] [-t] [-o operation] [-u update-times] [-a algorithm] thread-count
Usage: evp_hash [-h] [-t] [-f] [-o operation] [-u update-times] [-a algorithm] thread-count

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, pushed the change.

@jogme jogme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

npajkovsky pushed a commit that referenced this pull request Feb 16, 2026
  $ ./evp_hash -o evp_isolated -a SHA1 64
  Average time per hash: 20.361076us

  $ ./evp_hash -o evp_isolated -a SHA1 64 -f
  Average time per hash: 4.336028us

Fixes openssl/project#1728
Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Mon Feb 16 10:57:46 2026
(Merged from #74)
@npajkovsky

Copy link
Copy Markdown
Author

Merged, thank you for the review.

@npajkovsky npajkovsky closed this Feb 18, 2026
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.

modify perftool to optionally freeze.

5 participants