Documentation ¶
Overview ¶
Package ake provides high-level functions for the 3DH AKE.
Index ¶
- func KeyGen(id group.Group) (privateKey, publicKey []byte)
- type Client
- type Identities
- type Options
- type Server
- func (s *Server) ExpectedMAC() []byte
- func (s *Server) Finalize(conf *internal.Configuration, ke3 *message.KE3) bool
- func (s *Server) Response(conf *internal.Configuration, identities *Identities, ...) *message.KE2
- func (s *Server) SerializeState() []byte
- func (s *Server) SessionKey() []byte
- func (s *Server) SetState(clientMac, sessionSecret []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Ke1 []byte // contains filtered or unexported fields }
Client exposes the client's AKE functions and holds its state.
func (*Client) Finalize ¶
func (c *Client) Finalize( conf *internal.Configuration, identities *Identities, clientSecretKey *group.Scalar, serverPublicKey *group.Element, ke2 *message.KE2, ) (*message.KE3, error)
Finalize verifies and responds to KE3. If the handshake is successful, the session key is stored and this functions returns a KE3 message.
func (*Client) SessionKey ¶
SessionKey returns the secret shared session key if a previous call to Finalize() was successful.
type Identities ¶ added in v0.9.1
Identities holds the client and server identities.
func (*Identities) SetIdentities ¶ added in v0.9.1
func (id *Identities) SetIdentities(clientPublicKey *group.Element, serverPublicKey []byte) *Identities
SetIdentities sets the client and server identities to their respective public key if not set.
type Options ¶ added in v0.9.1
type Options struct { // EphemeralSecretKey: optional EphemeralSecretKey *group.Scalar // Nonce: optional Nonce []byte // NonceLength: optional NonceLength uint }
Options enables setting optional ephemeral values, which default to secure random values if not set.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server exposes the server's AKE functions and holds its state.
func (*Server) ExpectedMAC ¶
ExpectedMAC returns the expected client MAC if a previous call to Response() was successful.
func (*Server) Response ¶
func (s *Server) Response( conf *internal.Configuration, identities *Identities, serverSecretKey *group.Scalar, clientPublicKey *group.Element, ke1 *message.KE1, response *message.CredentialResponse, options Options, ) *message.KE2
Response produces a 3DH server response message.
func (*Server) SerializeState ¶
SerializeState will return a []byte containing internal state of the Server.
func (*Server) SessionKey ¶
SessionKey returns the secret shared session key if a previous call to Response() was successful.