perfcheck
perfcheck [OPTIONS] [SUITE:TEST_NUMBER ...]
Only supported in FIPS 140-2 Level 2 Security Worlds. |
Runs various tests to measure the cryptographic performance of a module.
By default, tests are run 3 times and with both max-queue
and the queue of 1
.
To run tests just once each with max-queue
, use the -s
or --single
parameter.
perfcheck example command lines
Run default set of tests |
|
Run particular suites of tests |
|
Run particular tests by ID |
|
Run particular tests by exact name |
|
Run particular tests by prefix |
|
Run a list of tests from file |
|
List default set of tests |
|
List the tests within particular suites |
|
List the available suites |
|
Compare two results sets |
|
perfcheck syntax
Option | Description |
---|---|
Output options for test execution and report diffs |
|
|
Raw data for each test case will be written to the |
|
Output destination directory name.
A subdirectory named |
|
Does not create a subdirectory of the |
|
Prints a summary of the latest results for a test every second during execution. No interim results will be printed for tests that take less than a second to complete. |
Diff options to produce a comparison report between two sets of test results to identify significant regressions or improvements in performance.
The |
|
|
Creates a comparison report. |
|
Path to the new result set. |
|
Path to the old result set. |
|
Threshold percentage regression to report as error. |
Testing options to configure the test execution behavior. |
|
|
Accuracy level. |
|
Throttle input to system by spinning for the specified number of instructions before submitting each job. |
|
Depth of testing. |
|
Path to a file containing a list of tests to run. |
|
Time limit for individual test cases or 0 for no limit. |
|
Specifies the request queue size or |
|
Runs this many repetitions instead of the default. More may be run due to other constraints. |
|
Runs each selected test case the specified number of times.
Values above |
|
Does a single run of each test case. |
|
Minimum time to run individual test cases. |
|
Target relative standard error percentage or |
|
Number of client threads from which to fill the queue.
The queue will be split evenly across the threads. |
Option to address HSMs |
|
|
Specifies the number of the module to perform the test with. |
Help options |
|
|
Displays help for |
|
displays help for the available test suites. |
|
Lists all tests that will be run in the selected suites. |
|
Displays a brief usage summary for |
|
Displays the version number of the Security World Software that deploys |
perfcheck tests
The available tests are grouped into suites:
-
kx
(key exchange) -
keygen
(key generation) -
signing
(signing) -
verify
(verification) -
enc
(encryption) -
dec
(decryption) -
misc
(miscellaneous)
To see the list of tests run by default in a particular suite, run a command of the form:
perfcheck --list suite
To see all available tests in a particular suite, including those not run by default, run a command of the form:
perfcheck --list --depth=full suite
For example, to list all the signing
tests, run the command:
perfcheck --list --depth=full signing
>>> Suite `signing' -- Signing (374 tests)
>>> signing 1 - DSA using RIPEMD160 with 1024-bit p and 160-bit q.
>>> signing 2 - DSA using RIPEMD160 with 2048-bit p and 160-bit q.
>>> signing 3 - DSA using RIPEMD160 with 3072-bit p and 160-bit q.
>>> signing 4 - DSA using SHA1 with 1024-bit p and 160-bit q.
>>> signing 5 - DSA using SHA1 with 2048-bit p and 160-bit q.
>>> signing 6 - DSA using SHA1 with 3072-bit p and 160-bit q.
In the output, each listed test in the suite is identified with a number.
You can reference a test either by its number or by its name:
-
by test number:
perfcheck suite:test_number
To use test
16
of thesigning
suite:perfcheck signing:16
-
by test name:
perfcheck "signing:RSA using RSAhSHA3b512pPSS with 4096-bit n."
Example:
perfcheck "signing:RSA using RSApPKCS1 with 2048-bit n."
The test numbers change between releases. If you want to rerun tests for comparison, reference the tests by their names.
perfcheck
prints the results of individual tests to output as it goes along, and then prints a full report at the end.
By default, perfcheck
runs each test three times for both minimum and maximum queue sizes, and then collates the results in the final report.
See --help
for the options to adjust this behavior.
Optionally, perfcheck
can write its output to a directory in multiple formats using the --outputdir
option to specify a directory name.
This will create a new subdirectory under the specified directory to write the output.
The --nosubdir
option can be added as well to write output to the specified directory directly, in which case that directory must not already exist.
The output directory will contain perfcheck.html
, perfcheck.txt
, perfcheck.csv
, and perfcheck.json
files that contain the report in HTML, text, CSV, and JSON format respectively.
JSON files that contain the detailed results of individual tests will also be written to the output directory.
Output reports from test suites include the following information about each test:
Value | Description |
---|---|
CV (%) |
This value is the coefficient of variation expressed as a percentage of the mean latency.
It gives an indication of the variability in the time it takes individual jobs to complete. |
Max latency (ms) |
This value is the time in milliseconds that the slowest individual job across all the test runs took to round-trip. |
Max rate (tps) |
This is the estimated upper bound of the throughput for this queue size in transactions per second. |
Mean latency (ms) |
This value is the mean time in milliseconds that jobs took to round-trip. |
Mean rate (tps) |
This is a measure of throughput.
Unlike Rate (Units/s), it is expressed in transactions per second, that is, as the number of jobs that round-trip per second. |
Min latency (ms) |
This value is the time in milliseconds that the quickest individual job across all the test runs took to round-trip. |
Min rate (tps) |
This is the estimated lower bound of the throughput for this queue size in transactions per second. |
Queue |
This value is the number of outstanding jobs in the queue when the test was run. |
Rate (Units/s) |
This value is a measure of throughput.
It is calculated by dividing the number of repetitions by total time. |
Reps |
This value is the number of repetitions that were actually carried out, that is, the number of jobs that were round-tripped over all tests of this operation for this queue size. |
How perfcheck calculates statistics
The perfcheck
utility sends multiple simultaneous nCore commands to keep the HSM busy.
It can send more commands if a required number of repetitions has not yet been reached.
After sending some initial commands, perfcheck
begins marking commands with the time at which are submitted.
When a command comes back with a timestamp, perfcheck
checks the amount of time needed to complete the command and updates the values for Std dev
and Latency
.
The value of Total time
is the amount of time from sending the first job to receiving the final one.
When an nCore command is submitted to an HSM by a client application, it is processed as follows:
PCIe and USB HSMs
Because an HSM can execute several commands at once, throughput is maximized by ensuring there is always at least one command in the hardserver queue (so that there are always commands available to give to the HSM).
-
The command is passed to the hardserver.
-
The client hardserver encrypts the command.
-
When the HSM is free, the command is submitted from the hardserver queue.
-
The command is executed by the HSM, and the reply is given to the hardserver.
-
The unit hardserver queues the reply.
-
The unit hardserver sends the command back to the client hardserver over the network.
-
When the client application is ready, the queued reply is returned to it.
network-attached HSMs
Because an HSM can execute several commands at once, throughput is maximized by ensuring there is always at least one command in the unit hardserver queue (so that there are always commands available to give to the HSM).
-
The command is passed to the client hardserver.
-
The client hardserver encrypts the command.
-
The encrypted command is sent to the unit hardserver over the network.
-
The unit hardserver decrypts the command and queues it.
-
When the internal security module is free, the command is submitted from the hardserver queue.
-
The command is executed by the HSM, and the reply is given to the unit hardserver.
-
The unit hardserver encrypts the command.
-
The unit hardserver sends the command back to the client hardserver over the network.
-
The client hardserver decrypts the reply and queues it.
-
When the client application is ready, the queued reply is returned to it.