Class Chacha20Poly1305
- Namespace
- Enterprises.Org.BouncyCastle.Crypto.Tls
- Assembly
- Enterprises.BouncyCastle.Crypto.dll
public class Chacha20Poly1305 : TlsCipher
- Inheritance
-
Chacha20Poly1305
- Implements
-
- Inherited Members
-
Constructors
Chacha20Poly1305(TlsContext)
public Chacha20Poly1305(TlsContext context)
Parameters
context TlsContext
Fields
context
protected readonly TlsContext context
Field Value
- TlsContext
decryptCipher
protected readonly ChaCha7539Engine decryptCipher
Field Value
- ChaCha7539Engine
decryptIV
protected readonly byte[] decryptIV
Field Value
- byte[]
encryptCipher
protected readonly ChaCha7539Engine encryptCipher
Field Value
- ChaCha7539Engine
encryptIV
protected readonly byte[] encryptIV
Field Value
- byte[]
Methods
CalculateNonce(long, byte[])
protected virtual byte[] CalculateNonce(long seqNo, byte[] iv)
Parameters
seqNo long
iv byte[]
Returns
- byte[]
CalculateRecordMac(KeyParameter, byte[], byte[], int, int)
protected virtual byte[] CalculateRecordMac(KeyParameter macKey, byte[] additionalData, byte[] buf, int off, int len)
Parameters
macKey KeyParameter
additionalData byte[]
buf byte[]
off int
len int
Returns
- byte[]
DecodeCiphertext(long, byte, byte[], int, int)
public virtual byte[] DecodeCiphertext(long seqNo, byte type, byte[] ciphertext, int offset, int len)
Parameters
seqNo long
type byte
ciphertext byte[]
offset int
len int
Returns
- byte[]
EncodePlaintext(long, byte, byte[], int, int)
public virtual byte[] EncodePlaintext(long seqNo, byte type, byte[] plaintext, int offset, int len)
Parameters
seqNo long
type byte
plaintext byte[]
offset int
len int
Returns
- byte[]
GenerateRecordMacKey(IStreamCipher)
protected virtual KeyParameter GenerateRecordMacKey(IStreamCipher cipher)
Parameters
cipher IStreamCipher
Returns
- KeyParameter
GetAdditionalData(long, byte, int)
protected virtual byte[] GetAdditionalData(long seqNo, byte type, int len)
Parameters
seqNo long
type byte
len int
Returns
- byte[]
GetPlaintextLimit(int)
public virtual int GetPlaintextLimit(int ciphertextLimit)
Parameters
ciphertextLimit int
Returns
- int
InitRecord(IStreamCipher, bool, long, byte[])
protected virtual KeyParameter InitRecord(IStreamCipher cipher, bool forEncryption, long seqNo, byte[] iv)
Parameters
cipher IStreamCipher
forEncryption bool
seqNo long
iv byte[]
Returns
- KeyParameter
UpdateRecordMacLength(IMac, int)
protected virtual void UpdateRecordMacLength(IMac mac, int len)
Parameters
mac IMac
len int
UpdateRecordMacText(IMac, byte[], int, int)
protected virtual void UpdateRecordMacText(IMac mac, byte[] buf, int off, int len)
Parameters
mac IMac
buf byte[]
off int
len int