Modifier and Type | Field and Description |
---|---|
protected TlsContext |
context |
protected ChaCha7539Engine |
decryptCipher |
protected byte[] |
decryptIV |
protected ChaCha7539Engine |
encryptCipher |
protected byte[] |
encryptIV |
Constructor and Description |
---|
Chacha20Poly1305(TlsContext context) |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
calculateNonce(long seqNo,
byte[] iv) |
protected byte[] |
calculateRecordMAC(KeyParameter macKey,
byte[] additionalData,
byte[] buf,
int off,
int len) |
byte[] |
decodeCiphertext(long seqNo,
short type,
byte[] ciphertext,
int offset,
int len) |
byte[] |
encodePlaintext(long seqNo,
short type,
byte[] plaintext,
int offset,
int len) |
protected KeyParameter |
generateRecordMACKey(StreamCipher cipher) |
protected byte[] |
getAdditionalData(long seqNo,
short type,
int len) |
int |
getPlaintextLimit(int ciphertextLimit) |
protected KeyParameter |
initRecord(StreamCipher cipher,
boolean forEncryption,
long seqNo,
byte[] iv) |
protected void |
updateRecordMACLength(Mac mac,
int len) |
protected void |
updateRecordMACText(Mac mac,
byte[] buf,
int off,
int len) |
protected TlsContext context
protected ChaCha7539Engine encryptCipher
protected ChaCha7539Engine decryptCipher
protected byte[] encryptIV
protected byte[] decryptIV
public Chacha20Poly1305(TlsContext context) throws java.io.IOException
java.io.IOException
public int getPlaintextLimit(int ciphertextLimit)
getPlaintextLimit
in interface TlsCipher
public byte[] encodePlaintext(long seqNo, short type, byte[] plaintext, int offset, int len) throws java.io.IOException
encodePlaintext
in interface TlsCipher
java.io.IOException
public byte[] decodeCiphertext(long seqNo, short type, byte[] ciphertext, int offset, int len) throws java.io.IOException
decodeCiphertext
in interface TlsCipher
java.io.IOException
protected KeyParameter initRecord(StreamCipher cipher, boolean forEncryption, long seqNo, byte[] iv)
protected byte[] calculateNonce(long seqNo, byte[] iv)
protected KeyParameter generateRecordMACKey(StreamCipher cipher)
protected byte[] calculateRecordMAC(KeyParameter macKey, byte[] additionalData, byte[] buf, int off, int len)
protected void updateRecordMACLength(Mac mac, int len)
protected void updateRecordMACText(Mac mac, byte[] buf, int off, int len)
protected byte[] getAdditionalData(long seqNo, short type, int len) throws java.io.IOException
java.io.IOException