Documentation ¶
Index ¶
- Constants
- func CreateStream(keys SharedKeys, conn connection.PlainConnection) connection.PacketStream
- func Powm(base, exp, modulus *big.Int) *big.Int
- func RandomVec(count int) []byte
- type PrivateKeys
- func (p *PrivateKeys) AddRemoteKey(remote []byte, clientPacket []byte, serverPacket []byte) SharedKeys
- func (p *PrivateKeys) ClientNonce() []byte
- func (p *PrivateKeys) Prime() *big.Int
- func (p *PrivateKeys) PrivateKey() *big.Int
- func (p *PrivateKeys) PubKey() []byte
- func (p *PrivateKeys) SharedKey(publicKey string) []byte
- type SharedKeys
Constants ¶
View Source
const FOLD int = 16
View Source
const KEYP int = 13
View Source
const N int = 16
Variables ¶
This section is empty.
Functions ¶
func CreateStream ¶
func CreateStream(keys SharedKeys, conn connection.PlainConnection) connection.PacketStream
CreateStream initializes a new Shannon-encrypted PacketStream connection from the specified keys and plain connection
Types ¶
type PrivateKeys ¶
type PrivateKeys struct {
// contains filtered or unexported fields
}
func GenerateKeys ¶
func GenerateKeys() PrivateKeys
func GenerateKeysFromPrivate ¶
func GenerateKeysFromPrivate(private *big.Int, nonce []byte) PrivateKeys
func (*PrivateKeys) AddRemoteKey ¶
func (p *PrivateKeys) AddRemoteKey(remote []byte, clientPacket []byte, serverPacket []byte) SharedKeys
func (*PrivateKeys) ClientNonce ¶
func (p *PrivateKeys) ClientNonce() []byte
func (*PrivateKeys) Prime ¶
func (p *PrivateKeys) Prime() *big.Int
func (*PrivateKeys) PrivateKey ¶
func (p *PrivateKeys) PrivateKey() *big.Int
func (*PrivateKeys) PubKey ¶
func (p *PrivateKeys) PubKey() []byte
func (*PrivateKeys) SharedKey ¶
func (p *PrivateKeys) SharedKey(publicKey string) []byte
type SharedKeys ¶
type SharedKeys struct {
// contains filtered or unexported fields
}
func (*SharedKeys) Challenge ¶
func (s *SharedKeys) Challenge() []byte
Click to show internal directories.
Click to hide internal directories.