Package fr.acinq.lightning.crypto.noise

Types

ByteStream
Link copied to clipboard
common
interface ByteStream
Chacha20Poly1305CipherFunctions
Link copied to clipboard
object Chacha20Poly1305CipherFunctions : CipherFunctions
object Chacha20Poly1305CipherFunctions : CipherFunctions
object Chacha20Poly1305CipherFunctions : CipherFunctions
CipherFunctions
Link copied to clipboard
common
interface CipherFunctions

Cipher functions

CipherState
Link copied to clipboard
common
interface CipherState

Cipher state

DHFunctions
Link copied to clipboard
common
interface DHFunctions
ExtendedCipherState
Link copied to clipboard
common
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 | +-------------------------------

HandshakePattern
Link copied to clipboard
common
data class HandshakePattern(name: String, initiatorPreMessages: List<MessagePattern>, responderPreMessages: List<MessagePattern>, messages: List<List<MessagePattern>>)
HandshakeState
Link copied to clipboard
common
sealed class HandshakeState
HandshakeStateReader
Link copied to clipboard
common
data class HandshakeStateReader(messages: List<List<MessagePattern>>, state: SymmetricState, s: Pair<ByteArray, ByteArray>, e: Pair<ByteArray, ByteArray>, rs: ByteArray, re: ByteArray, dh: DHFunctions, byteStream: ByteStream) : HandshakeState
HandshakeStateWriter
Link copied to clipboard
common
data class HandshakeStateWriter(messages: List<List<MessagePattern>>, state: SymmetricState, s: Pair<ByteArray, ByteArray>, e: Pair<ByteArray, ByteArray>, rs: ByteArray, re: ByteArray, dh: DHFunctions, byteStream: ByteStream) : HandshakeState
HashFunctions
Link copied to clipboard
common
interface HashFunctions

Hash functions

InitializedCipherState
Link copied to clipboard
common
data class InitializedCipherState(k: ByteArray, n: Long, cipher: CipherFunctions) : CipherState

Initialized cipher state

MessagePattern
Link copied to clipboard
common
enum MessagePattern : Enum<MessagePattern>
RandomBytes
Link copied to clipboard
common
object RandomBytes : ByteStream
Secp256k1DHFunctions
Link copied to clipboard
common
object Secp256k1DHFunctions : DHFunctions
SHA256HashFunctions
Link copied to clipboard
common
object SHA256HashFunctions : HashFunctions
SymmetricState
Link copied to clipboard
common
data class SymmetricState(cipherState: CipherState, ck: ByteArray, h: ByteArray, hashFunctions: HashFunctions)
UninitializedCipherState
Link copied to clipboard
common
data class UninitializedCipherState(cipher: CipherFunctions) : CipherState

Uninitialized cipher state. Encrypt and decrypt do nothing (ciphertext = plaintext)

Properties

handshakePatternNN
Link copied to clipboard
common
val handshakePatternNN: HandshakePattern

standard handshake patterns

handshakePatternXK
Link copied to clipboard
common
val handshakePatternXK: HandshakePattern