ExtendedCipherState

data class ExtendedCipherState(cs: CipherState, ck: ByteArray) : CipherState

extended cipher state which implements key rotation as per BOLT #8 message format is: +------------------------------- |2-byte encrypted message length| +------------------------------- | 16-byte MAC of the encrypted | | message length | +------------------------------- | | | | | encrypted lightning | | message | | | +------------------------------- | 16-byte MAC of the | | lightning message | +-------------------------------

Parameters

cs

cipher state

ck

chaining key

Constructors

ExtendedCipherState
Link copied to clipboard
common
fun ExtendedCipherState(cs: CipherState, ck: ByteArray)

Functions

cipher
Link copied to clipboard
common
open override fun cipher(): CipherFunctions
decryptWithAd
Link copied to clipboard
common
open override fun decryptWithAd(ad: ByteArray, ciphertext: ByteArray): Pair<CipherState, ByteArray>
encrypt
Link copied to clipboard
common
fun encrypt(plaintext: ByteArray): Pair<ExtendedCipherState, ByteArray>
encryptWithAd
Link copied to clipboard
common
open override fun encryptWithAd(ad: ByteArray, plaintext: ByteArray): Pair<CipherState, ByteArray>
hasKey
Link copied to clipboard
common
open override fun hasKey(): Boolean
initializeKey
Link copied to clipboard
common
open fun initializeKey(key: ByteArray): CipherState

Properties

ck
Link copied to clipboard
common
val ck: ByteArray
cs
Link copied to clipboard
common
val cs: CipherState