package
0.0.0-20240909083627-7bb605a9eae3
Repository: https://github.com/calvindc/comm-x.git
Documentation: pkg.go.dev

# README

handshake

Decentrallized & Privacy Communication, Protocol For Handshake.

handshake protocol provide a secure-channel based on a a mutually authenticating key agreement handshake, with forward secure identity metadata. based on http://dominictarr.github.io/secret-handshake-paper/shs.pdf

the step follows: Starting keys, upon starting the handshake, the client and server know these keys: 1 Client hello

2 Server hello

Shared secret derivation

3 Client authenticate

Shared secret derivation

4 Server accept

handshake complete

# Functions

ClientHandShake client role use the cryptographic identity when hand shake.
GenerateEd25519KeyPair generates a ed25519 keyPair using the passed reader.
NewClientState initializes the state for the client side the client must know the server’s public key before connecting.
No description provided by the author
NewClientState initializes the state for the client side the server learns the client’s public key during the handshake.
PrivateKeyToCurve25519 converts an ed25519 private key into a corresponding curve25519 private key calculates a private key from a seed.
PublicKeyToCurve25519 converts an Ed25519 public key into the curve25519 public key that would be generated from the same private key.
Server shakes hands using the cryptographic identity specified in s using conn in the server role.

# Constants

ChallengeLength is the length of a challenge message in bytes.
ClientAuthLength is the length of a clientAuth message in bytes.
MACLength is the length of a MAC in bytes.
NetworkString define the network id of this protocol, can be used with newwrap to wap the underlying connection.
ServerAuthLength is the length of a serverAuth message in bytes.

# Structs

Curve25519KeyPair.
Ed25519KeyPair is a keypair implements the Ed25519 signature algorithm.
ErrProcessing is returned if I/O fails during the handshake.
PeerAddr wrapps peer's publick key and NetworkID.
PeerState define the state each peer holds during the handshark.