clang-randstruct / llvm-project

Randomize the order of fields in a structure layout as a compile-time hardening feature
3 stars 1 forks source link

Create random seed engine "rng" only once #36

Closed connorkuehl closed 5 years ago

connorkuehl commented 5 years ago

Right now our code creates a local variable called rng at the call site of every randomization.

We want to create the engine only once so the seed is only applied once. We can store this as a data member in the Randstruct object or any other creative way. So long as the engine is created once and reused across all of our shuffle calls so that the engine is appropriately utilized.