more progress:

* add tunnel crypto

* add base boilter plate for tunnel message processing
This commit is contained in:
Jeff Becker
2016-01-28 18:19:23 -05:00
parent 45656d356f
commit 3c62d42c42
9 changed files with 153 additions and 27 deletions

20
lib/tunnel/message.go Normal file
View File

@ -0,0 +1,20 @@
package tunnel
import (
"github.com/bounce-chat/go-i2p/lib/crypto"
"encoding/binary"
)
type TunnelID uint32
// data sent down a tunnel
type TunnelMessage crypto.TunnelData
func (tm TunnelMessage) ID() (tid TunnelID) {
tid = TunnelID(binary.BigEndian.Uint32(tm[:4]))
return
}
func (tm TunnelMessage) IV() crypto.TunnelIV {
return tm[4:20]
}