This commit is contained in:
zzz
2010-11-24 14:56:07 +00:00
parent 4dfac0846b
commit 18a90516b3

View File

@ -33,21 +33,24 @@ import net.i2p.util.Log;
* *
* The NTCP transport sends individual I2NP messages AES/256/CBC encrypted with * The NTCP transport sends individual I2NP messages AES/256/CBC encrypted with
* a simple checksum. The unencrypted message is encoded as follows: * a simple checksum. The unencrypted message is encoded as follows:
*<pre>
* +-------+-------+--//--+---//----+-------+-------+-------+-------+ * +-------+-------+--//--+---//----+-------+-------+-------+-------+
* | sizeof(data) | data | padding | adler checksum of sz+data+pad | * | sizeof(data) | data | padding | adler checksum of sz+data+pad |
* +-------+-------+--//--+---//----+-------+-------+-------+-------+ * +-------+-------+--//--+---//----+-------+-------+-------+-------+
*</pre>
* That message is then encrypted with the DH/2048 negotiated session key * That message is then encrypted with the DH/2048 negotiated session key
* (station to station authenticated per the EstablishState class) using the * (station to station authenticated per the EstablishState class) using the
* last 16 bytes of the previous encrypted message as the IV. * last 16 bytes of the previous encrypted message as the IV.
* *
* One special case is a metadata message where the sizeof(data) is 0. In * One special case is a metadata message where the sizeof(data) is 0. In
* that case, the unencrypted message is encoded as: * that case, the unencrypted message is encoded as:
*<pre>
* +-------+-------+-------+-------+-------+-------+-------+-------+ * +-------+-------+-------+-------+-------+-------+-------+-------+
* | 0 | timestamp in seconds | uninterpreted * | 0 | timestamp in seconds | uninterpreted
* +-------+-------+-------+-------+-------+-------+-------+-------+ * +-------+-------+-------+-------+-------+-------+-------+-------+
* uninterpreted | adler checksum of sz+data+pad | * uninterpreted | adler checksum of sz+data+pad |
* +-------+-------+-------+-------+-------+-------+-------+-------+ * +-------+-------+-------+-------+-------+-------+-------+-------+
* *</pre>
* *
*/ */
public class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener { public class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener {