Documentation
¶
Index ¶
Constants ¶
View Source
const ( FRAG_SIZE = 16 * 1024 MAX_FRAGS = 4096 )
Variables ¶
This section is empty.
Functions ¶
func BuildHandshake ¶
BuildHandshake creates and signs a handshake payload.
func VerifyHandshake ¶
VerifyHandshake verifies peer handshake and returns peer pubkey & salt.
Types ¶
type Fragmenter ¶
type Fragmenter struct {
// contains filtered or unexported fields
}
func NewFragmenter ¶
func NewFragmenter(sess *Session) *Fragmenter
type HandshakeMsg ¶
type Reassembler ¶
type Reassembler struct {
// contains filtered or unexported fields
}
func NewReassembler ¶
func NewReassembler(sess *Session) *Reassembler
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents an established BST2 session.
func NewSession ¶
func NewSession(selfPriv *ec.PrivateKey, peerPub *ec.PublicKey, selfSalt, peerSalt []byte, logger *zap.Logger) (*Session, error)
NewSession creates session after both handshakes exchanged. If logger is nil, the function stays silent.
func (*Session) DecodeRecord ¶
DecodeRecord decrypts frame and returns plaintext.
func (*Session) EncodeRecord ¶
EncodeRecord encrypts plaintext into a BST2 frame.
Click to show internal directories.
Click to hide internal directories.