utils

package
v1.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommitmentRingSize    = 8
	CommitmentRingSizeExp = 3
	NumBase               = 5
	MaxExp                = 64
	MaxOutputCoin         = 32
	MaxInputCoin          = 32
	MaxOutputNumberParam  = 256
	RingSize              = 8
)
View Source
const (
	UnexpectedErr = iota
	InvalidOutputValue
	MarshalPaymentProofErr
	UnmarshalPaymentProofErr
	SetBytesProofErr
	EncryptOutputCoinErr
	DecryptOutputCoinErr
	DecompressTransmissionKeyErr
	VerifySerialNumberNoPrivacyProofFailedErr
	VerifyCoinCommitmentInputFailedErr
	VerifyCoinCommitmentOutputFailedErr
	VerifyAmountNoPrivacyFailedErr
	VerifyOneOutOfManyProofFailedErr
	VerifySerialNumberPrivacyProofFailedErr
	VerifyAggregatedProofFailedErr
	VerifyAggregatedProofNewFailedErr
	VerifyAmountPrivacyFailedErr
	CalInnerProductErr
	ProveSerialNumberNoPrivacyErr
	ProveOneOutOfManyErr
	ProveSerialNumberPrivacyErr
	ProveAggregatedRangeErr
	InvalidInputToSetBytesErr
	CommitNewOutputCoinNoPrivacyErr
	ConvertMultiSigToBytesErr
	SignMultiSigErr
	InvalidLengthMultiSigErr
	InvalidMultiSigErr
	InvalidPrivateKeyErr
	ParseKeyImageWithPrivateKeyErr
)

Variables

This section is empty.

Functions

func BigIntToScalar

func BigIntToScalar(bi *big.Int) *crypto.Scalar

BigIntToScalar converts a big.Int number into a crypto.Scalar.

func ConvertIntToBinary

func ConvertIntToBinary(iNum int, n int) []byte

ConvertIntToBinary represents a integer number in binary array with little endian with size n.

func ScalarToBigInt

func ScalarToBigInt(sc *crypto.Scalar) *big.Int

ScalarToBigInt converts a scalar into a big.Int.

func SliceToArray

func SliceToArray(slice []byte) [crypto.Ed25519KeySize]byte

SliceToArray copies a slice of bytes into an array of 32 bytes.

Types

type PrivacyError

type PrivacyError struct {
	Code    int
	Message string
	// contains filtered or unexported fields
}

PrivacyError represents an error for the privacy package.

func NewPrivacyErr

func NewPrivacyErr(key int, err error) *PrivacyError

NewPrivacyErr returns a PrivacyError given a key and an error.

func (PrivacyError) Error

func (e PrivacyError) Error() string

Error returns the string error message of a PrivacyError.

Jump to

Keyboard shortcuts

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