Skip to content

Commit f388fef

Browse files
committed
BIP151: Clarifications on AAD and sequence numbers.
1 parent 2ac0b47 commit f388fef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bip-0151.mediawiki

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,14 @@ After a successful <code>encinit</code>/<code>encack</code> interaction from bot
123123

124124
Encrypted messages do not have the 4byte network magic.
125125

126+
The ciphertext payload length must be included in the AEAD MAC as AAD.
127+
126128
The maximum message length needs to be chosen carefully. The 4 byte length field can lead to a required message buffer of 4 GiB.
127129
Processing the message before the authentication succeeds must not be done.
128130

129131
The 4byte sha256 checksum is no longer required because the AEAD.
130132

131-
Both peers need to track the message number (int64) of sent messages to the remote peer for building a symmetric cipher IV. Padding might be required (96bit IVs).
133+
Both peers need to track the message sequence number (uint32) of sent messages to the remote peer for building a 64 bit symmetric cipher IV. Sequence numbers are allowed to overflow to zero after 4294967295 (2^32-1).
132134

133135
The encrypted payload will result decrypted in one or many unencrypted messages:
134136

@@ -156,7 +158,7 @@ The Re-Keying must be done after every 1GB of data sent or received (recommended
156158

157159
=== Risks ===
158160

159-
The encryption does not include an identity authentication scheme. This BIP does not cover a proposal to avoid MITM attacks during the encryption initialization.
161+
The encryption does not include an identity authentication scheme. This BIP does not cover a proposal to avoid MITM attacks during the encryption initialization.
160162

161163
Identity authentication will be covered in another BIP and will presume communication encryption after this BIP.
162164

0 commit comments

Comments
 (0)