}
public AsymmetricCipherKeyPair generateKeyPair()
{
BigInteger p, x, y;
ElGamalParameters elParams = param.getParameters();
p = elParams.getP();
x = helper.calculatePrivate(p, param.getRandom(), elParams.getL());
y = helper.calculatePublic(p, elParams.getG(), x);
return new AsymmetricCipherKeyPair(
new ElGamalPublicKeyParameters(y, elParams),
new ElGamalPrivateKeyParameters(x, elParams));
}