Patent attributes
This document describes techniques and apparatuses that enable determining expected hash-values in functions with control flow. A computing device receives a function comprising function instructions within at least three basic blocks connected via multiple execution paths. Hash-input instructions are inserted within a plurality of the basic blocks that indirectly force hash values at the respective insertion points. Hash values at ends of the plurality of the basic blocks are set to a canonical value and an expected hash-value and hash input-values are calculated using a hash function. By using the canonical value and the hash input-values, the expected hash-value is the same regardless of which execution path is executed.