Documentation ¶
Index ¶
- func GetAuditInfoForIssues(issues [][]byte, metadata []driver.IssueMetadata) ([][]*AuditableToken, error)
- func GetAuditInfoForTransfers(transfers [][]byte, metadata []driver.TransferMetadata, ...) ([][]*AuditableToken, [][]*AuditableToken, error)
- func InspectTokenOwner(des Deserializer, token *AuditableToken, index int) error
- type AuditableToken
- type Auditor
- func (a *Auditor) Check(tokenRequest *driver.TokenRequest, ...) error
- func (a *Auditor) CheckIssueRequests(outputsFromIssue [][]*AuditableToken, txID string) error
- func (a *Auditor) CheckTransferRequests(inputs [][]*AuditableToken, outputsFromTransfer [][]*AuditableToken, ...) error
- func (a *Auditor) Endorse(tokenRequest *driver.TokenRequest, txID string) ([]byte, error)
- func (a *Auditor) InspectInputs(inputs []*AuditableToken) error
- func (a *Auditor) InspectOutput(output *AuditableToken, index int) error
- func (a *Auditor) InspectOutputs(tokens []*AuditableToken) error
- type Deserializer
- type GetAuditInfoForIssuesFunc
- type GetAuditInfoForTransfersFunc
- type InspectTokenOwnerFunc
- type OwnerOpening
- type SigningIdentity
- type TokenDataOpening
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAuditInfoForIssues ¶
func GetAuditInfoForIssues(issues [][]byte, metadata []driver.IssueMetadata) ([][]*AuditableToken, error)
GetAuditInfoForIssues returns an array of AuditableToken for each issue action It takes a deserializer, an array of serialized issue actions and an array of issue metadata.
func GetAuditInfoForTransfers ¶
func GetAuditInfoForTransfers(transfers [][]byte, metadata []driver.TransferMetadata, inputs [][]*token.Token) ([][]*AuditableToken, [][]*AuditableToken, error)
GetAuditInfoForTransfers returns an array of AuditableToken for each transfer action. It takes a deserializer, an array of serialized transfer actions and an array of transfer metadata.
func InspectTokenOwner ¶
func InspectTokenOwner(des Deserializer, token *AuditableToken, index int) error
InspectTokenOwner verifies that the audit info matches the token owner
Types ¶
type AuditableToken ¶
type AuditableToken struct { Token *token.Token Data *TokenDataOpening Owner *OwnerOpening }
AuditableToken contains a zkat token and the information that allows an auditor to learn its content.
type Auditor ¶
type Auditor struct { // Owner Identity Deserializer Des Deserializer // Auditor's signing identity Signer SigningIdentity // Pedersen generators used to compute TokenData PedersenParams []*math.G1 // SigningIdentity parameters (e.g., pseudonym parameters) NYMParams []byte // Elliptic curve Curve *math.Curve // InspectTokenOwnerFunc is a function that inspects the owner field InspectTokenOwnerFunc InspectTokenOwnerFunc GetAuditInfoForIssuesFunc GetAuditInfoForIssuesFunc GetAuditInfoForTransfersFunc GetAuditInfoForTransfersFunc }
Auditor inspects zkat tokens and their owners.
func NewAuditor ¶
func NewAuditor(des Deserializer, pp []*math.G1, nymparams []byte, signer SigningIdentity, c *math.Curve) *Auditor
func (*Auditor) Check ¶
func (a *Auditor) Check(tokenRequest *driver.TokenRequest, tokenRequestMetadata *driver.TokenRequestMetadata, inputTokens [][]*token.Token, txID string) error
Check validates TokenRequest against TokenRequestMetadata
func (*Auditor) CheckIssueRequests ¶
func (a *Auditor) CheckIssueRequests(outputsFromIssue [][]*AuditableToken, txID string) error
CheckIssueRequests verifies that the commitments in issue outputs match the information provided in the clear.
func (*Auditor) CheckTransferRequests ¶
func (a *Auditor) CheckTransferRequests(inputs [][]*AuditableToken, outputsFromTransfer [][]*AuditableToken, txID string) error
CheckTransferRequests verifies that the commitments in transfer inputs and outputs match the information provided in the clear.
func (*Auditor) InspectInputs ¶
func (a *Auditor) InspectInputs(inputs []*AuditableToken) error
InspectInputs verifies that the commitments in an array of inputs matches the information provided in the clear.
func (*Auditor) InspectOutput ¶
func (a *Auditor) InspectOutput(output *AuditableToken, index int) error
InspectOutput verifies that the commitments in an output token of a given index match the information provided in the clear.
func (*Auditor) InspectOutputs ¶
func (a *Auditor) InspectOutputs(tokens []*AuditableToken) error
InspectOutputs verifies that the commitments in an array of outputs matches the information provided in the clear.
type Deserializer ¶
type Deserializer interface { // GetOwnerMatcher returns the owner matcher for the given audit info GetOwnerMatcher(auditInfo []byte) (driver.Matcher, error) }
Deserializer deserialize audit information
type GetAuditInfoForIssuesFunc ¶
type GetAuditInfoForIssuesFunc = func(issues [][]byte, metadata []driver.IssueMetadata) ([][]*AuditableToken, error)
GetAuditInfoForIssuesFunc models a function to get auditable tokens from issue actions
type GetAuditInfoForTransfersFunc ¶
type GetAuditInfoForTransfersFunc = func(transfers [][]byte, metadata []driver.TransferMetadata, inputs [][]*token.Token) ([][]*AuditableToken, [][]*AuditableToken, error)
GetAuditInfoForTransfersFunc models a function to get auditable tokens from transfer actions
type InspectTokenOwnerFunc ¶
type InspectTokenOwnerFunc = func(des Deserializer, token *AuditableToken, index int) error
InspectTokenOwnerFunc models a function to inspect the owner field
type OwnerOpening ¶
type OwnerOpening struct {
OwnerInfo []byte
}
OwnerOpening contains the information that allows the auditor to identify the owner.
type SigningIdentity ¶
type SigningIdentity interface { driver.SigningIdentity }
SigningIdentity models a signing identity