
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.
51 lines
1.3 KiB
Go
51 lines
1.3 KiB
Go
package i2np
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/go-i2p/go-i2p/lib/common/certificate"
|
|
)
|
|
|
|
/*
|
|
I2P I2NP GarlicClove
|
|
https://geti2p.net/spec/i2np
|
|
Accurate for version 0.9.28
|
|
|
|
Unencrypted:
|
|
|
|
+----+----+----+----+----+----+----+----+
|
|
| Delivery Instructions |
|
|
~ ~
|
|
~ ~
|
|
| |
|
|
+----+----+----+----+----+----+----+----+
|
|
| I2NP Message |
|
|
~ ~
|
|
~ ~
|
|
| |
|
|
+----+----+----+----+----+----+----+----+
|
|
| Clove ID | Expiration
|
|
+----+----+----+----+----+----+----+----+
|
|
| Certificate |
|
|
+----+----+----+----+----+----+----+
|
|
|
|
Delivery Instructions :: as defined below
|
|
Length varies but is typically 1, 33, or 37 bytes
|
|
|
|
I2NP Message :: Any I2NP Message
|
|
|
|
Clove ID :: 4 byte Integer
|
|
|
|
Expiration :: Date (8 bytes)
|
|
|
|
Certificate :: Always NULL in the current implementation (3 bytes total, all zeroes)
|
|
*/
|
|
|
|
type GarlicClove struct {
|
|
DeliveryInstructions GarlicCloveDeliveryInstructions
|
|
I2NPMessage I2NPMessage
|
|
CloveID int
|
|
Expiration time.Time
|
|
Certificate certificate.Certificate
|
|
}
|