This commit is contained in:
zzz
2010-10-02 14:45:13 +00:00
parent 4456048e79
commit 7424fdd623

View File

@ -9,7 +9,9 @@ import net.i2p.data.PublicKey;
import net.i2p.data.SessionKey; import net.i2p.data.SessionKey;
/** /**
* Hold the tunnel request record, managing its encryption and decryption. * Hold the tunnel request record, managing its ElGamal encryption and decryption.
* Iterative AES encryption/decryption is done elsewhere.
*
* Cleartext: * Cleartext:
* <pre> * <pre>
* bytes 0-3: tunnel ID to receive messages as * bytes 0-3: tunnel ID to receive messages as
@ -26,6 +28,12 @@ import net.i2p.data.SessionKey;
* bytes 193-221: uninterpreted / random padding * bytes 193-221: uninterpreted / random padding
* </pre> * </pre>
* *
* Encrypted:
* <pre>
* bytes 0-15: First 16 bytes of router hash
* bytes 16-527: ElGamal encrypted block (discarding zero bytes at elg[0] and elg[257])
* </pre>
*
*/ */
public class BuildRequestRecord { public class BuildRequestRecord {
private ByteArray _data; private ByteArray _data;
@ -152,7 +160,7 @@ public class BuildRequestRecord {
/** /**
* Encrypt the record to the specified peer. The result is formatted as: <pre> * Encrypt the record to the specified peer. The result is formatted as: <pre>
* bytes 0-15: SHA-256-128 of the current hop's identity (the toPeer parameter) * bytes 0-15: truncated SHA-256 of the current hop's identity (the toPeer parameter)
* bytes 15-527: ElGamal-2048 encrypted block * bytes 15-527: ElGamal-2048 encrypted block
* </pre> * </pre>
*/ */