throw new ShortBufferException("ECKeyAgreement - buffer too short");
}
if (kdf != null)
{
kdf.init(new KDFParameters(secret, null));
kdf.generateBytes(sharedSecret, offset, sharedSecret.length - offset);
}
else
{
System.arraycopy(secret, 0, sharedSecret, offset, secret.length);