go-waku/waku/v2/noise/patterns.go

78 lines
1.4 KiB
Go
Raw Normal View History

2022-08-09 13:55:08 +00:00
package noise
import (
n "github.com/waku-org/noise"
2022-08-09 13:55:08 +00:00
)
/*
2022-10-23 13:09:49 +00:00
K1K1:
-> s
<- s
...
-> e
<- e, ee, es
-> se
2022-08-09 13:55:08 +00:00
*/
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},
},
}
/*
2022-10-23 13:09:49 +00:00
XK1:
<- s
...
-> e
<- e, ee, es
-> s, se
2022-08-09 13:55:08 +00:00
*/
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:
2022-10-23 13:09:49 +00:00
-> e
<- e, ee, s, es
-> s, se
2022-08-09 13:55:08 +00:00
*/
var HandshakeXX = n.HandshakePattern{
Name: "XX",
Messages: [][]n.MessagePattern{
{n.MessagePatternE},
{n.MessagePatternE, n.MessagePatternDHEE, n.MessagePatternS, n.MessagePatternDHES},
{n.MessagePatternS, n.MessagePatternDHSE},
},
}
/*
2022-10-23 13:09:49 +00:00
XXpsk0:
-> psk, e
<- e, ee, s, es
-> s, se
2022-08-09 13:55:08 +00:00
*/
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},
},
}