ecpseudsys

package
v0.0.0-...-eab8366 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CA

type CA struct {
	// contains filtered or unexported fields
}

func NewCA

func NewCA(d *big.Int, caPubKey *pseudsys.PubKey, curve ec.Curve) *CA

func (*CA) GetChallenge

func (ca *CA) GetChallenge(a, b, x *ec.GroupElement) *big.Int

func (*CA) Verify

func (ca *CA) Verify(z *big.Int) (*CACert, error)

type CACert

type CACert struct {
	BlindedA *ec.GroupElement
	BlindedB *ec.GroupElement
	R        *big.Int
	S        *big.Int
}

func NewCACert

func NewCACert(blindedA, blindedB *ec.GroupElement, r, s *big.Int) *CACert

type Cred

type Cred struct {
	SmallAToGamma *ec.GroupElement
	SmallBToGamma *ec.GroupElement
	AToGamma      *ec.GroupElement
	BToGamma      *ec.GroupElement
	T1            *ecschnorr.BlindedTrans
	T2            *ecschnorr.BlindedTrans
}

func NewCred

func NewCred(aToGamma, bToGamma, AToGamma, BToGamma *ec.GroupElement,
	t1, t2 *ecschnorr.BlindedTrans) *Cred

type CredIssuer

type CredIssuer struct {
	// contains filtered or unexported fields
}

func NewCredIssuer

func NewCredIssuer(secKey *pseudsys.SecKey, curveType ec.Curve) *CredIssuer

func (*CredIssuer) GetChallenge

func (i *CredIssuer) GetChallenge(a, b, x *ec.GroupElement) *big.Int

TODO GetChallenge?

func (*CredIssuer) GetProofData

func (i *CredIssuer) GetProofData(challenge1, challenge2 *big.Int) (*big.Int, *big.Int)

func (*CredIssuer) Verify

Verifies that user knows log_a(b). Sends back proof random data (g1^r, g2^r) for both equality proofs.

type CredVerifier

type CredVerifier struct {
	// contains filtered or unexported fields
}

func NewCredVerifier

func NewCredVerifier(secKey *pseudsys.SecKey, c ec.Curve) *CredVerifier

func (*CredVerifier) GetChallenge

func (v *CredVerifier) GetChallenge(a, b, a1, b1,
	x1, x2 *ec.GroupElement) *big.Int

TODO GetChallenge?

func (*CredVerifier) Verify

func (v *CredVerifier) Verify(z *big.Int,
	credential *Cred, orgPubKeys *PubKey) bool

type Nym

type Nym struct {
	A *ec.GroupElement
	B *ec.GroupElement
}

Nym represents a pseudonym in the pseudonym system scheme.

func NewNym

func NewNym(a, b *ec.GroupElement) *Nym

type NymGenerator

type NymGenerator struct {
	// contains filtered or unexported fields
}

func NewNymGenerator

func NewNymGenerator(pubKey *pseudsys.PubKey, c ec.Curve) *NymGenerator

func (*NymGenerator) GetChallenge

func (g *NymGenerator) GetChallenge(nymA, blindedA, nymB, blindedB,
	x1, x2 *ec.GroupElement, r, s *big.Int) (*big.Int, error)

func (*NymGenerator) Verify

func (g *NymGenerator) Verify(z *big.Int) bool

TODO: store (a, b) into a database if verified

type PubKey

type PubKey struct {
	H1, H2 *ec.GroupElement
}

func GenerateKeyPair

func GenerateKeyPair(group *ec.Group) (*pseudsys.SecKey, *PubKey)

GenerateKeyPair takes EC group and constructs a public key for pseudonym system scheme in EC arithmetic.

func NewPubKey

func NewPubKey(h1, h2 *ec.GroupElement) *PubKey

Jump to

Keyboard shortcuts

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