Changed key generation in test cases.

Changed purely random key generation to sequential with random steps.
This will not change anything for the distribution of hashed values
because this is ensured by the hash function.