c_superzk

package
v0.0.0-...-93382e6 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearFlag

func ClearFlag(ret []byte, bytes []byte)

func ClearNil

func ClearNil(pkr *c_type.Uint256) (ret *c_type.Uint256)

func ClearPK

func ClearPK(pkr *c_type.Uint512) (ret *c_type.Uint512)

func ClearPKr

func ClearPKr(pkr *c_type.PKr) (ret *c_type.PKr)

func ClearSk

func ClearSk(sk *c_type.Uint512) (ret *c_type.Uint512)

func ClearTk

func ClearTk(tk *c_type.Tk) (ret *c_type.Tk)

func Combine

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

func Czero_PK2PKr

func Czero_PK2PKr(pk *c_type.Uint512, r *c_type.Uint256) (pkr c_type.PKr, e error)

func Czero_Seed2Sk

func Czero_Seed2Sk(seed *c_type.Uint256) (sk c_type.Uint512)

func Czero_Tk2Pk

func Czero_Tk2Pk(tk *c_type.Tk) (pk c_type.Uint512, e error)

func Czero_combine

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

func Czero_decEInfo

func Czero_decEInfo(key *c_type.Uint256, flag bool, einfo *c_type.Einfo) (asset c_type.Asset, rsk c_type.Uint256, memo c_type.Uint512, e error)

func Czero_fetchKey

func Czero_fetchKey(tk *c_type.Tk, rpk *c_type.Uint256) (key c_type.Uint256, flag bool, e error)

func Czero_fetchRootCM

func Czero_fetchRootCM(tk *c_type.Tk, til *c_type.Uint256) (root_cm c_type.Uint256, e error)

func Czero_genNil

func Czero_genNil(sk *c_type.Uint512, root_cm *c_type.Uint256) (nl c_type.Uint256, e error)

func Czero_genOutCM

func Czero_genOutCM(asset *c_type.Asset, memo *c_type.Uint512, pkr *c_type.PKr, rsk *c_type.Uint256) (out_cm c_type.Uint256, e error)

func Czero_genRootCM

func Czero_genRootCM(index uint64, out_cm *c_type.Uint256) (cm c_type.Uint256)

func Czero_genTrace

func Czero_genTrace(tk *c_type.Tk, root_cm *c_type.Uint256) (trace c_type.Uint256, e error)

func Czero_isMyPKr

func Czero_isMyPKr(tk *c_type.Tk, pkr *c_type.PKr) (e error)

func Czero_isPKValid

func Czero_isPKValid(pk *c_type.Uint512) bool

func Czero_isPKrValid

func Czero_isPKrValid(pkr *c_type.PKr) bool

func Czero_sk2Tk

func Czero_sk2Tk(sk *c_type.Uint512) (tk c_type.Tk, e error)

func DecEInfo

func DecEInfo(key *c_type.Uint256, einfo *c_type.Einfo) (asset c_type.Asset, memo c_type.Uint512, ar c_type.Uint256, e error)

func DecOutput

func DecOutput(desc *DecInfoDesc) (e error)

func EncInfo

func EncInfo(key *c_type.Uint256, asset *c_type.Asset, memo *c_type.Uint512, ar *c_type.Uint256) (einfo c_type.Einfo, e error)

func EncOutput

func EncOutput(desc *EncInfoDesc) (e error)

func FetchKey

func FetchKey(pkr *c_type.PKr, tk *c_type.Tk, rpk *c_type.Uint256) (key c_type.Uint256, vskr c_type.Uint256, e error)

func FetchRootCM

func FetchRootCM(tk *c_type.Tk, nl *c_type.Uint256, baser *c_type.Uint256) (root_cm c_type.Uint256, e error)

func ForceFr

func ForceFr(data *c_type.Uint256) (ret c_type.Uint256)

func GenAssetCC

func GenAssetCC(asset *c_type.Asset) (cc c_type.Uint256, e error)

func GenAssetCM

func GenAssetCM(desc *AssetDesc) (e error)

func GenAssetCM_PC

func GenAssetCM_PC(asset *c_type.Asset, ar *c_type.Uint256) (cm c_type.Uint256, cc c_type.Uint256, e error)

func GenKey

func GenKey(pkr *c_type.PKr) (key c_type.Uint256, rpk c_type.Uint256, rsk c_type.Uint256, e error)

func GenNil

func GenNil(tk *c_type.Tk, root_cm *c_type.Uint256, pkr *c_type.PKr) (nil c_type.Uint256, e error)

func GenRootCM_C

func GenRootCM_C(
	index uint64,
	asset_cm *c_type.Uint256,
	pkr *c_type.PKr,
) (cm c_type.Uint256, e error)

func GenRootCM_P

func GenRootCM_P(
	index uint64,
	asset *c_type.Asset,
	ar *c_type.Uint256,
	pkr *c_type.PKr,
) (cm c_type.Uint256, e error)

func GenZPKa

func GenZPKa(pkr *c_type.PKr, a *c_type.Uint256) (zpka c_type.Uint256, e error)

func HashPKr

func HashPKr(pkr *c_type.PKr) (ret [20]byte)

func InitParams

func InitParams()

func InitParams_NoCircuit

func InitParams_NoCircuit()

func IsFlagSet

func IsFlagSet(bytes []byte) bool

func IsMyPKr

