JMH benchmarking suite comparing cryptographic performance between Bouncy Castle (BC) and OpenSSL Jostle providers.
- Symmetric: AES, ARIA, Camellia, SM4 (AEAD, Block, Stream modes)
- KDF: PBKDF2 (SHA2, SHA3, SM3) and Scrypt
- Post-Quantum: ML-DSA, ML-KEM, SLH-DSA (NIST variants)
Download from the OpenJDK download page.
wget https://download.java.net/java/GA/jdk25.0.1/2fbf10d8c78e40bd87641c434705079d/8/GPL/openjdk-25.0.1_linux-x64_bin.tar.gz
# Create directory for Java installation
sudo mkdir -p /opt/java
# Extract the tar.gz file to /opt/java
sudo tar -xzf openjdk-25.0.1_linux-x64_bin.tar.gz -C /opt/java
# Rename for easier access (optional)
sudo mv /opt/java/jdk-25.0.1 /opt/java/jdk-25Configure JAVA_HOME and PATH variables:
# Add to ~/.bashrc
export JAVA_HOME=/opt/java/jdk-25
export PATH=$PATH:$JAVA_HOME/bin
# Apply changes
source ~/.bashrcRequired only if you want to run the visualizer locally.
# Using nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
nvm install 20
nvm use 20Place the following provider JARs in the libs/ directory:
bcprov-jdk18on-*.jar(from Bouncy Castle)openssl-jostle-*.jar(from Jostle provider)
Note
Follow ngkore/jostle and ngkore/bouncy-castle-java for instructions on how to build the Jostle and Bouncy Castle provider.
The Jostle provider requires OpenSSL and its own JNI libraries. Edit scripts/run_benchmarks.sh and update the DEFAULT_NATIVE_LIB_PATH variable to match your environment:
# Example in scripts/run_benchmarks.sh
DEFAULT_NATIVE_LIB_PATH="/path/to/openssl/libssl.so:/path/to/jostle/libinterface_jni.so"If you don't know the paths, use the find command:
OpenSSL (look for libssl.so):
find /usr -name "libssl.so*" 2>/dev/null
# Or typical local install:
find /home -name "libssl.so*" 2>/dev/nullOutput:
ubuntu@vm01:~$ find /home -name "libssl.so*" 2>/dev/null
/home/ubuntu/openssl-3.6.0/libssl.so.3
/home/ubuntu/openssl-3.6.0/libssl.so
/home/ubuntu/openssl_3_6/lib64/libssl.so.3
/home/ubuntu/openssl_3_6/lib64/libssl.soJostle (look for libinterface_jni.so):
find / -name "libinterface_jni.so" 2>/dev/nullOutput:
ubuntu@vm01:~$ find / -name "libinterface_jni.so" 2>/dev/null
/home/ubuntu/bouncy-jostle/openssl-jostle/jostle/src/main/resources/native/linux/x86_64/libinterface_jni.so
/home/ubuntu/bouncy-jostle/openssl-jostle/jostle/bin/main/native/linux/x86_64/libinterface_jni.so
/home/ubuntu/bouncy-jostle/openssl-jostle/jostle/build/resources/main/native/linux/x86_64/libinterface_jni.so
/home/ubuntu/bouncy-jostle/openssl-jostle/interface/libinterface_jni.soUse /home/ubuntu/openssl_3_6/lib64:/home/ubuntu/bouncy-jostle/openssl-jostle/jostle/build/resources/main/native/linux/x86_64 for the DEFAULT_NATIVE_LIB_PATH.
Use the provided script to execute benchmarks. It handles configuration, native paths, and logging.
./scripts/run_benchmarks.sh- JSON Results:
build/results/jmh/results.json(for analysis) - Execution Log:
build/results/jmh/benchmark_run.log(terminal output)
Configuration is centrally managed in scripts/run_benchmarks.sh.
| Parameter | Description | Default |
|---|---|---|
WARMUP |
Number of warmup iterations | 2 |
ITERATIONS |
Number of measurement iterations | 3 |
TIME |
Duration of each iteration | "5s" |
FORK |
Number of fresh JVM forks | 1 |
MODE |
JMH Mode (thrpt, avgt, sample, ss) |
"thrpt" |
A React-based web application for visualizing benchmark results with interactive charts and tables.
cd visualizer
npm install
npm run devThe visualizer automatically loads results from results/results.json via symlink. After running benchmarks, start the visualizer to see the comparison between BC and Jostle performance.
npm run buildThe built files will be in visualizer/dist/.
The visualizer is automatically deployed to GitHub Pages when changes are pushed to visualizer/ or results/ on the main branch.