| Constructor and Description |
|---|
MLKEMDHState(boolean isAlice,
String patternId)
Bob local/remote or Alice remote side, do not call generateKeyPair()
|
MLKEMDHState(KeyFactory hdh,
String patternId)
Alice local side
|
| Modifier and Type | Method and Description |
|---|---|
void |
calculate(byte[] sharedKey,
int offset,
DHState publicDH)
Side effect: If we are Bob, copies the ciphertext to our public key
so it may be written out in the message.
|
void |
clearKey()
Clears the key pair.
|
MLKEMDHState |
clone()
I2P
|
void |
copyFrom(DHState other)
Copies the key values from another DH object of the same type.
|
void |
destroy()
Destroys all sensitive state in the current object.
|
void |
generateKeyPair()
Alice local side ONLY
|
String |
getDHName()
Gets the Noise protocol name for this Diffie-Hellman algorithm.
|
void |
getPublicKey(byte[] key,
int offset)
Gets the public key associated with this object.
|
int |
getPublicKeyLength()
Note: Alice/Bob sizes are different
|
int |
getSharedKeyLength()
Gets the length of shared keys for this algorithm.
|
boolean |
hasEncodedPublicKey()
I2P
|
boolean |
hasPrivateKey()
Determine if this object contains a private key.
|
boolean |
hasPublicKey()
Determine if this object contains a public key.
|
boolean |
isNullPublicKey()
Determine if the public key in this object is the special null value.
|
void |
setPublicKey(byte[] key,
int offset)
Sets the public key for this object.
|
void |
setToNullPublicKey()
Sets this object to the null public key and clears the private key.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEncodedPublicKey, getPrivateKey, getPrivateKeyLength, setKeyspublic MLKEMDHState(boolean isAlice,
String patternId)
isAlice - true for Bob remote side, false for Bob local side and Alice remote sidepublic MLKEMDHState(KeyFactory hdh, String patternId)
public void calculate(byte[] sharedKey,
int offset,
DHState publicDH)
calculate in interface DHStatesharedKey - Buffer to put the shared key into.offset - Offset of the first byte for the shared key.publicDH - Object that contains the public key for the calculation.IllegalArgumentException - on bad public key moduluspublic void clearKey()
DHStatepublic MLKEMDHState clone() throws CloneNotSupportedException
clone in interface DHStateclone in class ObjectCloneNotSupportedExceptionpublic void copyFrom(DHState other)
DHStatepublic void destroy()
Destroyabledestroy in interface Destroyablepublic void generateKeyPair()
generateKeyPair in interface DHStatepublic String getDHName()
DHStatepublic void getPublicKey(byte[] key,
int offset)
DHStategetPublicKey in interface DHStatekey - The buffer to copy the public key to.offset - The first offset in the key buffer to copy to.public int getPublicKeyLength()
getPublicKeyLength in interface DHStatepublic int getSharedKeyLength()
DHStategetSharedKeyLength in interface DHStatepublic boolean hasEncodedPublicKey()
hasEncodedPublicKey in interface DHStatepublic boolean hasPrivateKey()
DHStatehasPrivateKey in interface DHStatepublic boolean hasPublicKey()
DHStatehasPublicKey in interface DHStatepublic boolean isNullPublicKey()
DHStateisNullPublicKey in interface DHStatepublic void setPublicKey(byte[] key,
int offset)
DHStatesetPublicKey in interface DHStatekey - The buffer containing the public key.offset - The first offset in the buffer that contains the key.
If this object previously held a key pair, then this function
will change it into a public key only object.public void setToNullPublicKey()
DHStatesetToNullPublicKey in interface DHState