Documentation ¶
Overview ¶
Copyright 2009 The Go Authors. All rights reserved.
Index ¶
- Constants
- func CurrentVersion() (uint64, uint64, uint64)
- func Decrypt(name string, iv []byte, key []byte, ciphertext []byte) (plaintext []byte, err error)
- func Encrypt(name string, iv []byte, key []byte, plaintext []byte) (ciphertext []byte, err error)
- func GetPadding(pad string) (*padding, error)
- func NewByteArray(s string) []byte
- func NewCipher(alg string, key []byte) (cipher.Block, error)
- func NewECBDecrypter(b cipher.Block, iv []byte) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block, iv []byte) cipher.BlockMode
- func NewLog(id string) *logStructure
- func NewRCBCDecrypter(b cipher.Block, iv []byte) cipher.BlockMode
- func NewRCBCEncrypter(b cipher.Block, iv []byte) cipher.BlockMode
- func SetModeFuncs(name string, enc newModeEncFunc, dec newModeDecFunc)
- func SetNewCipherFunc(name string, fun newCipherFunc)
- func SetPaddingFuncs(name string, pad padFunc, remove removeFunc)
- func SetStrict(v bool)
- func StreamDecrypt(name string, iv []byte, key []byte, ciphertext io.Reader, plaintext io.Writer) error
- func StreamEncrypt(name string, iv []byte, key []byte, plaintext io.Reader, ciphertext io.Writer) error
- func Version()
- type Debug
- type DebugType
- type IByteStream
- type IEncoding
- type INtEncoding
- func (enc *INtEncoding) ReadBig() (*big.Int, error)
- func (enc *INtEncoding) ReadBinary() (b []byte, err error)
- func (enc *INtEncoding) ReadByteOrEOS() (int, error)
- func (enc *INtEncoding) ReadInteger() (string, error)
- func (enc *INtEncoding) ReadString() (string, error)
- func (enc *INtEncoding) ReadStructured() ([]byte, error)
- func (enc *INtEncoding) ReadUint64() (uint64, error)
- type IStream
- type ITcpStream
- type ITlcEncoding
- func (enc *ITlcEncoding) ReadBig() (*big.Int, error)
- func (enc *ITlcEncoding) ReadBinary() (b []byte, err error)
- func (enc *ITlcEncoding) ReadInteger() (string, error)
- func (enc *ITlcEncoding) ReadString() (string, error)
- func (enc *ITlcEncoding) ReadStructured() ([]byte, error)
- func (enc *ITlcEncoding) ReadUint64() (uint64, error)
- type Log
- type ModeParams
- type OByteStream
- type OEncoding
- type ONtEncoding
- func (enc *ONtEncoding) GetBuffer() ([]byte, error)
- func (enc *ONtEncoding) WriteBig(x *big.Int) error
- func (enc *ONtEncoding) WriteBinary(data []byte) error
- func (enc *ONtEncoding) WriteBinaryWithDelay(delay int64, data []byte) error
- func (enc *ONtEncoding) WriteInteger(str string) error
- func (enc *ONtEncoding) WriteString(str string) error
- func (enc *ONtEncoding) WriteStructured(data []byte) error
- func (enc *ONtEncoding) WriteUint64(x uint64) error
- type OStream
- type OTcpStream
- type OTlcEncoding
- func (enc *OTlcEncoding) GetBuffer() ([]byte, error)
- func (enc *OTlcEncoding) WriteBig(x *big.Int) error
- func (enc *OTlcEncoding) WriteBinary(data []byte) error
- func (enc *OTlcEncoding) WriteBinaryWithDelay(delay int64, data []byte) error
- func (enc *OTlcEncoding) WriteInteger(str string) error
- func (enc *OTlcEncoding) WriteString(str string) error
- func (enc *OTlcEncoding) WriteStructured(data []byte) error
- func (enc *OTlcEncoding) WriteUint64(x uint64) error
Constants ¶
View Source
const ( STRING = 1 INTEGER = 2 BINARY = 3 STRUCTURED = 4 TLC = 1 // type-length-content NT = 0 // null terminated MAX_UINT64 uint64 = 0xFFFFFFFFFFFFFFFF MAX_UINT64_DIV_10 uint64 = MAX_UINT64 / 10 MAX_UINT64_MOD_10 uint64 = MAX_UINT64 % 10 )
View Source
const ( DUMMY = iota SYSTEM USER )
Variables ¶
This section is empty.
Functions ¶
func CurrentVersion ¶
func GetPadding ¶
func NewByteArray ¶
func SetModeFuncs ¶
func SetModeFuncs(name string, enc newModeEncFunc, dec newModeDecFunc)
func SetNewCipherFunc ¶
func SetNewCipherFunc(name string, fun newCipherFunc)
func SetPaddingFuncs ¶
func SetPaddingFuncs(name string, pad padFunc, remove removeFunc)
func StreamDecrypt ¶
func StreamEncrypt ¶
Types ¶
type Debug ¶
type Debug interface { Printf(format string, a ...interface{}) PrintBuffer(buffer []byte, format string, a ...interface{}) }
var Default Debug
type IByteStream ¶
type IByteStream struct {
// contains filtered or unexported fields
}
func MakeIByteStream ¶
func MakeIByteStream(data []byte) *IByteStream
func (*IByteStream) ReadByte ¶
func (stream *IByteStream) ReadByte() (byte, error)
type IEncoding ¶
type IEncoding interface { ReadUint64() (uint64, error) ReadString() (string, error) ReadInteger() (string, error) ReadBig() (*big.Int, error) ReadBinary() (b []byte, err error) ReadStructured() ([]byte, error) }
func MakeByteIEncoding ¶
func MakeTcpIEncoding ¶
type INtEncoding ¶
type INtEncoding struct {
// contains filtered or unexported fields
}
func MakeINtEncoding ¶
func MakeINtEncoding(stream IStream) *INtEncoding
func (*INtEncoding) ReadBinary ¶
func (enc *INtEncoding) ReadBinary() (b []byte, err error)
func (*INtEncoding) ReadByteOrEOS ¶
func (enc *INtEncoding) ReadByteOrEOS() (int, error)
func (*INtEncoding) ReadInteger ¶
func (enc *INtEncoding) ReadInteger() (string, error)
func (*INtEncoding) ReadString ¶
func (enc *INtEncoding) ReadString() (string, error)
func (*INtEncoding) ReadStructured ¶
func (enc *INtEncoding) ReadStructured() ([]byte, error)
func (*INtEncoding) ReadUint64 ¶
func (enc *INtEncoding) ReadUint64() (uint64, error)
type ITcpStream ¶
type ITcpStream struct {
// contains filtered or unexported fields
}
func MakeITcpStream ¶
func MakeITcpStream(conn *net.TCPConn) *ITcpStream
func (*ITcpStream) ReadByte ¶
func (stream *ITcpStream) ReadByte() (byte, error)
type ITlcEncoding ¶
type ITlcEncoding struct {
// contains filtered or unexported fields
}
func MakeITlcEncoding ¶
func MakeITlcEncoding(stream IStream) *ITlcEncoding
func (*ITlcEncoding) ReadBinary ¶
func (enc *ITlcEncoding) ReadBinary() (b []byte, err error)
func (*ITlcEncoding) ReadInteger ¶
func (enc *ITlcEncoding) ReadInteger() (string, error)
func (*ITlcEncoding) ReadString ¶
func (enc *ITlcEncoding) ReadString() (string, error)
func (*ITlcEncoding) ReadStructured ¶
func (enc *ITlcEncoding) ReadStructured() ([]byte, error)
func (*ITlcEncoding) ReadUint64 ¶
func (enc *ITlcEncoding) ReadUint64() (uint64, error)
type ModeParams ¶
type ModeParams interface { }
type OByteStream ¶
type OByteStream struct {
// contains filtered or unexported fields
}
func MakeOByteStream ¶
func MakeOByteStream(size int) *OByteStream
func (*OByteStream) GetBuffer ¶
func (stream *OByteStream) GetBuffer() ([]byte, error)
func (*OByteStream) WriteByte ¶
func (stream *OByteStream) WriteByte(b byte) error
type OEncoding ¶
type OEncoding interface { WriteUint64(x uint64) error WriteString(str string) error WriteInteger(str string) error WriteBig(*big.Int) error WriteBinary(data []byte) error WriteBinaryWithDelay(delay int64, data []byte) error WriteStructured(data []byte) error GetBuffer() ([]byte, error) }
func MakeByteOEncoding ¶
func MakeTcpOEncoding ¶
type ONtEncoding ¶
type ONtEncoding struct {
// contains filtered or unexported fields
}
func MakeONtEncoding ¶
func MakeONtEncoding(stream OStream) *ONtEncoding
func (*ONtEncoding) GetBuffer ¶
func (enc *ONtEncoding) GetBuffer() ([]byte, error)
func (*ONtEncoding) WriteBinary ¶
func (enc *ONtEncoding) WriteBinary(data []byte) error
func (*ONtEncoding) WriteBinaryWithDelay ¶
func (enc *ONtEncoding) WriteBinaryWithDelay(delay int64, data []byte) error
func (*ONtEncoding) WriteInteger ¶
func (enc *ONtEncoding) WriteInteger(str string) error
func (*ONtEncoding) WriteString ¶
func (enc *ONtEncoding) WriteString(str string) error
func (*ONtEncoding) WriteStructured ¶
func (enc *ONtEncoding) WriteStructured(data []byte) error
func (*ONtEncoding) WriteUint64 ¶
func (enc *ONtEncoding) WriteUint64(x uint64) error
type OTcpStream ¶
type OTcpStream struct {
// contains filtered or unexported fields
}
func MakeOTcpStream ¶
func MakeOTcpStream(conn *net.TCPConn) *OTcpStream
func (*OTcpStream) GetBuffer ¶
func (stream *OTcpStream) GetBuffer() ([]byte, error)
func (*OTcpStream) WriteByte ¶
func (stream *OTcpStream) WriteByte(b byte) error
type OTlcEncoding ¶
type OTlcEncoding struct {
// contains filtered or unexported fields
}
func MakeOTlcEncoding ¶
func MakeOTlcEncoding(stream OStream) *OTlcEncoding
func (*OTlcEncoding) GetBuffer ¶
func (enc *OTlcEncoding) GetBuffer() ([]byte, error)
func (*OTlcEncoding) WriteBinary ¶
func (enc *OTlcEncoding) WriteBinary(data []byte) error
func (*OTlcEncoding) WriteBinaryWithDelay ¶
func (enc *OTlcEncoding) WriteBinaryWithDelay(delay int64, data []byte) error
func (*OTlcEncoding) WriteInteger ¶
func (enc *OTlcEncoding) WriteInteger(str string) error
func (*OTlcEncoding) WriteString ¶
func (enc *OTlcEncoding) WriteString(str string) error
func (*OTlcEncoding) WriteStructured ¶
func (enc *OTlcEncoding) WriteStructured(data []byte) error
func (*OTlcEncoding) WriteUint64 ¶
func (enc *OTlcEncoding) WriteUint64(x uint64) error
Click to show internal directories.
Click to hide internal directories.