, always ensure that the RNG is crypto-grade by calling assert_crypto() on the RNG. This will throw an exception if the RNG is not crypto-grade: void set_rng(RandomAPI::Ptr rng_arg) { rng_arg->assert_crypto(); rng = std::move(rng_arg); } Any variable whose value is not ...