peer *Peer
plaintext []byte
ciphertext []byte
- peerId *PeerId
+ peerId PeerId
conf *PeerConf
)
}
func init() {
- MTU = 1500
id := new([IDSize]byte)
- peerId := PeerId(*id)
+ peerId = PeerId(*id)
conf = &PeerConf{
Id: &peerId,
+ MTU: MTUDefault,
Timeout: time.Second * time.Duration(TimeoutDefault),
- Noise: false,
- CPR: 0,
}
peer = newPeer(true, "foo", Dummy{&ciphertext}, conf, new([SSize]byte))
plaintext = make([]byte, 789)
}
-func TestSymmetric(t *testing.T) {
+func TestTransportSymmetric(t *testing.T) {
peerd := newPeer(true, "foo", Dummy{nil}, conf, new([SSize]byte))
f := func(payload []byte) bool {
if len(payload) == 0 {
}
}
-func TestSymmetricNoise(t *testing.T) {
+func TestTransportSymmetricNoise(t *testing.T) {
peerd := newPeer(true, "foo", Dummy{nil}, conf, new([SSize]byte))
peer.NoiseEnable = true
peerd.NoiseEnable = true
peer.NoiseEnable = true
}
-func TestSymmetricEncLess(t *testing.T) {
+func TestTransportSymmetricEncless(t *testing.T) {
peerd := newPeer(true, "foo", Dummy{nil}, conf, new([SSize]byte))
- peer.EncLess = true
+ peer.Encless = true
peer.NoiseEnable = true
- peerd.EncLess = true
+ peerd.Encless = true
peerd.NoiseEnable = true
f := func(payload []byte) bool {
if len(payload) == 0 {
t.Error(err)
}
peer.NoiseEnable = false
- peer.EncLess = false
+ peer.Encless = false
}
func BenchmarkEnc(b *testing.B) {
}
}
}
+
+func TestTransportBigger(t *testing.T) {
+ tmp := make([]byte, MTUMax*4)
+ Rand.Read(tmp)
+ peer.PktProcess(tmp, Dummy{nil}, true)
+}