Documentation ¶
Overview ¶
Package utils implements a few utilities for repbin commands
Index ¶
- Constants
- Variables
- func B58decode(b string) []byte
- func B58encode(b []byte) string
- func DecodeEmbedded(d []byte) (k1, k2 *message.Curve25519Key)
- func DecodeRepostHeader(d []byte) (padkey *[message.PadKeySize]byte, minDelay uint32, maxDelay uint32)
- func DecodeUInt64(i []byte) uint64
- func EncodeEmbedded(k1, k2 *message.Curve25519Key) (ret []byte)
- func EncodeRepostHeader(padkey *[message.PadKeySize]byte, minDelay uint32, maxDelay uint32) (ret [RepostHeaderSize]byte)
- func EncodeUInt64(i uint64) []byte
- func MakeDirMany(dir ...string) error
- func MaxRead(n int64, r io.Reader) ([]byte, error)
- func MaxReadFile(n int64, filename string) ([]byte, error)
- func MaxStdinRead(n int64) ([]byte, error)
- func OpenRandomFile(dirname string) (*os.File, error)
- func OverWriteFile(f string, b []byte) error
- func ParseKeyPair(str string) (k1, k2 *message.Curve25519Key)
- func PermString(input []string) (permutation []string)
- func RandomUInt64() []byte
- func ReadRandomFile(dirname string, n int64) ([]byte, string, error)
- func STM(minDelay, maxDelay int) int64
- func VerifyListContent(d []byte) error
- func WriteNewFile(f string, b []byte) error
- func WriteStdout(b []byte) error
Constants ¶
const RepostHeaderSize = message.PadKeySize + 4 + 4
RepostHeaderSize is the length of the repost header containg repad key, min-delay and max-delay setting
const Version = "0.0.1 very alpha"
Version of this release
Variables ¶
var ( // ErrMaxBytes is returned if too many bytes are available ErrMaxBytes = errors.New("utils: Too many bytes") // ErrNoFiles is returned if no files could be found ErrNoFiles = errors.New("utils: No files found") )
var ( // ErrNoList is returned if list verification failed ErrNoList = errors.New("utils: No list") )
var RunPeriod = int64(300) // 5min
RunPeriod is the period in which the STM delivery is started
Functions ¶
func DecodeEmbedded ¶
func DecodeEmbedded(d []byte) (k1, k2 *message.Curve25519Key)
DecodeEmbedded decodes an embedded reply public key pair
func DecodeRepostHeader ¶
func DecodeRepostHeader(d []byte) (padkey *[message.PadKeySize]byte, minDelay uint32, maxDelay uint32)
DecodeRepostHeader decoes a repost header
func DecodeUInt64 ¶
DecodeUInt64 does a safe decode of byte[] to uint64
func EncodeEmbedded ¶
func EncodeEmbedded(k1, k2 *message.Curve25519Key) (ret []byte)
EncodeEmbedded converts two public keys into a byte slice
func EncodeRepostHeader ¶
func EncodeRepostHeader(padkey *[message.PadKeySize]byte, minDelay uint32, maxDelay uint32) (ret [RepostHeaderSize]byte)
EncodeRepostHeader encodes the padkey, mindelay and maxdelay into a byte array
func MaxReadFile ¶
MaxReadFile reads a file into []byte
func MaxStdinRead ¶
MaxStdinRead reads n bytes from stdin. If more bytes are available, return ErrMaxBytes
func OpenRandomFile ¶
OpenRandomFile opens a random file from dirname
func OverWriteFile ¶
OverWriteFile overwrites an existing file
func ParseKeyPair ¶
func ParseKeyPair(str string) (k1, k2 *message.Curve25519Key)
ParseKeyPair parses a public key pair as given on commandline
func PermString ¶
PermString permutates a slice of strings
func ReadRandomFile ¶
ReadRandomFile reads a random file from dirname and deletes it
func VerifyListContent ¶
VerifyListContent verifies that data is in list format
func WriteNewFile ¶
WriteNewFile writes b to f IF f does not exist
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package keyauth provides very simple knowledge proof for curve25519 private key belonging to shared public key
|
Package keyauth provides very simple knowledge proof for curve25519 private key belonging to shared public key |
Package keyproof implements a simple authentication system based on ed25519 signatures Alice sends a token to Bob that authenticates Alice to Bob and contains time information Bob then verifies and counter-signs the token and sends it back to Alice Alice verifies the original token, the counter-signature and the timing information and grants access or denies it
|
Package keyproof implements a simple authentication system based on ed25519 signatures Alice sends a token to Bob that authenticates Alice to Bob and contains time information Bob then verifies and counter-signs the token and sends it back to Alice Alice verifies the original token, the counter-signature and the timing information and grants access or denies it |
structs
Package structs implements types used in list exchange and storage on the server
|
Package structs implements types used in list exchange and storage on the server |