polish

package
v2.2.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Polish

func Polish(polishCipher cipher.AEAD, chunkSize int, input []byte) ([]byte, error)

func Unpolish

func Unpolish(polishCipher cipher.AEAD, chunkSize int, input []byte) ([]byte, error)

func X963KDF

func X963KDF(sharedKeySeed []byte, ephemeralPublicKey []byte) []byte

Types

type ClientConfig

type ClientConfig interface {
	Construct() (Connection, error)
	GetChunkSize() int
}

type Connection

type Connection interface {
	Handshake(conn net.Conn) error
	Polish(input []byte) ([]byte, error)
	Unpolish(input []byte) ([]byte, error)
	GetChunkSize() int
}

func NewSilverClient

func NewSilverClient(config SilverPolishClientConfig) (Connection, error)

type CurvePoint

type CurvePoint struct {
	X *big.Int
	Y *big.Int
}

type Server

type Server interface {
	NewConnection(net.Conn) Connection
}

type ServerConfig

type ServerConfig interface {
	Construct() (Server, error)
	GetChunkSize() int
}

type SilverPolishClient

type SilverPolishClient struct {
	// contains filtered or unexported fields
}

func (SilverPolishClient) GetChunkSize

func (silver SilverPolishClient) GetChunkSize() int

func (SilverPolishClient) Handshake

func (silver SilverPolishClient) Handshake(conn net.Conn) error

func (SilverPolishClient) Polish

func (silver SilverPolishClient) Polish(input []byte) ([]byte, error)

func (SilverPolishClient) Unpolish

func (silver SilverPolishClient) Unpolish(input []byte) ([]byte, error)

type SilverPolishClientConfig

type SilverPolishClientConfig struct {
	ServerPublicKey []byte
	ChunkSize       int
}

func NewSilverClientConfig

func NewSilverClientConfig(serverConfig *SilverPolishServerConfig) (*SilverPolishClientConfig, error)

func (SilverPolishClientConfig) Construct

func (config SilverPolishClientConfig) Construct() (Connection, error)

func (SilverPolishClientConfig) GetChunkSize

func (config SilverPolishClientConfig) GetChunkSize() int

type SilverPolishServer

type SilverPolishServer struct {
	// contains filtered or unexported fields
}

func NewSilverServer

func NewSilverServer(config SilverPolishServerConfig) (SilverPolishServer, error)

func (SilverPolishServer) NewConnection

func (config SilverPolishServer) NewConnection(conn net.Conn) Connection

type SilverPolishServerConfig

type SilverPolishServerConfig struct {
	ServerPublicKey  []byte
	ServerPrivateKey []byte
	ChunkSize        int
}

func NewSilverServerConfig

func NewSilverServerConfig() (*SilverPolishServerConfig, error)

func (SilverPolishServerConfig) Construct

func (config SilverPolishServerConfig) Construct() (Server, error)

func (SilverPolishServerConfig) GetChunkSize

func (config SilverPolishServerConfig) GetChunkSize() int

type SilverPolishServerConnection

type SilverPolishServerConnection struct {
	// contains filtered or unexported fields
}

func (*SilverPolishServerConnection) GetChunkSize

func (silver *SilverPolishServerConnection) GetChunkSize() int

func (*SilverPolishServerConnection) Handshake

func (silver *SilverPolishServerConnection) Handshake(conn net.Conn) error

func (*SilverPolishServerConnection) Polish

func (silver *SilverPolishServerConnection) Polish(input []byte) ([]byte, error)

func (*SilverPolishServerConnection) Unpolish

func (silver *SilverPolishServerConnection) Unpolish(input []byte) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL