Replaced OpenSSL RAND_bytes with PolarSSL random funtionality