crypto

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BBSSignFunc

type BBSSignFunc func([][]byte, interface{}) ([]byte, error)

BBSSignFunc mocks Crypto's BBSSign() function, it's useful for executing custom BBS+ signing with the help of Signing private Key.

type Crypto

type Crypto struct {
	EncryptValue             []byte
	EncryptNonceValue        []byte
	EncryptErr               error
	DecryptValue             []byte
	DecryptErr               error
	SignValue                []byte
	SignKey                  []byte
	SignFn                   SignFunc
	SignErr                  error
	VerifyErr                error
	ComputeMACValue          []byte
	ComputeMACErr            error
	VerifyMACErr             error
	WrapValue                *cryptoapi.RecipientWrappedKey
	WrapError                error
	UnwrapValue              []byte
	UnwrapError              error
	BBSSignValue             []byte
	BBSSignKey               []byte
	BBSSignFn                BBSSignFunc
	BBSSignErr               error
	BBSVerifyErr             error
	VerifyProofErr           error
	DeriveProofValue         []byte
	DeriveProofKey           []byte
	DeriveProofFn            DeriveProofFunc
	DeriveProofError         error
	BlindValue               [][]byte
	BlindError               error
	GetCorrectnessProofValue []byte
	GetCorrectnessProofError error
	SignWithSecretsValue     []byte
	SignWithSecretsProof     []byte
	SignWithSecretsError     error
}

Crypto mock.

func (*Crypto) ComputeMAC

func (c *Crypto) ComputeMAC(data []byte, kh interface{}) ([]byte, error)

ComputeMAC returns a mocked value and a mocked error.

func (*Crypto) Decrypt

func (c *Crypto) Decrypt(cipher, aad, nonce []byte, kh interface{}) ([]byte, error)

Decrypt returns a mocked value and a mocked error.

func (*Crypto) DeriveProof

func (c *Crypto) DeriveProof(messages [][]byte, bbsSignature, nonce []byte, revealedIndexes []int,
	signerPubKH interface{}) ([]byte, error)

DeriveProof returns a mocked BBS+ signature proof value and a mocked error. returns:

signature proof in []byte
error in case of errors

func (*Crypto) Encrypt

func (c *Crypto) Encrypt(msg, aad []byte, kh interface{}) ([]byte, []byte, error)

Encrypt returns mocked values and a mocked error.

func (*Crypto) Sign

func (c *Crypto) Sign(msg []byte, kh interface{}) ([]byte, error)

Sign returns a mocked value and a mocked error.

func (*Crypto) SignMulti

func (c *Crypto) SignMulti(messages [][]byte, kh interface{}) ([]byte, error)

SignMulti returns a mocked BBS+ signature value and a mocked error.

func (*Crypto) UnwrapKey

func (c *Crypto) UnwrapKey(recWK *cryptoapi.RecipientWrappedKey, kh interface{},
	wrapKeyOpts ...cryptoapi.WrapKeyOpts) ([]byte, error)

UnwrapKey returns a mocked value.

func (*Crypto) Verify

func (c *Crypto) Verify(signature, msg []byte, kh interface{}) error

Verify returns a mocked value.

func (*Crypto) VerifyMAC

func (c *Crypto) VerifyMAC(mac, data []byte, kh interface{}) error

VerifyMAC returns a mocked value.

func (*Crypto) VerifyMulti

func (c *Crypto) VerifyMulti(messages [][]byte, signature []byte, kh interface{}) error

VerifyMulti returns a mocked BBS+ verify result. returns:

error in case of errors or nil if signature verification was successful

func (*Crypto) VerifyProof

func (c *Crypto) VerifyProof(revealedMessages [][]byte, proof, nonce []byte, signerPubKH interface{}) error

VerifyProof returns a mocked BBS+ verify signature proof result. returns:

error in case of errors or nil if signature proof verification was successful

func (*Crypto) WrapKey

func (c *Crypto) WrapKey(cek, apu, apv []byte, recPubKey *cryptoapi.PublicKey,
	wrapKeyOpts ...cryptoapi.WrapKeyOpts) (*cryptoapi.RecipientWrappedKey, error)

WrapKey returns a mocked value.

type DeriveProofFunc

type DeriveProofFunc func([][]byte, []byte, []byte, []int, interface{}) ([]byte, error)

DeriveProofFunc mocks Crypto's DeriveProofFunc() function, it's useful for executing custom BBS+ signing with the help of Signing public Key.

type SignFunc

type SignFunc func([]byte, interface{}) ([]byte, error)

SignFunc mocks Crypto's Sign() function, it's useful for executing custom signing with the help of SignKey.

Jump to

Keyboard shortcuts

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