summaryrefslogtreecommitdiffhomepage
path: root/src/noise_test.go
blob: b3ea54fbf7234214d32414e235a42f1f3d67b387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main

import (
	"testing"
)

func TestHandshake(t *testing.T) {
	var dev1 Device
	var dev2 Device

	var err error

	dev1.privateKey, err = newPrivateKey()
	if err != nil {
		t.Fatal(err)
	}

	dev2.privateKey, err = newPrivateKey()
	if err != nil {
		t.Fatal(err)
	}

	var peer1 Peer
	var peer2 Peer

	peer1.publicKey = dev1.privateKey.publicKey()
	peer2.publicKey = dev2.privateKey.publicKey()

	var handshake1 Handshake
	var handshake2 Handshake

	handshake1.device = &dev1
	handshake2.device = &dev2

	handshake1.peer = &peer2
	handshake2.peer = &peer1

}