-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathoptions.go
36 lines (30 loc) · 1 KB
/
options.go
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
package wgephemeralpeer
import "net/netip"
type Option func(*ephemeralPeer)
// WithMcEliece460896Round3 uses the key encapsulation method
// McEliece460896-Round3 when negotiating a PSK for the ephemeral peer
func WithMcEliece460896Round3() Option {
return func(ep *ephemeralPeer) {
ep.kemSchemes = append(ep.kemSchemes, schemeMcEliece460896Round3)
}
}
// WithKyber1024 uses the key encapsulation method Kyber1024 when negotiating a
// PSK for the ephemeral peer
func WithKyber1024() Option {
return func(ep *ephemeralPeer) {
ep.kemSchemes = append(ep.kemSchemes, schemeKyber1024)
}
}
// WithMLKEM1024 uses the key encapsulation method ML-KEM-1024 when negotiating a
// PSK for the ephemeral peer
func WithMLKEM1024() Option {
return func(ep *ephemeralPeer) {
ep.kemSchemes = append(ep.kemSchemes, schemeMLKEM1024)
}
}
// WithAPIAddress sets the address used to connect to the gRPC API.
func WithAPIAddress(apiAddress netip.AddrPort) Option {
return func(ep *ephemeralPeer) {
ep.apiAddress = apiAddress
}
}