Documentation
¶
Overview ¶
Package secrethandshake is a Go implementation of Dominic Tarr's secret-handshake: https://github.com/auditdrivencrypto/secret-handshake
Two instances of go-shs can secretly shake hands over a connection.
The implementation is compatible with the JS implementation. Run `npm ci && go test -tags interop_nodejs`.
Index ¶
Constants ¶
const ChallengeLength = 64
ChallengeLength is the length of a challenge message in bytes
const ClientAuthLength = 16 + 32 + 64
ClientAuthLength is the length of a clientAuth message in bytes
const MACLength = 16
MACLength is the length of a MAC in bytes
const ServerAuthLength = 16 + 64
ServerAuthLength is the length of a serverAuth message in bytes
Variables ¶
var ErrInvalidKeyPair = fmt.Errorf("secrethandshake/NewKeyPair: invalid public key")
Functions ¶
Types ¶
type CurveKeyPair ¶
CurveKeyPair is a keypair for use with github.com/agl/ed25519
type EdKeyPair ¶
type EdKeyPair struct { Public ed25519.PublicKey Secret ed25519.PrivateKey }
EdKeyPair is a keypair for use with github.com/agl/ed25519
func GenEdKeyPair ¶
GenEdKeyPair generates a ed25519 keyPair using the passed reader if r == nil it uses crypto/rand.Reader
func NewKeyPair ¶ added in v1.2.0
type ErrEncoding ¶ added in v1.2.2
type ErrEncoding struct {
// contains filtered or unexported fields
}
func (ErrEncoding) Error ¶ added in v1.2.2
func (e ErrEncoding) Error() string
func (ErrEncoding) Unwrap ¶ added in v1.2.2
func (e ErrEncoding) Unwrap() error
Unwrap returns the cause
type ErrKeySize ¶ added in v1.2.2
type ErrKeySize struct {
// contains filtered or unexported fields
}
func (ErrKeySize) Error ¶ added in v1.2.2
func (eks ErrKeySize) Error() string
type ErrProcessing ¶ added in v1.2.2
type ErrProcessing struct {
// contains filtered or unexported fields
}
ErrProcessing is returned if I/O fails during the handshake TODO: supply Unwrap() for cause?
func (ErrProcessing) Error ¶ added in v1.2.2
func (e ErrProcessing) Error() string
func (ErrProcessing) Unwrap ¶ added in v1.2.2
func (e ErrProcessing) Unwrap() error
Unwrap returns the cause
type ErrProtocol ¶ added in v1.2.0
type ErrProtocol struct {
// contains filtered or unexported fields
}
func (ErrProtocol) Error ¶ added in v1.2.0
func (e ErrProtocol) Error() string
type State ¶
type State struct {
// contains filtered or unexported fields
}
State is the state each peer holds during the handshake
func NewClientState ¶
NewClientState initializes the state for the client side
func NewServerState ¶
NewServerState initializes the state for the server side
func (*State) GetBoxstreamDecKeys ¶
GetBoxstreamDecKeys returns the decryption key and nonce suitable for boxstream
func (*State) GetBoxstreamEncKeys ¶
GetBoxstreamEncKeys returns the encryption key and nonce suitable for boxstream
Directories
¶
Path | Synopsis |
---|---|
internal
|
|
extra25519
Package extra25519 implements the key conversion from ed25519 to curve25519.
|
Package extra25519 implements the key conversion from ed25519 to curve25519. |