Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Init ¶
func Init()
Init prepares the server to start responding to kx initiation requests. It calls regenerateEphemeral once, and then once every minute. If we fail to rotate our ephemeral key, we bring the server down.
func SetDiagnostic ¶
func SetDiagnostic(f Printable)
SetDiagnostic allows a function of the Printable type to be specified as the routine to be called for instrumentation of the kx code.
Types ¶
type KX ¶
type KX struct { Conn net.Conn MaxMessageSize uint OurPrivateKey *[sntrup4591761.PrivateKeySize]byte OurPublicKey *[sntrup4591761.PublicKeySize]byte TheirPublicKey *[sntrup4591761.PublicKeySize]byte // contains filtered or unexported fields }
KX allows two peers to derive a pair of shared keys. One peer must trigger Initiate (the client) while the other (the server) should call Init once followed by Respond for each connection.
func (*KX) Initiate ¶
Initiate performs a key exchange on behalf of a connecting client. A key exchange involves the following variables: k1, k2, k3, k4: NTRU Prime shared keys. c1, c2, c3, c4: NTRU Prime ciphertexts corresponding to k1, k2, k3, k4. From the perspective of the initiator, the process unfolds as follows:
func (*KX) Respond ¶
Respond performs a key exchange on behalf of a responding server. A key exchange involves the following variables: k1, k2, k3, k4: NTRU Prime shared keys. c1, c2, c3, c4: NTRU Prime ciphertexts corresponding to k1, k2, k3, k4. From the perspective of the responder, the process unfolds as follows:
func (*KX) SetReadDeadline ¶
func (*KX) SetWriteDeadline ¶
func (*KX) TheirIdentity ¶
func (kx *KX) TheirIdentity() interface{}