Update randomness generation to reflect _randomKey function implementation.