Skip to content

Sandbox Mode

Peter Torelli edited this page Dec 14, 2022 · 1 revision

What is it?

Sandbox mode is a convenient way to test each crypto primitive in isolation, rather than running a lengthy suite with fixed data sizes. This can be helpful for debugging during the port process, too.

In the screenshot below, the "Sandbox" tab has been selected, and the attached DUT is configured for Performance Mode (no energy monitor devices, just the DUT attached directly to the Host). The first drop-down offers a selection of primitive types, including two TRNG-related tests.

image

Examples

In the image below, sandbox mode was used to measure the speed of an Ed25519 verification operation of a 32B message. Since verification can be tested by sending a message that is valid, or one that is invalid, we tested with an invalid message. (Why? Because this is helpful for debug: if there's a bug in the port and the DUT reports an invalid signature is valid, this test would fail and let the developer know.)

image

Autotuning and Measurement Error

By setting iterations to "0", the DUT will "autotune" itself, which means it will find the correct number of iterations to meet the EEMBC test criteria: 10 second runtime or minimum of 10 iterations. If we had set the iterations to "1" and the test completed quickly, we would not get an accurate measurement. Many crypto functions can complete thousands of iterations in the minimum timer resolution of 1 msec; 10 seconds is 10,000x the resolution of the timer, which results in a +/-0.01% measurement error.

Entropy and DRBG

Two two options "Entropy Latency" and "DRBG Throughput" measure the speed of the RNG initialization (generating entropy), and throughput of the random number generation (DRBG speed). Since these two functions test only speed and not the quality of the randomness (e.g., NIST800-20), they are only provided in the Sandbox. See the functions in th_rng.c and the example in the wolfSSL th_rng.c for more information.

Clone this wiki locally