Documentation ¶
Index ¶
- Constants
- Variables
- func CryptoBox(msg, nounce, pk, sk []byte) ([]byte, error)
- func CryptoBoxOpen(box, nounce, sk, pk []byte) ([]byte, error)
- func CryptoBoxOverhead() int
- func CryptoBoxPrivKeySize() int
- func CryptoBoxPubKeySize() int
- func CryptoSignDetached(msg, sk []byte) []byte
- func CryptoSignFucky(msg, sk []byte) []byte
- func CryptoSignPrivKeySize() int
- func CryptoSignPubKeySize() int
- func CryptoSignPublicLen() int
- func CryptoSignSecretLen() int
- func CryptoSignSeedLen() int
- func CryptoVerify(smsg, pk []byte) bool
- func CryptoVerifyDetached(msg, sig, pk []byte) bool
- func CryptoVerifyFucky(msg, sig, pk []byte) bool
- func GetBoxPubkey(sk []byte) []byte
- func GetSignPubkey(sk []byte) ([]byte, error)
- func NewBoxNounce() []byte
- func NounceLen() int
- func RandBytes(size int) []byte
- type Buffer
- type CryptoConn
- func (cc *CryptoConn) Close() (err error)
- func (cc *CryptoConn) LocalAddr() net.Addr
- func (cc *CryptoConn) Read(d []byte) (n int, err error)
- func (cc *CryptoConn) RemoteAddr() net.Addr
- func (cc *CryptoConn) SetDeadline(t time.Time) (err error)
- func (cc *CryptoConn) SetReadDeadline(t time.Time) (err error)
- func (cc *CryptoConn) SetWriteDeadline(t time.Time) (err error)
- func (cc *CryptoConn) Write(d []byte) (n int, err error)
- type CryptoListener
- type CryptoStream
- type KeyPair
Constants ¶
View Source
const DefaultMTU = 512
write boxes at 512 bytes at a time
Variables ¶
View Source
var BadHandshake = errors.New("Bad handshake")
View Source
var Closed = errors.New("socket closed")
View Source
var ShortRead = errors.New("short read")
View Source
var ShortWrite = errors.New("short write")
Functions ¶
func CryptoBox ¶
encrypts a message to a user given their public key is known returns an encrypted box
func CryptoBoxOpen ¶
open an encrypted box
func CryptoBoxOverhead ¶
func CryptoBoxOverhead() int
return how many bytes overhead does CryptoBox have
func CryptoSignDetached ¶
sign data detached with secret key sk
func CryptoSignFucky ¶
sign data with secret key sk return detached sig this uses crypto_sign instead pf crypto_sign_detached
func CryptoSignPublicLen ¶
func CryptoSignPublicLen() int
func CryptoSignSecretLen ¶
func CryptoSignSecretLen() int
func CryptoSignSeedLen ¶
func CryptoSignSeedLen() int
func CryptoVerifyDetached ¶
verfiy a detached signature return true on valid otherwise false
func CryptoVerifyFucky ¶
verify a fucky detached sig
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
wrapper arround malloc/free
type CryptoConn ¶
type CryptoConn struct {
// contains filtered or unexported fields
}
func (*CryptoConn) Close ¶
func (cc *CryptoConn) Close() (err error)
func (*CryptoConn) LocalAddr ¶
func (cc *CryptoConn) LocalAddr() net.Addr
func (*CryptoConn) RemoteAddr ¶
func (cc *CryptoConn) RemoteAddr() net.Addr
func (*CryptoConn) SetDeadline ¶
func (cc *CryptoConn) SetDeadline(t time.Time) (err error)
func (*CryptoConn) SetReadDeadline ¶
func (cc *CryptoConn) SetReadDeadline(t time.Time) (err error)
func (*CryptoConn) SetWriteDeadline ¶
func (cc *CryptoConn) SetWriteDeadline(t time.Time) (err error)
type CryptoListener ¶
type CryptoListener struct {
// contains filtered or unexported fields
}
func (*CryptoListener) Accept ¶
func (cl *CryptoListener) Accept() (c net.Conn, err error)
accept inbound authenticated and trusted connections
func (*CryptoListener) Close ¶
func (cl *CryptoListener) Close() (err error)
type CryptoStream ¶
type CryptoStream struct {
// contains filtered or unexported fields
}
wrapper arround crypto_box provides an authenticated encrypted stream this is a TOY
func Client ¶
func Client(stream io.ReadWriteCloser, local_sk, remote_pk []byte) (c *CryptoStream)
create a client
func (*CryptoStream) Close ¶
func (cs *CryptoStream) Close() (err error)
func (*CryptoStream) Handshake ¶
func (cs *CryptoStream) Handshake() (err error)
initiate protocol handshake
type KeyPair ¶
type KeyPair struct {
// contains filtered or unexported fields
}
func GenBoxKeypair ¶
func GenBoxKeypair() *KeyPair
Click to show internal directories.
Click to hide internal directories.