return output;
}
}
else
{
ElGamalPublicKeyParameters pub = (ElGamalPublicKeyParameters)key;
BigInteger input = new BigInteger(1, block);
int pBitLength = p.bitLength();
BigInteger k = new BigInteger(pBitLength, random);
while (k.equals(ZERO) || (k.compareTo(p.subtract(TWO)) > 0))
{
k = new BigInteger(pBitLength, random);
}
BigInteger gamma = g.modPow(k, p);
BigInteger phi = input.multiply(pub.getY().modPow(k, p)).mod(p);
byte[] out1 = gamma.toByteArray();
byte[] out2 = phi.toByteArray();
byte[] output = new byte[this.getOutputBlockSize()];