Files
Go_I2p/lib/i2np/garlic_clove.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

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
}