GenerateKeyPair and performance improvements

Completed implementation of GenerateKeyPair operation.
Improved performance of Random Generator.