Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrEncrypt = errors.New("encrypt failure") ErrDecrypt = errors.New("decrypt failure") ErrOverflow = errors.New("message too large") ErrInvalidKx = errors.New("invalid kx") ErrMarshal = errors.New("could not marshal") ErrUnmarshal = errors.New("could not unmarshal") ErrNilTheirPubKey = errors.New("nil TheirPublicKey") )
Functions ¶
This section is empty.
Types ¶
type KX ¶
type KX struct { Conn io.ReadWriter MaxMessageSize uint OurPrivateKey *zkidentity.FixedSizeSntrupPrivateKey OurPublicKey *zkidentity.FixedSizeSntrupPublicKey TheirPublicKey *zkidentity.FixedSizeSntrupPublicKey // 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: