Modifier and Type | Field and Description |
---|---|
protected TlsContext |
context |
protected BlockCipher |
decryptCipher |
protected BlockCipher |
encryptCipher |
protected boolean |
encryptThenMAC |
protected byte[] |
randomData |
protected TlsMac |
readMac |
protected boolean |
useExplicitIV |
protected TlsMac |
writeMac |
Constructor and Description |
---|
TlsBlockCipher(TlsContext context,
BlockCipher clientWriteCipher,
BlockCipher serverWriteCipher,
Digest clientWriteDigest,
Digest serverWriteDigest,
int cipherKeySize) |
Modifier and Type | Method and Description |
---|---|
protected int |
checkPaddingConstantTime(byte[] buf,
int off,
int len,
int blockSize,
int macSize) |
protected int |
chooseExtraPadBlocks(java.security.SecureRandom r,
int max) |
byte[] |
decodeCiphertext(long seqNo,
short type,
byte[] ciphertext,
int offset,
int len) |
byte[] |
encodePlaintext(long seqNo,
short type,
byte[] plaintext,
int offset,
int len) |
int |
getPlaintextLimit(int ciphertextLimit) |
TlsMac |
getReadMac() |
TlsMac |
getWriteMac() |
protected int |
lowestBitSet(int x) |
protected TlsContext context
protected byte[] randomData
protected boolean useExplicitIV
protected boolean encryptThenMAC
protected BlockCipher encryptCipher
protected BlockCipher decryptCipher
protected TlsMac writeMac
protected TlsMac readMac
public TlsBlockCipher(TlsContext context, BlockCipher clientWriteCipher, BlockCipher serverWriteCipher, Digest clientWriteDigest, Digest serverWriteDigest, int cipherKeySize) throws java.io.IOException
java.io.IOException
public TlsMac getWriteMac()
public TlsMac getReadMac()
public int getPlaintextLimit(int ciphertextLimit)
getPlaintextLimit
in interface TlsCipher
public byte[] encodePlaintext(long seqNo, short type, byte[] plaintext, int offset, int len)
encodePlaintext
in interface TlsCipher
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 int checkPaddingConstantTime(byte[] buf, int off, int len, int blockSize, int macSize)
protected int chooseExtraPadBlocks(java.security.SecureRandom r, int max)
protected int lowestBitSet(int x)