Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(str string) ([]byte, error)
- func Encode(bin []byte) string
- func EncodeBig(bigint *big.Int) string
- func EncodeNewHex(toEncode []byte, ctx string) string
- func EncodeUint64(i uint64) string
- func FastBase58Decoding(str string) ([]byte, error)
- func FastBase58DecodingAlphabet(str string, alphabet *Alphabet) ([]byte, error)
- func FastBase58Encoding(bin []byte) string
- func FastBase58EncodingAlphabet(bin []byte, alphabet *Alphabet) string
- func GenRandomBytes(size int) (blk []byte, err error)
- func LoadWallet(address string, key string)
- func StoreAddress(marshaled []byte)
- func VerifyAddress(a Address) bool
- func VerifyPublicSignature(pub *ecdsa.PublicKey, hashed []byte, sig []byte) bool
- type Address
- type Alphabet
- type Base58
- type DecodedHex
- type DecodingError
- type FU
- type FileUtils
- type Hashing
- type HexOperator
- func (h HexOperator) DecodeHex(hexStr string) *DecodedHex
- func (h *HexOperator) DecodeToBytes()
- func (h *HexOperator) DecodeToString()
- func (h *HexOperator) Encode()
- func (h HexOperator) EncodeHex(toHash []byte, context string) string
- func (h *HexOperator) EncodeWithPrefix()
- func (h *HexOperator) EncodeWithSuffix()
- func (h HexOperator) GetContext(context string) (uint, error)
- func (h *HexOperator) ValidateHex()
- type HexTools
- type HexWithPrefix
- type HexWithSuffix
- type Hexlified
- type LLamaKeys
- type RawAddress
- type SecureKeys
- func (s *SecureKeys) Create() *SecureKeys
- func (s SecureKeys) Decrypt(sm SecureMessage) []byte
- func (s SecureKeys) Encrypt(msg []byte) ([]byte, error)
- func (s SecureKeys) SecureSign(msg []byte) []byte
- func (s SecureKeys) SecureVerify(msg []byte, pub []byte, sig []byte) (bool, error)
- func (s SecureKeys) SendSS(msg []byte) *SecureMessage
- func (s SecureKeys) VerifySS(msg []byte) []byte
- type SecureMessage
Constants ¶
View Source
const KEYCHAINNAME = "LlamaKeysSet"
Variables ¶
View Source
var BAlphabet = NewAlphabet("123456789ABCDEFGHIJKMNOPQRSTUVWYZabcdefghijkmnopqrstuvwxyz")
BTCAlphabet is the LLX base58 alphabet.
Functions ¶
func EncodeNewHex ¶
func EncodeUint64 ¶
EncodeUint64 encodes i as a hex string with LLx prefix.
func FastBase58Decoding ¶
FastBase58Decoding decodes the base58 encoded bytes.
func FastBase58DecodingAlphabet ¶
FastBase58DecodingAlphabet decodes the base58 encoded bytes using the given b58 alphabet.
func FastBase58Encoding ¶
FastBase58Encoding encodes the passed bytes into a base58 encoded string.
func FastBase58EncodingAlphabet ¶
FastBase58EncodingAlphabet encodes the passed bytes into a base58 encoded string with the passed alphabet.
func GenRandomBytes ¶
func LoadWallet ¶
func StoreAddress ¶
func StoreAddress(marshaled []byte)
func VerifyAddress ¶
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
func UnserializeAddress ¶
type Alphabet ¶
type Alphabet struct {
// contains filtered or unexported fields
}
func NewAlphabet ¶
NewAlphabet creates a new alphabet from the passed string.
It panics if the passed string is not 58 bytes long or isn't valid ASCII.
type Base58 ¶
type Base58 struct { }
type DecodedHex ¶
func DecodeHex ¶
func DecodeHex(h string) *DecodedHex
type DecodingError ¶
type DecodingError struct {
// contains filtered or unexported fields
}
func (DecodingError) Error ¶
func (err DecodingError) Error() string
type FU ¶
func (*FU) DecodeStruct ¶
func (f *FU) DecodeStruct(i interface{}) interface{}
func (*FU) EncodeStruct ¶
func (*FU) InitEncodeDecode ¶
func (f *FU) InitEncodeDecode()
func (*FU) WriteEncodedStructToLocalFile ¶
type FileUtils ¶
type FileUtils interface { EncodeStruct(s interface{}) ([]byte, error) WriteEncodedStructToLocalFile(i interface{}, filename string) bool LoadStructFromFile(filename string) interface{} DecodeStruct(i interface{}) interface{} LoadJsonFile(filename string) []byte WriteJsonFile(filename string, data []byte) WriteNewReceiptToDisk(filename string, data []byte) }
type HexOperator ¶
type HexOperator struct {
HexTools
}
func GetEncoderDecoder ¶
func GetEncoderDecoder() *HexOperator
func (HexOperator) DecodeHex ¶
func (h HexOperator) DecodeHex(hexStr string) *DecodedHex
func (*HexOperator) DecodeToBytes ¶
func (h *HexOperator) DecodeToBytes()
func (*HexOperator) DecodeToString ¶
func (h *HexOperator) DecodeToString()
func (*HexOperator) Encode ¶
func (h *HexOperator) Encode()
func (*HexOperator) EncodeWithPrefix ¶
func (h *HexOperator) EncodeWithPrefix()
func (*HexOperator) EncodeWithSuffix ¶
func (h *HexOperator) EncodeWithSuffix()
func (HexOperator) GetContext ¶
func (h HexOperator) GetContext(context string) (uint, error)
func (*HexOperator) ValidateHex ¶
func (h *HexOperator) ValidateHex()
type HexTools ¶
type HexTools interface { Encode() EncodeWithPrefix() EncodeWithSuffix() DecodeToString() DecodeToBytes() ValidateHex() }
type HexWithPrefix ¶
type HexWithPrefix struct { Hexlified // contains filtered or unexported fields }
type HexWithSuffix ¶
type HexWithSuffix struct { Hexlified // contains filtered or unexported fields }
type LLamaKeys ¶
type LLamaKeys struct {
Keychain keychain.Keychain
}
var LK *LLamaKeys
type RawAddress ¶
type RawAddress struct { ECDSAPriv *ecdsa.PrivateKey Pub ecdsa.PublicKey Sig []byte LlxAddress string }
func (*RawAddress) GetPublic ¶
func (r *RawAddress) GetPublic() crypto.PublicKey
func (*RawAddress) SignASN ¶
func (r *RawAddress) SignASN(data []byte) []byte
func (*RawAddress) ToString ¶
func (r *RawAddress) ToString() string
type SecureKeys ¶
type SecureKeys struct { //packed private key PSK []byte //packed public key PPK []byte DK1 []byte DK2 []byte // contains filtered or unexported fields }
func (*SecureKeys) Create ¶
func (s *SecureKeys) Create() *SecureKeys
func (SecureKeys) Decrypt ¶
func (s SecureKeys) Decrypt(sm SecureMessage) []byte
func (SecureKeys) SecureSign ¶
func (s SecureKeys) SecureSign(msg []byte) []byte
func (SecureKeys) SecureVerify ¶
func (SecureKeys) SendSS ¶
func (s SecureKeys) SendSS(msg []byte) *SecureMessage
SendSS will send the public key from A to B to ack a shared secret
func (SecureKeys) VerifySS ¶
func (s SecureKeys) VerifySS(msg []byte) []byte
VerifySS check the msg from A and gets the shared secret from it
type SecureMessage ¶
type SecureMessage struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.