zkp

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NullifierSignalsIndex      = 0
	PkIdentityHashSignalsIndex = 1
	EventIDSignalsIndex        = 2
	EventDataSignalsIndex      = 3
)

https://github.com/iden3/circuits/blob/master/circuits/authV2.circom

Proof pub signals example with description:

21493028867609342730075626961959697053940727668683389257942040837777854978 - user did (index 0) 21493028867609342730075626961959697053940727668683389257942040837777854978 - challenge (index 1) 16285847858933578151298306208524779888950768974039235725833670860163361043104 - gistRoot (index 2)

View Source
const ChallengeExpirationDelta = 5 * time.Minute
View Source
const EventIDValue = "111186066134341633902189494613533900917417361106374681011849132651019822199"

Variables

View Source
var (
	ErrChallengeWasNotRequested = errors.New("challenge was not requested")
	ErrChallengeIsInvalid       = errors.New("challenge is already invalid")
)
View Source
var NullifierRegexp = regexp.MustCompile("^0x[0-9a-fA-F]{64}$")

Functions

This section is empty.

Types

type AuthVerifier

type AuthVerifier struct {
	VerificationKey []byte
	Disabled        bool
	// contains filtered or unexported fields
}

func (*AuthVerifier) Challenge

func (v *AuthVerifier) Challenge(user string) (string, error)

func (*AuthVerifier) VerifyProof

func (v *AuthVerifier) VerifyProof(user string, proof *zkptypes.ZKProof) (err error)

VerifyProof performs ZK Groth16 proof verification based on specified verification key and hardcoded/passed parameters.

type AuthVerifierer

type AuthVerifierer interface {
	AuthVerifier() *AuthVerifier
}

func NewAuthVerifierer

func NewAuthVerifierer(getter kv.Getter) AuthVerifierer

type Challenge

type Challenge struct {
	Value    string
	Exp      time.Time
	Verified bool
}

Jump to

Keyboard shortcuts

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