mock

package
v2.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Overview

Package mock defines mocks for protocol testing

Index

Constants

View Source
const MockRecipientKeyID = "123456789"

MockRecipientKeyID is mocked key id for recipient

Variables

This section is empty.

Functions

func PrepareAuthInputs

func PrepareAuthInputs(hash []byte, _ *w3c.DID, _ circuits.CircuitID) ([]byte, error)

PrepareAuthInputs returns mocked inputs for auth circuit

func ResolveEncPrivateKey

func ResolveEncPrivateKey(keyID string) (interface{}, error)

ResolveEncPrivateKey returns mocked private key

func ResolveKeyID

func ResolveKeyID(keyID string) (jose.JSONWebKey, error)

ResolveKeyID returns mocked public key for any key ID

func VerifyState

func VerifyState(_ circuits.CircuitID, _ []string) error

VerifyState return no error always

Types

type ProvingMethodGroth16AuthV2

type ProvingMethodGroth16AuthV2 struct {
	jwz.ProvingMethodAlg
}

ProvingMethodGroth16AuthV2 proving method to avoid using of proving key and wasm files

func (*ProvingMethodGroth16AuthV2) Alg

Alg returns current zk alg

func (*ProvingMethodGroth16AuthV2) CircuitID

func (m *ProvingMethodGroth16AuthV2) CircuitID() string

CircuitID returns name of circuit

func (*ProvingMethodGroth16AuthV2) Prove

func (m *ProvingMethodGroth16AuthV2) Prove(_, _, _ []byte) (*types.ZKProof, error)

Prove generates proof using auth circuit and groth16 alg, checks that proven message hash is set as a part of circuit specific inputs

func (*ProvingMethodGroth16AuthV2) Verify

func (m *ProvingMethodGroth16AuthV2) Verify(_ []byte, _ *types.ZKProof, _ []byte) error

Verify return no error for any proof

Jump to

Keyboard shortcuts

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