Commit Graph

10 Commits

Author SHA1 Message Date
akwizgran
2411e2008b Frame the encrypted data independently of inter-packet boundaries and
authenticate each frame before parsing its contents. Each connection
starts with a tag, followed by any number of frames, each starting
with the frame number (32 bits) and payload length (16 bits), and
ending with a MAC (256 bits).

Tags have the following format: 32 bits reserved, 16 bits for the
transport ID, 32 bits for the connection number, 32 bits (set to zero
in the tag) for the frame number, and 16 bits (set to zero in the tag)
for the block number. The tag is encrypted with the tag key in
ECB mode.

Frame numbers for each connection must start from zero and must be
contiguous and strictly increasing. Each frame is encrypted with the
frame key in CTR mode, using the plaintext tag with the appropriate
frame number to initialise the counter.

The maximum frame size is 64 KiB, including header and footer. The
maximum amount of data that can be sent over a connection is 2^32
frames - roughly 2^48 bytes, or 8 terabytes, with the maximum frame
size of 64 KiB. If that isn't sufficient we can add another 16 bits to
the frame counter.
2011-08-19 01:46:51 +02:00
akwizgran
c98c968b87 Removed unnecessary Raw interface. 2011-07-24 17:47:17 +01:00
akwizgran
a573e87c04 ReaderImpl now maintains either one or two bytes of lookahead,
depending on the value of the first byte, so that an object's initial
tag is included in the data seen by the ObjectReader. Digests and
signatures can therefore be calculated over objects by their readers
without any risk of ambiguity.
2011-07-22 17:39:59 +01:00
akwizgran
62d69b6fb5 Don't use FileUtils.getBriarDirectory() in tests. 2011-07-14 20:42:41 +01:00
akwizgran
f97393f160 Unit tests, refactoring and bugfixes for the database. Replies to messages in
other groups no longer affect sendability, which makes it safe to delete all
messages from a group when unsubscribing.
2011-07-05 14:16:29 +01:00
akwizgran
0ed2a7c9e7 Javadocs and unit tests. 2011-07-01 12:07:00 +01:00
akwizgran
d193f23e4c Replaced printlns with logging, moved delete() to FileUtils. 2011-06-27 10:38:30 +01:00
akwizgran
dad1b4fcb9 More unit tests. 2011-06-22 16:58:03 +01:00
akwizgran
eb1c855278 Javadocs and unit tests. Woo! 2011-06-22 11:42:33 +01:00
akwizgran
cd4f99df3d Initial commit with new directory structure. 2011-06-21 18:01:28 +01:00