boe

package
v0.0.0-...-3a744d8 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2019 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidParams     = errors.New("invalid params")
	ErrInitFailed        = errors.New("init failed")
	ErrReleaseFailed     = errors.New("release failed")
	ErrSignCheckFailed   = errors.New("recover pubkey failed")
	ErrHWSignFailed      = errors.New("hw sign failed")
	ErrUnknownEvent      = errors.New("unknown event")
	ErrIDNotMatch        = errors.New("id not match")
	ErrUpdateFailed      = errors.New("update failed")
	ErrUpdateAbortFailed = errors.New("update abort failed")
	ErrGetAccountFailed  = errors.New("get bind account failed")
	ErrSetAccountFailed  = errors.New("set bind account failed")
	ErrGetNextHashFailed = errors.New("get next hash failed")
	ErrGetSNFailed       = errors.New("get sn failed")
	ErrNoNeedUpdate      = errors.New("no need update")
)

Functions

func PostRecoverPubkey

func PostRecoverPubkey(boe *BoeHandle)

Types

type BoeHandle

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

func BoeGetInstance

func BoeGetInstance() *BoeHandle

func (*BoeHandle) ASyncValidateSign

func (boe *BoeHandle) ASyncValidateSign(txhash []byte, hash []byte, r []byte, s []byte, v byte) error

func (*BoeHandle) FWUpdate

func (boe *BoeHandle) FWUpdate() error

func (*BoeHandle) FWUpdateAbort

func (boe *BoeHandle) FWUpdateAbort() error

func (*BoeHandle) GetBindAccount

func (boe *BoeHandle) GetBindAccount() (string, error)

func (*BoeHandle) GetBoeId

func (boe *BoeHandle) GetBoeId() (string, error)

func (*BoeHandle) GetNextHash

func (boe *BoeHandle) GetNextHash(hash []byte) ([]byte, error)

func (*BoeHandle) GetNextHash_v2

func (boe *BoeHandle) GetNextHash_v2(hash []byte) ([]byte, error)

* New Hash algorithm, supported by boe firmware v1.0.0.2

func (*BoeHandle) GetRandom

func (boe *BoeHandle) GetRandom() []byte

func (*BoeHandle) GetVersion

func (boe *BoeHandle) GetVersion() (TVersion, error)

func (*BoeHandle) HWCheck

func (boe *BoeHandle) HWCheck() bool

func (*BoeHandle) HW_Auth_Sign

func (boe *BoeHandle) HW_Auth_Sign(random []byte) ([]byte, error)

func (*BoeHandle) HW_Auth_Verify

func (boe *BoeHandle) HW_Auth_Verify(random []byte, hid []byte, cid []byte, signature []byte) bool

func (*BoeHandle) Init

func (boe *BoeHandle) Init() error

func (*BoeHandle) RegisterRecoverPubCallback

func (boe *BoeHandle) RegisterRecoverPubCallback(call BoeRecoverPubKeyFunc)

func (*BoeHandle) Release

func (boe *BoeHandle) Release() error

func (*BoeHandle) ValidateSign

func (boe *BoeHandle) ValidateSign(hash []byte, r []byte, s []byte, v byte) ([]byte, error)

type BoeRecoverPubKeyFunc

type BoeRecoverPubKeyFunc func(RecoverPubkey, error)

type RecoverPubkey

type RecoverPubkey struct {
	TxHash []byte
	Hash   []byte
	Sig    []byte
	Pub    []byte
}

result for recover pubkey

type Release

type Release struct {
	Hv   int    `json:"hv"`
	Mv   int    `json:"mv"`
	Fv   int    `json:"fv"`
	Dv   int    `json:"dv"`
	File string `json:"file"`
	Time string `json:"time"`
}

type TVersion

type TVersion struct {
	H int
	M int
	F int
	D int
}

func (TVersion) VersionString

func (t TVersion) VersionString() string

type TaskTh

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

Jump to

Keyboard shortcuts

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