func IsMyPKr(tk *c_type.Tk, pkr *c_type.PKr) bool

func IsPKValid

func IsPKValid(pk *c_type.Uint512) bool

func IsPKrValid

func IsPKrValid(pkr *c_type.PKr) bool

func IsSzkNil

func IsSzkNil(nil *c_type.Uint256) bool

func IsSzkPK

func IsSzkPK(pk *c_type.Uint512) bool

func IsSzkPKr

func IsSzkPKr(pkr *c_type.PKr) bool

func IsSzkSk

func IsSzkSk(sk *c_type.Uint512) bool

func IsSzkTk

func IsSzkTk(pk *c_type.Tk) bool

func IsTknValid

func IsTknValid(currency *c_type.Uint256) (e error)

func IsTktValid

func IsTktValid(category *c_type.Uint256, value *c_type.Uint256) (e error)

func Is_czero_debug

func Is_czero_debug() bool

func Pk2PKr

func Pk2PKr(addr *c_type.Uint512, r *c_type.Uint256) (pkr c_type.PKr, e error)

func PkrCrypte

func PkrCrypte(data *c_type.Uint256, myPKr *c_type.PKr, myTk *c_type.Tk, youPKr *c_type.PKr) (dataEnc c_type.Uint256, e error)

func ProveInput

func ProveInput(
	asset_cm_new *c_type.Uint256,
	zpka *c_type.Uint256,
	nil *c_type.Uint256,
	anchor *c_type.Uint256,
	asset_cc *c_type.Uint256,
	ar_old *c_type.Uint256,
	ar_new *c_type.Uint256,
	index uint64,
	zpkr *c_type.Uint256,
	vskr *c_type.Uint256,
	baser *c_type.Uint256,
	a *c_type.Uint256,
	paths *[c_type.DEPTH * 32]byte,
	pos uint64,
) (proof c_type.Proof, e error)

func ProveOutput

func ProveOutput(
	asset *c_type.Asset,
	ar *c_type.Uint256,
	asset_cm *c_type.Uint256,
	isEx bool,
) (proof c_type.Proof, e error)

func PtrOfSlice

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

func RandomFr

func RandomFr() (ret c_type.Uint256)

func RandomPt

func RandomPt() (ret c_type.Uint256)

func Seed2Sk

func Seed2Sk(seed *c_type.Uint256) (sk c_type.Uint512)

func SetFlag

func SetFlag(bytes []byte)

func SignBalance

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

func SignNil

func SignNil(tk *c_type.Tk, hash *c_type.Uint256, root_cm *c_type.Uint256, pkr *c_type.PKr) (sign c_type.SignN, e error)

func SignNil_P0

func SignNil_P0(h *c_type.Uint256, sk *c_type.Uint512, pkr *c_type.PKr, root_cm *c_type.Uint256) (sign c_type.SignN, e error)

func SignPKr_P

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

func SignPKr_P0

func SignPKr_P0(h *c_type.Uint256, sk *c_type.Uint512, pkr *c_type.PKr) (sign c_type.Uint512, e error)

func SignPKr_X

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

func SignZPKa

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

func Sk2Tk

func Sk2Tk(sk *c_type.Uint512) (tk c_type.Tk, e error)

func Tk2Pk

func Tk2Pk(tk *c_type.Tk) (pk c_type.Uint512, e error)

func VerifyBalance

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

func VerifyInput

func VerifyInput(
	proof *c_type.Proof,
	asset_cm_new *c_type.Uint256,
	zpka *c_type.Uint256,
	nil *c_type.Uint256,
	anchor *c_type.Uint256,
) (e error)

func VerifyNil

func VerifyNil(hash *c_type.Uint256, sign *c_type.SignN, nl *c_type.Uint256, root_cm *c_type.Uint256, pkr *c_type.PKr) error

func VerifyNil_P0

func VerifyNil_P0(h *c_type.Uint256, sign *c_type.SignN, pkr *c_type.PKr, root_cm *c_type.Uint256, nl *c_type.Uint256) (e error)

func VerifyOutput

func VerifyOutput(asset_cm *c_type.Uint256, proof *c_type.Proof, isEx bool) (e error)

func VerifyPKr_P

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

func VerifyPKr_P0

func VerifyPKr_P0(h *c_type.Uint256, sign *c_type.Uint512, pkr *c_type.PKr) (e error)

func VerifyPKr_X

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

func VerifyZPKa

func VerifyZPKa(data *c_type.Uint256, sign *c_type.Uint512, zpka *c_type.Uint256) bool

Types

type AssetDesc

type AssetDesc struct {
	Asset        c_type.Asset
	Ar           c_type.Uint256
	Asset_cc_ret c_type.Uint256
	Asset_cm_ret c_type.Uint256
}

type DecInfoDesc

type DecInfoDesc struct {
	//---in---
	Key   c_type.Uint256
	Einfo c_type.Einfo
	//---out---
	Asset_ret c_type.Asset
	Memo_ret  c_type.Uint512
	Ar_ret    c_type.Uint256
}

type EncInfoDesc

type EncInfoDesc struct {
	//---in---
	Key   c_type.Uint256
	Asset c_type.Asset
	Memo  c_type.Uint512
	Ar    c_type.Uint256
	//---out---
	Einfo c_type.Einfo
}

Jump to

Keyboard shortcuts

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