Modifier and Type | Field and Description |
---|---|
protected BigInteger |
k |
Modifier | Constructor and Description |
---|---|
protected |
AbstractDH() |
Modifier and Type | Method and Description |
---|---|
protected abstract byte[] |
calculateK() |
abstract byte[] |
getE() |
abstract Digest |
getHash() |
byte[] |
getK() |
abstract void |
setF(byte[] e) |
static byte[] |
stripLeadingZeroes(byte[] x)
The shared secret returned by
KeyAgreement.generateSecret()
is a byte array, which can (by chance, roughly 1 out of 256 times) begin
with zero byte (some JCE providers might strip this, though). |
protected BigInteger k
public abstract void setF(byte[] e)
public static byte[] stripLeadingZeroes(byte[] x)
KeyAgreement.generateSecret()
is a byte array, which can (by chance, roughly 1 out of 256 times) begin
with zero byte (some JCE providers might strip this, though). In SSH,
the shared secret is an integer, so we need to strip the leading zero(es).x
- The original arrayIllegalArgumentException
- If all zeroes arrayCopyright © 2008–2016 The Apache Software Foundation. All rights reserved.