mirror of https://github.com/status-im/go-waku.git
88 lines
1.8 KiB
Go
88 lines
1.8 KiB
Go
package noise
|
|
|
|
import (
|
|
n "github.com/waku-org/noise"
|
|
)
|
|
|
|
/*
|
|
K1K1:
|
|
|
|
-> s
|
|
<- s
|
|
...
|
|
-> e
|
|
<- e, ee, es
|
|
-> se
|
|
*/
|
|
var HandshakeK1K1 = n.HandshakePattern{
|
|
Name: "K1K1",
|
|
InitiatorPreMessages: []n.MessagePattern{n.MessagePatternS},
|
|
ResponderPreMessages: []n.MessagePattern{n.MessagePatternS},
|
|
Messages: [][]n.MessagePattern{
|
|
{n.MessagePatternE},
|
|
{n.MessagePatternE, n.MessagePatternDHEE, n.MessagePatternDHES},
|
|
{n.MessagePatternDHSE},
|
|
},
|
|
}
|
|
|
|
/*
|
|
XK1:
|
|
|
|
<- s
|
|
...
|
|
-> e
|
|
<- e, ee, es
|
|
-> s, se
|
|
*/
|
|
var HandshakeXK1 = n.HandshakePattern{
|
|
Name: "XK1",
|
|
ResponderPreMessages: []n.MessagePattern{n.MessagePatternS},
|
|
Messages: [][]n.MessagePattern{
|
|
{n.MessagePatternE},
|
|
{n.MessagePatternE, n.MessagePatternDHEE, n.MessagePatternDHES},
|
|
{n.MessagePatternS, n.MessagePatternDHSE},
|
|
},
|
|
}
|
|
|
|
/*
|
|
XX:
|
|
|
|
-> e
|
|
<- e, ee, s, es
|
|
-> s, se
|
|
*/
|
|
var HandshakeXX = n.HandshakePattern{
|
|
Name: "XX",
|
|
Messages: [][]n.MessagePattern{
|
|
{n.MessagePatternE},
|
|
{n.MessagePatternE, n.MessagePatternDHEE, n.MessagePatternS, n.MessagePatternDHES},
|
|
{n.MessagePatternS, n.MessagePatternDHSE},
|
|
},
|
|
}
|
|
|
|
/*
|
|
XXpsk0:
|
|
|
|
-> psk, e
|
|
<- e, ee, s, es
|
|
-> s, se
|
|
*/
|
|
var HandshakeXXpsk0 = n.HandshakePattern{
|
|
Name: "XXpsk0",
|
|
Messages: [][]n.MessagePattern{
|
|
{n.MessagePatternPSK, n.MessagePatternE},
|
|
{n.MessagePatternE, n.MessagePatternDHEE, n.MessagePatternS, n.MessagePatternDHES},
|
|
{n.MessagePatternS, n.MessagePatternDHSE},
|
|
},
|
|
}
|
|
|
|
var HandshakeWakuPairing = n.HandshakePattern{
|
|
Name: "WakuPairing",
|
|
ResponderPreMessages: []n.MessagePattern{n.MessagePatternE},
|
|
Messages: [][]n.MessagePattern{
|
|
{n.MessagePatternE, n.MessagePatternDHEE},
|
|
{n.MessagePatternS, n.MessagePatternDHES},
|
|
{n.MessagePatternS, n.MessagePatternDHSE, n.MessagePatternDHSS},
|
|
},
|
|
}
|