crypto

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BBSSignFunc added in v0.1.6

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
}

Crypto mock.

func (*Crypto) ComputeMAC added in v0.1.3

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 added in v0.1.6

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 added in v0.1.6

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

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

func (*Crypto) UnwrapKey added in v0.1.5

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 added in v0.1.3

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

VerifyMAC returns a mocked value.

func (*Crypto) VerifyMulti added in v0.1.6

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 added in v0.1.6

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 added in v0.1.5

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

WrapKey returns a mocked value.

type DeriveProofFunc added in v0.1.6

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 added in v0.1.4

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