Files
go-i2p/lib/i2np/build_response_record.go
idk 0ec4f55fa9 Check in unchecked-in common library fixes, start implementing transports.
Since I turned out to be implementing parts of Noise which I did not need to implement, I'm taking a different approach, and doing an unmodified Noise transport first and then making our modifications to it. That should reduce what I need to do to message pre-processing mostly, I think.
2022-07-11 23:41:58 -04:00

49 lines
1.2 KiB
Go

package i2np
import (
common "github.com/go-i2p/go-i2p/lib/common/data"
)
/*
I2P I2NP BuildResponseRecord
https://geti2p.net/spec/i2np
Accurate for version 0.9.28
Encrypted:
bytes 0-527 :: AES-encrypted record (note: same size as BuildRequestRecord)
Unencrypted:
+----+----+----+----+----+----+----+----+
| |
+ +
| |
+ SHA-256 Hash of following bytes +
| |
+ +
| |
+----+----+----+----+----+----+----+----+
| random data... |
~ ~
| |
+ +----+
| | ret|
+----+----+----+----+----+----+----+----+
bytes 0-31 :: SHA-256 Hash of bytes 32-527
bytes 32-526 :: random data
byte 527 :: reply
total length: 528
*/
type BuildResponseRecordELGamalAES [528]byte
type BuildResponseRecordELGamal [528]byte
type BuildResponseRecord struct {
Hash common.Hash
Padding [495]byte
Reply byte
}