Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 1.43 KB

File metadata and controls

10 lines (7 loc) · 1.43 KB

Testing the Conformance of Instrumented Programs

Verifying the semantic conformance of a new or instrumented implementation is performed by comparing its behavior against an expected reference. For a high-level test, the result of the transformed program can manually be compared against the expected baseline (e.g., verifying that a signature of a given key and message is still the same). A small example can be found in the README.md of the Obelix repository: example calculations are protected against various side-channels with dynamic obfuscation; the result of the computation is printed for reference.

At a low level, this involves analyzing differences in memory accesses, register values, and other (micro)architectural state in order to identify invariants that must be preserved. Testing the semantic conformance of programs particularly highlights the need for robust diffing, as instrumentation inherently introduces subtle changes (like different stack offsets) that do not incur semantic changes, making comparing raw trace files infeasible.

In case that trace files are too large for the comparison in graphical text editors (with the help of transforming parts of the traces with regular expressions to avoid the aforementioned problem), a binary search-based approach can help. With that, the presence of bugs or differences can effectively be narrowed down to specific program/execution trace regions.