[PATCH 01/27] shared: Add functions for random number generation