c_czero

package
v1.0.1-rc5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLICr

func CheckLICr(pkr *c_type.PKr, licr *c_type.LICr, height uint64) bool

func Combine

func Combine(l *c_type.Uint256, r *c_type.Uint256) (out c_type.Uint256)

func ConfirmOutput

func ConfirmOutput(desc *ConfirmOutputDesc) (e error)

func DecOutput

func DecOutput(desc *InfoDesc)

func FetchRootCM

func FetchRootCM(tk *c_type.Tk, til *c_type.Uint256) (root_cm c_type.Uint256)

func GenAssetCC

func GenAssetCC(desc *AssetDesc)

func GenInputProofBySk

func GenInputProofBySk(desc *InputDesc) (e error)

func GenInputSProofBySk

func GenInputSProofBySk(desc *InputSDesc) (e error)

func GenOutputProof

func GenOutputProof(desc *OutputDesc) (e error)

func IsPKValid

func IsPKValid(pk *c_type.Uint512) bool

func IsPKrValid

func IsPKrValid(pkr *c_type.PKr) bool

func Is_czero_debug

func Is_czero_debug() bool

func Pk2PKrAndLICr

func Pk2PKrAndLICr(addr *c_type.Uint512, height uint64) (pkr c_type.PKr, licr c_type.LICr, ret bool)

func PtrOfSlice

func PtrOfSlice(s []byte) *C.uchar

func SignBalance

func SignBalance(desc *c_type.BalanceDesc)

func SignPKrBySk

func SignPKrBySk(sk *c_type.Uint512, data *c_type.Uint256, pkr *c_type.PKr) (sign c_type.Uint512, e error)

func VerifyBalance

func VerifyBalance(desc *c_type.BalanceDesc) (e error)

func VerifyInput

func VerifyInput(desc *InputVerifyDesc) (e error)

func VerifyInputS

func VerifyInputS(desc *VerifyInputSDesc) (e error)

func VerifyOutput

func VerifyOutput(desc *OutputVerifyDesc) (e error)

func VerifyPKr

func VerifyPKr(data *c_type.Uint256, sign *c_type.Uint512, pkr *c_type.PKr) bool

func ZeroInit

func ZeroInit(account_dir string, netType c_type.NetType) error

func ZeroInit_NoCircuit

func ZeroInit_NoCircuit() error

func ZeroInit_OnlyInOuts

func ZeroInit_OnlyInOuts() error

Types

type AssetDesc

type AssetDesc struct {
	Asset    c_type.Asset
	Asset_cc c_type.Uint256
}

type Common

type Common struct {
	Seed     c_type.Uint256
	Hash_O   c_type.Uint256
	Currency c_type.Uint256
	C        [2]c_type.Uint256
}

type ConfirmOutputDesc

type ConfirmOutputDesc struct {
	Asset  c_type.Asset
	Memo   c_type.Uint512
	Pkr    c_type.PKr
	Rsk    c_type.Uint256
	Out_cm c_type.Uint256
}

type ConfirmPkgDesc

type ConfirmPkgDesc struct {
	Tkn_currency c_type.Uint256
	Tkn_value    c_type.Uint256
	Tkt_category c_type.Uint256
	Tkt_value    c_type.Uint256
	Memo         c_type.Uint512
	Ar_ret       c_type.Uint256
	Pkg_cm       c_type.Uint256
}

type In

type In struct {
	EText      [c_type.ETEXT_WIDTH]byte
	Commitment c_type.Uint256
	Path       [c_type.DEPTH * 32]byte
	S1         c_type.Uint256
	Index      uint32
	Currency   c_type.Uint256
	Anchor     c_type.Uint256
	Nil_ret    c_type.Uint256
	Trace_ret  c_type.Uint256
}

type InfoDesc

type InfoDesc struct {
	//---in---
	Key   c_type.Uint256
	Flag  bool
	Einfo c_type.Einfo
	//---out---
	Asset c_type.Asset
	Rsk   c_type.Uint256
	Memo  c_type.Uint512
}

type InputDesc

type InputDesc struct {
	//---in0--
	Sk c_type.Uint512
	//---in---
	Seed  c_type.Uint256
	Pkr   c_type.PKr
	RPK   c_type.Uint256
	Einfo c_type.Einfo
	//--
	Index    uint64
	Anchor   c_type.Uint256
	Position uint32
	Path     [c_type.DEPTH * 32]byte
	//---out---
	Asset_cm_ret c_type.Uint256
	Ar_ret       c_type.Uint256
	Nil_ret      c_type.Uint256
	Til_ret      c_type.Uint256
	Proof_ret    [c_type.PROOF_WIDTH]byte
}

type InputSDesc

type InputSDesc struct {
	//---in0---
	Sk c_type.Uint512
	//---in---
	Ehash  c_type.Uint256
	Seed   c_type.Uint256
	Pkr    c_type.PKr
	RootCM c_type.Uint256
	//---out---
	Nil_ret  c_type.Uint256
	Til_ret  c_type.Uint256
	Sign_ret c_type.Uint512
}

type InputVerifyDesc

type InputVerifyDesc struct {
	AssetCM c_type.Uint256
	Anchor  c_type.Uint256
	Nil     c_type.Uint256
	Proof   c_type.Proof
}

type Out

type Out struct {
	Addr           c_type.Uint512
	Value          c_type.Uint256 //U256
	Info           c_type.Uint512
	EText_ret      [c_type.ETEXT_WIDTH]byte
	Currency       c_type.Uint256
	Commitment_ret c_type.Uint256
}

type OutputDesc

type OutputDesc struct {
	//---in---
	Tkn_currency c_type.Uint256
	Tkn_value    c_type.Uint256
	Tkt_category c_type.Uint256
	Tkt_value    c_type.Uint256
	Memo         c_type.Uint512
	Pkr          c_type.PKr
	Height       uint64
	//---out---
	Asset_cm_ret c_type.Uint256
	Ar_ret       c_type.Uint256
	Key_ret      c_type.Uint256
	Out_cm_ret   c_type.Uint256
	Einfo_ret    c_type.Einfo
	RPK_ret      c_type.Uint256
	Proof_ret    c_type.Proof
}

type OutputVerifyDesc

type OutputVerifyDesc struct {
	AssetCM c_type.Uint256
	OutCM   c_type.Uint256
	RPK     c_type.Uint256
	Proof   c_type.Proof
	Height  uint64
}

type VerifyInputSDesc

type VerifyInputSDesc struct {
	//---in---
	Ehash  c_type.Uint256
	RootCM c_type.Uint256
	Pkr    c_type.PKr
	Nil    c_type.Uint256
	Sign   c_type.Uint512
}

Jump to

Keyboard shortcuts

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