pseudsys

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeyPair

func GenerateKeyPair(group *schnorr.Group) (*SecKey, *PubKey)

GenerateKeyPair takes a schnorr group and constructs a pair of secret and public key for pseudonym system scheme.

Types

type CA

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

func NewCA

func NewCA(group *schnorr.Group, d *big.Int, caPubKey *PubKey) *CA

func (*CA) GetChallenge

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

func (*CA) Verify

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

type CACert

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

func NewCACert

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

type Cred

type Cred struct {
	SmallAToGamma *big.Int
	SmallBToGamma *big.Int
	AToGamma      *big.Int
	BToGamma      *big.Int
	T1            *schnorr.BlindedTrans
	T2            *schnorr.BlindedTrans
}

func NewCred

func NewCred(aToGamma, bToGamma, AToGamma, BToGamma *big.Int,
	t1, t2 *schnorr.BlindedTrans) *Cred

type CredIssuer

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

func NewCredIssuer

func NewCredIssuer(group *schnorr.Group, secKey *SecKey) *CredIssuer

func (*CredIssuer) GetChallenge

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

func (*CredIssuer) GetProofData

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

func (*CredIssuer) Verify

func (i *CredIssuer) Verify(z *big.Int) (
	*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, error)

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(group *schnorr.Group, secKey *SecKey) *CredVerifier

func (*CredVerifier) GetChallenge

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

func (*CredVerifier) Verify

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

type Nym

type Nym struct {
	A *big.Int
	B *big.Int
}

Nym represents a pseudonym in the pseudonym system scheme.

func NewNym

func NewNym(a, b *big.Int) *Nym

type NymGenerator

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

func NewNymGenerator

func NewNymGenerator(group *schnorr.Group, caPubKey *PubKey) *NymGenerator

func (*NymGenerator) GetChallenge

func (g *NymGenerator) GetChallenge(nymA, blindedA, nymB, blindedB, x1, x2,
	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 *big.Int
}

func NewPubKey

func NewPubKey(h1, h2 *big.Int) *PubKey

type SecKey

type SecKey struct {
	S1, S2 *big.Int
}

func NewSecKey

func NewSecKey(s1, s2 *big.Int) *SecKey

Jump to

Keyboard shortcuts

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