Finished the key generation aspects including tests.