NS driver: Use NS's random number generator when possible.

Original patch by Sascha Alexander Jopen.