add KeyGen procedure