btd

package
v0.0.0-...-423bd50 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidMAC - the mac was invalid
	ErrInvalidMAC = errors.New("binding MAC didn't match derived MAC")
	// ErrInvalidBatchProof - the batch proof was invalid
	ErrInvalidBatchProof = errors.New("new batch proof for signed tokens is invalid")
)

Functions

func ApproveTokens

func ApproveTokens(blindedTokens []*crypto.BlindedToken, key *crypto.SigningKey) ([]*crypto.SignedToken, *crypto.BatchDLEQProof, error)

ApproveTokens applies the issuer's secret key to each token in the request. It returns an array of marshaled approved values along with a batch DLEQ proof.

func VerifyTokenRedemption

func VerifyTokenRedemption(preimage *crypto.TokenPreimage, signature *crypto.VerificationSignature, payload string, keys []*crypto.SigningKey) error

VerifyTokenRedemption checks a redemption request against the observed request data and MAC according a set of keys. keys keeps a set of private keys that are ever used to sign the token so we can rotate private key easily Returns nil on success and an error on failure.

Types

This section is empty.

Jump to

Keyboard shortcuts

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