Versions in this module Expand all Collapse all v0 v0.0.2 Aug 19, 2020 v0.0.1 Aug 19, 2020 Changes in this version + const DefaultEpochLength + const XMLHeader + var DefaultKeyLengths = getAvailableKeyLengths(DefaultSystemParameters) + var DefaultSystemParameters = map[int]*SystemParameters + var ErrIncorrectAttributeSignature = errors.New("The Signature on the attributes is not correct.") + var ErrIncorrectProofOfSignatureCorrectness = errors.New("Proof of correctness on signature does not verify.") + var ErrMissingProofU = errors.New("Missing ProofU in ProofList, has a CredentialBuilder been added?") + var Logger *logrus.Logger + func GenerateKeyPair(param *SystemParameters, numAttributes int, counter uint, expiryDate time.Time) (*PrivateKey, *PublicKey, error) + func GenerateNonce() (*big.Int, error) + func GenerateRevocationKeypair(privk *PrivateKey, pubk *PublicKey) error + func GenerateSecretAttribute() (*big.Int, error) + func ParamSize(a int) int + func RepresentToPublicKey(pk *PublicKey, exps []*big.Int) (*big.Int, error) + type BaseParameters struct + LePrime uint + Lh uint + Lm uint + Ln uint + Lstatzk uint + type Bases []*big.Int + func (bl *Bases) MarshalXML(e *xml.Encoder, start xml.StartElement) error + func (bl *Bases) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type CLSignature struct + A *big.Int + E *big.Int + KeyshareP *big.Int + V *big.Int + func SignMessageBlock(sk *PrivateKey, pk *PublicKey, ms []*big.Int) (*CLSignature, error) + func (s *CLSignature) Randomize(pk *PublicKey) *CLSignature + func (s *CLSignature) Verify(pk *PublicKey, ms []*big.Int) bool + type Credential struct + Attributes []*big.Int + NonRevocationWitness *revocation.Witness + Pk *PublicKey + Signature *CLSignature + func (ic *Credential) CreateDisclosureProof(disclosedAttributes []int, nonrev bool, context, nonce1 *big.Int) (*ProofD, error) + func (ic *Credential) CreateDisclosureProofBuilder(disclosedAttributes []int, nonrev bool) (*DisclosureProofBuilder, error) + func (ic *Credential) NonrevBuildProofBuilder() (*NonRevocationProofBuilder, error) + func (ic *Credential) NonrevIndex() (int, error) + func (ic *Credential) NonrevPrepareCache() error + type CredentialBuilder struct + func NewCredentialBuilder(pk *PublicKey, context, secret *big.Int, nonce2 *big.Int) *CredentialBuilder + func NewCredentialBuilderFromString(bs string) *CredentialBuilder + func (b *CredentialBuilder) Commit(randomizers map[string]*big.Int) []*big.Int + func (b *CredentialBuilder) CommitToSecretAndProve(nonce1 *big.Int) *IssueCommitmentMessage + func (b *CredentialBuilder) ConstructCredential(msg *IssueSignatureMessage, attributes []*big.Int) (*Credential, error) + func (b *CredentialBuilder) CreateIssueCommitmentMessage(proofs ProofList) *IssueCommitmentMessage + func (b *CredentialBuilder) CreateProof(challenge *big.Int) Proof + func (b *CredentialBuilder) MergeProofPCommitment(commitment *ProofPCommitment) + func (b *CredentialBuilder) PublicKey() *PublicKey + func (b *CredentialBuilder) ToString() string + type CredentialBuilderPublic struct + Context *big.Int + Nonce2 *big.Int + Pk *PublicKey + ProofPcomm *ProofPCommitment + Secret *big.Int + SkRandomizer *big.Int + U *big.Int + UCommit *big.Int + VPrime *big.Int + VPrimeCommit *big.Int + type DerivedParameters struct + LRA uint + Le uint + LeCommit uint + LmCommit uint + LsCommit uint + Lv uint + LvCommit uint + LvPrime uint + LvPrimeCommit uint + func MakeDerivedParameters(base BaseParameters) DerivedParameters + type DisclosureProofBuilder struct + func NewDisclosureProofBuilderFromString(pb string) *DisclosureProofBuilder + func (d *DisclosureProofBuilder) Commit(randomizers map[string]*big.Int) []*big.Int + func (d *DisclosureProofBuilder) CreateProof(challenge *big.Int) Proof + func (d *DisclosureProofBuilder) MergeProofPCommitment(commitment *ProofPCommitment) + func (d *DisclosureProofBuilder) PublicKey() *PublicKey + func (d *DisclosureProofBuilder) TimestampRequestContributions() (*big.Int, []*big.Int) + func (pb *DisclosureProofBuilder) ToString() string + type DisclosureProofBuilderPublic struct + AttrRandomizers map[int]*big.Int + Attributes []*big.Int + DisclosedAttributes []int + ECommit *big.Int + NonrevBuilder *NonRevocationProofBuilder + Pk *PublicKey + RandomizedSignature *CLSignature + UndisclosedAttributes []int + VCommit *big.Int + Z *big.Int + type EpochLength int + func (el *EpochLength) MarshalXML(e *xml.Encoder, start xml.StartElement) error + func (el *EpochLength) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type IssueCommitmentMessage struct + Nonce2 *big.Int + ProofPjwt string + ProofPjwts map[string]string + Proofs ProofList + U *big.Int + type IssueSignatureMessage struct + NonRevocationWitness *revocation.Witness + Proof *ProofS + Signature *CLSignature + type Issuer struct + Context *big.Int + Pk *PublicKey + Sk *PrivateKey + func NewIssuer(sk *PrivateKey, pk *PublicKey, context *big.Int) *Issuer + func (i *Issuer) IssueSignature(U *big.Int, attributes []*big.Int, witness *revocation.Witness, ...) (*IssueSignatureMessage, error) + type NonRevocationProofBuilder struct + func (b *NonRevocationProofBuilder) Commit() ([]*big.Int, error) + func (b *NonRevocationProofBuilder) CreateProof(challenge *big.Int) *revocation.Proof + func (b *NonRevocationProofBuilder) UpdateCommit(witness *revocation.Witness) error + type PrivateKey struct + Counter uint + ECDSA string + ExpiryDate int64 + P *big.Int + PPrime *big.Int + Q *big.Int + QPrime *big.Int + XMLName xml.Name + func NewPrivateKey(p, q *big.Int, ecdsa string, counter uint, expiryDate time.Time) *PrivateKey + func NewPrivateKeyFromFile(filename string, demo bool) (*PrivateKey, error) + func NewPrivateKeyFromXML(xmlInput string, demo bool) (*PrivateKey, error) + func (privk *PrivateKey) CacheOrder() + func (privk *PrivateKey) Print() error + func (privk *PrivateKey) RevocationGenerateWitness(accumulator *revocation.Accumulator) (*revocation.Witness, error) + func (privk *PrivateKey) RevocationKey() (*revocation.PrivateKey, error) + func (privk *PrivateKey) RevocationSupported() bool + func (privk *PrivateKey) Validate() error + func (privk *PrivateKey) WriteTo(writer io.Writer) (int64, error) + func (privk *PrivateKey) WriteToFile(filename string, forceOverwrite bool) (int64, error) + type Proof interface + ChallengeContribution func(pk *PublicKey) ([]*big.Int, error) + MergeProofP func(proofP *ProofP, pk *PublicKey) + SecretKeyResponse func() *big.Int + VerifyWithChallenge func(pk *PublicKey, reconstructedChallenge *big.Int) bool + type ProofBuilder interface + Commit func(randomizers map[string]*big.Int) []*big.Int + CreateProof func(challenge *big.Int) Proof + MergeProofPCommitment func(commitment *ProofPCommitment) + PublicKey func() *PublicKey + type ProofBuilderList []ProofBuilder + func (builders ProofBuilderList) BuildDistributedProofList(challenge *big.Int, proofPs []*ProofP) (ProofList, error) + func (builders ProofBuilderList) BuildProofList(context, nonce *big.Int, issig bool) ProofList + func (builders ProofBuilderList) Challenge(context, nonce *big.Int, issig bool) *big.Int + type ProofD struct + A *big.Int + ADisclosed map[int]*big.Int + AResponses map[int]*big.Int + C *big.Int + EResponse *big.Int + NonRevocationProof *revocation.Proof + VResponse *big.Int + func (p *ProofD) Challenge() *big.Int + func (p *ProofD) ChallengeContribution(pk *PublicKey) ([]*big.Int, error) + func (p *ProofD) GetDisclosedAttributes() map[int]*big.Int + func (p *ProofD) HasNonRevocationProof() bool + func (p *ProofD) MergeProofP(proofP *ProofP, pk *PublicKey) + func (p *ProofD) SecretKeyResponse() *big.Int + func (p *ProofD) Verify(pk *PublicKey, context, nonce1 *big.Int, issig bool) bool + func (p *ProofD) VerifyWithChallenge(pk *PublicKey, reconstructedChallenge *big.Int) bool + type ProofList []Proof + func (pl *ProofList) UnmarshalJSON(bytes []byte) error + func (pl ProofList) GetFirstProofU() (*ProofU, error) + func (pl ProofList) GetProofD(n int) (*ProofD, error) + func (pl ProofList) GetProofU(n int) (*ProofU, error) + func (pl ProofList) Verify(publicKeys []*PublicKey, context, nonce *big.Int, issig bool, ...) bool + type ProofP struct + C *big.Int + P *big.Int + SResponse *big.Int + type ProofPCommitment struct + P *big.Int + Pcommit *big.Int + type ProofS struct + C *big.Int + EResponse *big.Int + func (p *ProofS) Verify(pk *PublicKey, signature *CLSignature, context, nonce *big.Int) bool + type ProofU struct + C *big.Int + SResponse *big.Int + U *big.Int + VPrimeResponse *big.Int + func (p *ProofU) Challenge() *big.Int + func (p *ProofU) ChallengeContribution(pk *PublicKey) ([]*big.Int, error) + func (p *ProofU) MergeProofP(proofP *ProofP, pk *PublicKey) + func (p *ProofU) SecretKeyResponse() *big.Int + func (p *ProofU) Verify(pk *PublicKey, context, nonce *big.Int) bool + func (p *ProofU) VerifyWithChallenge(pk *PublicKey, reconstructedChallenge *big.Int) bool + type PublicKey struct + Counter uint + ECDSA string + EpochLength EpochLength + ExpiryDate int64 + G *big.Int + H *big.Int + Issuer string + N *big.Int + Params *SystemParameters + R Bases + S *big.Int + XMLName xml.Name + Z *big.Int + func NewPublicKey(N, Z, S, G, H *big.Int, R []*big.Int, ecdsa string, counter uint, ...) *PublicKey + func NewPublicKeyFromBytes(bts []byte) (*PublicKey, error) + func NewPublicKeyFromFile(filename string) (*PublicKey, error) + func NewPublicKeyFromXML(xmlInput string) (*PublicKey, error) + func (pubk *PublicKey) Print() error + func (pubk *PublicKey) RevocationKey() (*revocation.PublicKey, error) + func (pubk *PublicKey) RevocationSupported() bool + func (pubk *PublicKey) WriteTo(writer io.Writer) (int64, error) + func (pubk *PublicKey) WriteToFile(filename string, forceOverwrite bool) (int64, error) + type SystemParameters struct