mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-03-05 21:18:17 +01:00
akwizgran created page: BSP
10
BTP.markdown
10
BTP.markdown
@@ -6,7 +6,7 @@ The underlying transport is not required to provide any security properties. We
|
||||
|
||||
### Notation
|
||||
|
||||
We use || to denote concatenation, double quotes to denote an ASCII string, int(x) to denote x represented as a 64-bit signed big-endian integer, len(x) to denote the length of x in bytes, and pack(x) as shorthand for int(len(x)) || x.
|
||||
We use || to denote concatenation, double quotes to denote an ASCII string, int(x) to denote x represented as a 64-bit integer, len(x) to denote the length of x in bytes, and pack(x) as shorthand for int(len(x)) || x. All integers in BTP are big-endian.
|
||||
|
||||
### Crypto primitives
|
||||
|
||||
@@ -96,9 +96,9 @@ The remainder of the stream consists of one or more frames. Each frame has a fix
|
||||
The plaintext frame header is 4 bytes long with the following format:
|
||||
|
||||
* Bit 0: Final frame flag, set to one if this is the last frame in the stream
|
||||
* Bits 1-15: Length of the data in bytes, as a big-endian integer
|
||||
* Bits 1-15: Length of the data in bytes as a 15-bit integer
|
||||
* Bit 16: Zero
|
||||
* Bits 17-31: Length of the padding in bytes, as a big-endian integer
|
||||
* Bits 17-31: Length of the padding in bytes as a 15-bit integer
|
||||
|
||||
The plaintext frame body contains the data and padding. The total length of the data and padding must be less than 2^15 bytes. If any padding is present it must all be zeroes.
|
||||
|
||||
@@ -107,13 +107,13 @@ The header and body are encrypted and authenticated separately using the ephemer
|
||||
The nonce for the frame header is nonce_len bytes long with the following format:
|
||||
|
||||
* Bit 0: Header flag, set to one
|
||||
* Bits 1-63: Frame number as a big-endian integer
|
||||
* Bits 1-63: Frame number as a 63-bit integer
|
||||
* Remaining bits: Zero
|
||||
|
||||
The nonce for the frame body is nonce_len bytes long with the following format:
|
||||
|
||||
* Bit 0: Header flag, set to zero
|
||||
* Bits 1-63: Frame number as a big-endian integer
|
||||
* Bits 1-63: Frame number as a 63-bit integer
|
||||
* Remaining bits: Zero
|
||||
|
||||
> Implementation note: The final frame flag allows the recipient to detect the end of the stream without reading to EOF, which is not possible for all transports on all platforms.
|
||||
|
||||
Reference in New Issue
Block a user