Key generation re-work to handle parameters and 2 stage keygen