⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@andrewkdinh
Copy link
Contributor

@andrewkdinh andrewkdinh commented Jan 15, 2026

Summary

Adds a CLI tool evp_cipher that encrypts random data using the specified algorithm.
Runs for 5 seconds and prints the average execution time per encryption.

Fixes openssl/project#1727

Features

  • Two modes of operation:
    • evp_isolated: Use EVP API and don't allow shared data between threads
    • evp_shared (default): Use EVP API and allow shared data between threads (i.e. pre-initializing & sharing the EVP_CIPHER_CTX)
  • Currently supported algorithms: [AES-128-CBC, AES-256-CBC] (default: AES-128-CBC)
  • Configurable number of times to update
  • Terse output for easier CI automation (-t)
  • Configurable thread count

TODO: Since freeze functionality hasn't been properly added yet (see openssl/project#1726 & openssl/openssl#29433), support for freezing the context store has not been added yet.

Usage

$ ./evp_cipher -h
Usage: evp_cipher [-h] [-t] [-o operation] [-u update-times] [-a algorithm] thread-count
-h - print this help output
-t - terse output
-o operation - mode of operation. One of [evp_isolated, evp_shared] (default: evp_shared)
-u update-times - times to update (default: 1)
-a algorithm - One of: [AES-128-CBC, AES-256-CBC] (default: AES-128-CBC)
thread-count - number of threads

$ ./evp_cipher -a AES-128-CBC -o evp_shared 10 # AES-128-CBC encryption algorithm, evp_shared operation mode, 10 threads
Average time per encryption: 0.202960us

$ ./evp_cipher -a AES-128-CBC -o evp_isolated 10 # now using evp_isolated operation mode
Average time per encryption: 2.418870us

Findings

Initial results showed that evp_isolated mode generally runs about 10x slower than evp_shared mode.

@andrewkdinh andrewkdinh changed the title Add evp_hash perftool Add evp_cipher perftool Jan 15, 2026
@andrewkdinh andrewkdinh marked this pull request as ready for review January 16, 2026 13:15
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.

Add evp_perftool cipher test

1 participant