C# Class Org.BouncyCastle.Crypto.Tls.Chacha20Poly1305

Inheritance: TlsCipher
显示文件 Open project: gkardava/WinPass

Protected Properties

Property Type Description
context TlsContext
encryptCipher Org.BouncyCastle.Crypto.Engines.ChaCha7539Engine
encryptIV byte[]

Public Methods

Method Description
Chacha20Poly1305 ( TlsContext context ) : System
DecodeCiphertext ( long seqNo, byte type, byte ciphertext, int offset, int len ) : byte[]
EncodePlaintext ( long seqNo, byte type, byte plaintext, int offset, int len ) : byte[]
GetPlaintextLimit ( int ciphertextLimit ) : int

Protected Methods

Method Description
CalculateNonce ( long seqNo, byte iv ) : byte[]
CalculateRecordMac ( KeyParameter macKey, byte additionalData, byte buf, int off, int len ) : byte[]
GenerateRecordMacKey ( IStreamCipher cipher ) : KeyParameter
GetAdditionalData ( long seqNo, byte type, int len ) : byte[]
InitRecord ( IStreamCipher cipher, bool forEncryption, long seqNo, byte iv ) : KeyParameter
UpdateRecordMacLength ( IMac mac, int len ) : void
UpdateRecordMacText ( IMac mac, byte buf, int off, int len ) : void

Method Details

CalculateNonce() protected method

protected CalculateNonce ( long seqNo, byte iv ) : byte[]
seqNo long
iv byte
return byte[]

CalculateRecordMac() protected method

protected CalculateRecordMac ( KeyParameter macKey, byte additionalData, byte buf, int off, int len ) : byte[]
macKey Org.BouncyCastle.Crypto.Parameters.KeyParameter
additionalData byte
buf byte
off int
len int
return byte[]

Chacha20Poly1305() public method

public Chacha20Poly1305 ( TlsContext context ) : System
context TlsContext
return System

DecodeCiphertext() public method

public DecodeCiphertext ( long seqNo, byte type, byte ciphertext, int offset, int len ) : byte[]
seqNo long
type byte
ciphertext byte
offset int
len int
return byte[]

EncodePlaintext() public method

public EncodePlaintext ( long seqNo, byte type, byte plaintext, int offset, int len ) : byte[]
seqNo long
type byte
plaintext byte
offset int
len int
return byte[]

GenerateRecordMacKey() protected method

protected GenerateRecordMacKey ( IStreamCipher cipher ) : KeyParameter
cipher IStreamCipher
return Org.BouncyCastle.Crypto.Parameters.KeyParameter

GetAdditionalData() protected method

protected GetAdditionalData ( long seqNo, byte type, int len ) : byte[]
seqNo long
type byte
len int
return byte[]

GetPlaintextLimit() public method

public GetPlaintextLimit ( int ciphertextLimit ) : int
ciphertextLimit int
return int

InitRecord() protected method

protected InitRecord ( IStreamCipher cipher, bool forEncryption, long seqNo, byte iv ) : KeyParameter
cipher IStreamCipher
forEncryption bool
seqNo long
iv byte
return Org.BouncyCastle.Crypto.Parameters.KeyParameter

UpdateRecordMacLength() protected method

protected UpdateRecordMacLength ( IMac mac, int len ) : void
mac IMac
len int
return void

UpdateRecordMacText() protected method

protected UpdateRecordMacText ( IMac mac, byte buf, int off, int len ) : void
mac IMac
buf byte
off int
len int
return void

Property Details

context protected_oe property

protected TlsContext context
return TlsContext

encryptCipher protected_oe property

protected ChaCha7539Engine,Org.BouncyCastle.Crypto.Engines encryptCipher
return Org.BouncyCastle.Crypto.Engines.ChaCha7539Engine

encryptIV protected_oe property

protected byte[] encryptIV
return byte[]