From 50aeefcb5198d99777e19f9a0100fe74af630dfb Mon Sep 17 00:00:00 2001 From: Mathias Hall-Andersen Date: Fri, 23 Jun 2017 13:41:59 +0200 Subject: Beginning work noise handshake --- src/noise_test.go | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/noise_test.go (limited to 'src/noise_test.go') diff --git a/src/noise_test.go b/src/noise_test.go new file mode 100644 index 0000000..b3ea54f --- /dev/null +++ b/src/noise_test.go @@ -0,0 +1,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 + +} -- cgit v1.2.3