idemix

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 21 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_bccsp_schemes_dlog_crypto_idemix_proto protoreflect.FileDescriptor

Functions

func SetLogger

func SetLogger(l Logger)

SetLogger sets the logger instance used for debug and error reporting. The logger reference is not mutex-protected so this must be set before calling any other library functions.

If a custom logger is not defined, the global logger from the standard library's log package is used.

Types

type CredRequest

type CredRequest struct {
	Nym         *amcl.ECP `protobuf:"bytes,1,opt,name=nym,proto3" json:"nym,omitempty"`
	IssuerNonce []byte    `protobuf:"bytes,2,opt,name=issuer_nonce,json=issuerNonce,proto3" json:"issuer_nonce,omitempty"`
	ProofC      []byte    `protobuf:"bytes,3,opt,name=proof_c,json=proofC,proto3" json:"proof_c,omitempty"`
	ProofS      []byte    `protobuf:"bytes,4,opt,name=proof_s,json=proofS,proto3" json:"proof_s,omitempty"`
	// contains filtered or unexported fields
}

CredRequest specifies a credential request object that consists of nym - a pseudonym, which is a commitment to the user secret issuer_nonce - a random nonce provided by the issuer proof_c, proof_s - a zero-knowledge proof of knowledge of the user secret inside Nym

func (*CredRequest) Check

func (m *CredRequest) Check(ipk *IssuerPublicKey, curve *math.Curve, tr Translator) error

Check cryptographically verifies the credential request

func (*CredRequest) Descriptor deprecated

func (*CredRequest) Descriptor() ([]byte, []int)

Deprecated: Use CredRequest.ProtoReflect.Descriptor instead.

func (*CredRequest) GetIssuerNonce

func (x *CredRequest) GetIssuerNonce() []byte

func (*CredRequest) GetNym

func (x *CredRequest) GetNym() *amcl.ECP

func (*CredRequest) GetProofC

func (x *CredRequest) GetProofC() []byte

func (*CredRequest) GetProofS

func (x *CredRequest) GetProofS() []byte

func (*CredRequest) ProtoMessage

func (*CredRequest) ProtoMessage()

func (*CredRequest) ProtoReflect added in v0.1.0

func (x *CredRequest) ProtoReflect() protoreflect.Message

func (*CredRequest) Reset

func (x *CredRequest) Reset()

func (*CredRequest) String

func (x *CredRequest) String() string

type Credential

type Credential struct {
	A     *amcl.ECP `protobuf:"bytes,1,opt,name=a,proto3" json:"a,omitempty"`
	B     *amcl.ECP `protobuf:"bytes,2,opt,name=b,proto3" json:"b,omitempty"`
	E     []byte    `protobuf:"bytes,3,opt,name=e,proto3" json:"e,omitempty"`
	S     []byte    `protobuf:"bytes,4,opt,name=s,proto3" json:"s,omitempty"`
	Attrs [][]byte  `protobuf:"bytes,5,rep,name=attrs,proto3" json:"attrs,omitempty"`
	// contains filtered or unexported fields
}

Credential specifies a credential object that consists of a, b, e, s - signature value attrs - attribute values

func (*Credential) Descriptor deprecated

func (*Credential) Descriptor() ([]byte, []int)

Deprecated: Use Credential.ProtoReflect.Descriptor instead.

func (*Credential) GetA

func (x *Credential) GetA() *amcl.ECP

func (*Credential) GetAttrs

func (x *Credential) GetAttrs() [][]byte

func (*Credential) GetB

func (x *Credential) GetB() *amcl.ECP

func (*Credential) GetE

func (x *Credential) GetE() []byte

func (*Credential) GetS

func (x *Credential) GetS() []byte

func (*Credential) ProtoMessage

func (*Credential) ProtoMessage()

func (*Credential) ProtoReflect added in v0.1.0

func (x *Credential) ProtoReflect() protoreflect.Message

func (*Credential) Reset

func (x *Credential) Reset()

func (*Credential) String

func (x *Credential) String() string

func (*Credential) Ver

func (cred *Credential) Ver(sk *math.Zr, ipk *IssuerPublicKey, curve *math.Curve, t Translator) error

Ver cryptographically verifies the credential by verifying the signature on the attribute values and user's secret key

type CredentialRevocationInformation

type CredentialRevocationInformation struct {

	// epoch contains the epoch (time window) in which this CRI is valid
	Epoch int64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"`
	// epoch_pk is the public key that is used by the revocation authority in this epoch
	EpochPk *amcl.ECP2 `protobuf:"bytes,2,opt,name=epoch_pk,json=epochPk,proto3" json:"epoch_pk,omitempty"`
	// epoch_pk_sig is a signature on the EpochPK valid under the revocation authority's long term key
	EpochPkSig []byte `protobuf:"bytes,3,opt,name=epoch_pk_sig,json=epochPkSig,proto3" json:"epoch_pk_sig,omitempty"`
	// revocation_alg denotes which revocation algorithm is used
	RevocationAlg int32 `protobuf:"varint,4,opt,name=revocation_alg,json=revocationAlg,proto3" json:"revocation_alg,omitempty"`
	// revocation_data contains data specific to the revocation algorithm used
	RevocationData []byte `protobuf:"bytes,5,opt,name=revocation_data,json=revocationData,proto3" json:"revocation_data,omitempty"`
	// contains filtered or unexported fields
}

func (*CredentialRevocationInformation) Descriptor deprecated

func (*CredentialRevocationInformation) Descriptor() ([]byte, []int)

Deprecated: Use CredentialRevocationInformation.ProtoReflect.Descriptor instead.

func (*CredentialRevocationInformation) GetEpoch

func (x *CredentialRevocationInformation) GetEpoch() int64

func (*CredentialRevocationInformation) GetEpochPk

func (x *CredentialRevocationInformation) GetEpochPk() *amcl.ECP2

func (*CredentialRevocationInformation) GetEpochPkSig

func (x *CredentialRevocationInformation) GetEpochPkSig() []byte

func (*CredentialRevocationInformation) GetRevocationAlg

func (x *CredentialRevocationInformation) GetRevocationAlg() int32

func (*CredentialRevocationInformation) GetRevocationData

func (x *CredentialRevocationInformation) GetRevocationData() []byte

func (*CredentialRevocationInformation) ProtoMessage

func (*CredentialRevocationInformation) ProtoMessage()

func (*CredentialRevocationInformation) ProtoReflect added in v0.1.0

func (*CredentialRevocationInformation) Reset

func (*CredentialRevocationInformation) String

type EIDNym

type EIDNym struct {
	Nym       *amcl.ECP `protobuf:"bytes,1,opt,name=nym,proto3" json:"nym,omitempty"`
	ProofSEid []byte    `protobuf:"bytes,2,opt,name=proof_s_eid,json=proofSEid,proto3" json:"proof_s_eid,omitempty"`
	// contains filtered or unexported fields
}

EIDNym specifies a pseudonymous enrollment id object that consists of nym - pseudonymous enrollment id s_eid - field element

func (*EIDNym) Descriptor deprecated

func (*EIDNym) Descriptor() ([]byte, []int)

Deprecated: Use EIDNym.ProtoReflect.Descriptor instead.

func (*EIDNym) GetNym

func (x *EIDNym) GetNym() *amcl.ECP

func (*EIDNym) GetProofSEid

func (x *EIDNym) GetProofSEid() []byte

func (*EIDNym) ProtoMessage

func (*EIDNym) ProtoMessage()

func (*EIDNym) ProtoReflect added in v0.1.0

func (x *EIDNym) ProtoReflect() protoreflect.Message

func (*EIDNym) Reset

func (x *EIDNym) Reset()

func (*EIDNym) String

func (x *EIDNym) String() string

type Idemix

type Idemix struct {
	Curve      *math.Curve
	Translator Translator
}

func (*Idemix) CreateCRI

func (i *Idemix) CreateCRI(key *ecdsa.PrivateKey, unrevokedHandles []*math.Zr, epoch int, alg RevocationAlgorithm, rng io.Reader, t Translator) (*CredentialRevocationInformation, error)

CreateCRI creates the Credential Revocation Information for a certain time period (epoch). Users can use the CRI to prove that they are not revoked. Note that when not using revocation (i.e., alg = ALG_NO_REVOCATION), the entered unrevokedHandles are not used, and the resulting CRI can be used by any signer.

func (*Idemix) GenerateLongTermRevocationKey

func (i *Idemix) GenerateLongTermRevocationKey() (*ecdsa.PrivateKey, error)

GenerateLongTermRevocationKey generates a long term signing key that will be used for revocation

func (*Idemix) LongTermRevocationKeyFromBytes

func (i *Idemix) LongTermRevocationKeyFromBytes(raw []byte) (*ecdsa.PrivateKey, error)

GenerateLongTermRevocationKey generates a long term signing key that will be used for revocation

func (*Idemix) MakeNym

func (i *Idemix) MakeNym(sk *math.Zr, IPk *IssuerPublicKey, rng io.Reader, t Translator) (*math.G1, *math.Zr, error)

MakeNym creates a new unlinkable pseudonym

func (*Idemix) MakeNymFromBytes

func (i *Idemix) MakeNymFromBytes(raw []byte) (*math.G1, *math.Zr, error)

func (*Idemix) NewCredRequest

func (i *Idemix) NewCredRequest(sk *math.Zr, IssuerNonce []byte, ipk *IssuerPublicKey, rng io.Reader, tr Translator) (*CredRequest, error)

NewCredRequest creates a new Credential Request, the first message of the interactive credential issuance protocol (from user to issuer)

func (*Idemix) NewCredential

func (i *Idemix) NewCredential(key *IssuerKey, m *CredRequest, attrs []*math.Zr, rng io.Reader, t Translator) (*Credential, error)

NewCredential issues a new credential, which is the last step of the interactive issuance protocol All attribute values are added by the issuer at this step and then signed together with a commitment to the user's secret key from a credential request

func (*Idemix) NewIssuerKey

func (i *Idemix) NewIssuerKey(AttributeNames []string, rng io.Reader, t Translator) (*IssuerKey, error)

NewIssuerKey creates a new issuer key pair taking an array of attribute names that will be contained in credentials certified by this issuer (a credential specification) See http://eprint.iacr.org/2016/663.pdf Sec. 4.3, for references.

func (*Idemix) NewIssuerKeyFromBytes

func (i *Idemix) NewIssuerKeyFromBytes(raw []byte) (*IssuerKey, error)

func (*Idemix) NewNymSignature

func (i *Idemix) NewNymSignature(sk *math.Zr, Nym *math.G1, RNym *math.Zr, ipk *IssuerPublicKey, msg []byte, rng io.Reader, tr Translator) (*NymSignature, error)

NewSignature creates a new idemix pseudonym signature

func (*Idemix) NewSignature

func (i *Idemix) NewSignature(
	cred *Credential,
	sk *math.Zr,
	Nym *math.G1,
	RNym *math.Zr,
	ipk *IssuerPublicKey,
	Disclosure, msg []byte,
	rhIndex, eidIndex int,
	cri *CredentialRevocationInformation,
	rng io.Reader,
	tr Translator,
	sigType opts.SignatureType,
	metadata *opts.IdemixSignerMetadata,
) (*Signature, *opts.IdemixSignerMetadata, error)

NewSignature creates a new idemix signature (Schnorr-type signature) The []byte Disclosure steers which attributes are disclosed: if Disclosure[i] == 0 then attribute i remains hidden and otherwise it is disclosed. We require the revocation handle to remain undisclosed (i.e., Disclosure[rhIndex] == 0). We use the zero-knowledge proof by http://eprint.iacr.org/2016/663.pdf, Sec. 4.5 to prove knowledge of a BBS+ signature

func (*Idemix) VerifyEpochPK

func (i *Idemix) VerifyEpochPK(pk *ecdsa.PublicKey, epochPK *amcl.ECP2, epochPkSig []byte, epoch int, alg RevocationAlgorithm) error

VerifyEpochPK verifies that the revocation PK for a certain epoch is valid, by checking that it was signed with the long term revocation key. Note that even if we use no revocation (i.e., alg = ALG_NO_REVOCATION), we need to verify the signature to make sure the issuer indeed signed that no revocation is used in this epoch.

type IssuerKey

type IssuerKey struct {
	Isk []byte           `protobuf:"bytes,1,opt,name=isk,proto3" json:"isk,omitempty"`
	Ipk *IssuerPublicKey `protobuf:"bytes,2,opt,name=ipk,proto3" json:"ipk,omitempty"`
	// contains filtered or unexported fields
}

IssuerKey specifies an issuer key pair that consists of ISk - the issuer secret key and IssuerPublicKey - the issuer public key

func (*IssuerKey) Descriptor deprecated

func (*IssuerKey) Descriptor() ([]byte, []int)

Deprecated: Use IssuerKey.ProtoReflect.Descriptor instead.

func (*IssuerKey) GetIpk

func (x *IssuerKey) GetIpk() *IssuerPublicKey

func (*IssuerKey) GetIsk

func (x *IssuerKey) GetIsk() []byte

func (*IssuerKey) ProtoMessage

func (*IssuerKey) ProtoMessage()

func (*IssuerKey) ProtoReflect added in v0.1.0

func (x *IssuerKey) ProtoReflect() protoreflect.Message

func (*IssuerKey) Reset

func (x *IssuerKey) Reset()

func (*IssuerKey) String

func (x *IssuerKey) String() string

type IssuerPublicKey

type IssuerPublicKey struct {
	AttributeNames []string    `protobuf:"bytes,1,rep,name=attribute_names,json=attributeNames,proto3" json:"attribute_names,omitempty"`
	HSk            *amcl.ECP   `protobuf:"bytes,2,opt,name=h_sk,json=hSk,proto3" json:"h_sk,omitempty"`
	HRand          *amcl.ECP   `protobuf:"bytes,3,opt,name=h_rand,json=hRand,proto3" json:"h_rand,omitempty"`
	HAttrs         []*amcl.ECP `protobuf:"bytes,4,rep,name=h_attrs,json=hAttrs,proto3" json:"h_attrs,omitempty"`
	W              *amcl.ECP2  `protobuf:"bytes,5,opt,name=w,proto3" json:"w,omitempty"`
	BarG1          *amcl.ECP   `protobuf:"bytes,6,opt,name=bar_g1,json=barG1,proto3" json:"bar_g1,omitempty"`
	BarG2          *amcl.ECP   `protobuf:"bytes,7,opt,name=bar_g2,json=barG2,proto3" json:"bar_g2,omitempty"`
	ProofC         []byte      `protobuf:"bytes,8,opt,name=proof_c,json=proofC,proto3" json:"proof_c,omitempty"`
	ProofS         []byte      `protobuf:"bytes,9,opt,name=proof_s,json=proofS,proto3" json:"proof_s,omitempty"`
	Hash           []byte      `protobuf:"bytes,10,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

IssuerPublicKey specifies an issuer public key that consists of attribute_names - a list of the attribute names of a credential issued by the issuer h_sk, h_rand, h_attrs, w, bar_g1, bar_g2 - group elements corresponding to the signing key, randomness, and attributes proof_c, proof_s compose a zero-knowledge proof of knowledge of the secret key hash is a hash of the public key appended to it

func (*IssuerPublicKey) Check

func (IPk *IssuerPublicKey) Check(curve *math.Curve, t Translator) error

Check checks that this issuer public key is valid, i.e. that all components are present and a ZK proofs verifies

func (*IssuerPublicKey) Descriptor deprecated

func (*IssuerPublicKey) Descriptor() ([]byte, []int)

Deprecated: Use IssuerPublicKey.ProtoReflect.Descriptor instead.

func (*IssuerPublicKey) GetAttributeNames

func (x *IssuerPublicKey) GetAttributeNames() []string

func (*IssuerPublicKey) GetBarG1

func (x *IssuerPublicKey) GetBarG1() *amcl.ECP

func (*IssuerPublicKey) GetBarG2

func (x *IssuerPublicKey) GetBarG2() *amcl.ECP

func (*IssuerPublicKey) GetHAttrs

func (x *IssuerPublicKey) GetHAttrs() []*amcl.ECP

func (*IssuerPublicKey) GetHRand

func (x *IssuerPublicKey) GetHRand() *amcl.ECP

func (*IssuerPublicKey) GetHSk

func (x *IssuerPublicKey) GetHSk() *amcl.ECP

func (*IssuerPublicKey) GetHash

func (x *IssuerPublicKey) GetHash() []byte

func (*IssuerPublicKey) GetProofC

func (x *IssuerPublicKey) GetProofC() []byte

func (*IssuerPublicKey) GetProofS

func (x *IssuerPublicKey) GetProofS() []byte

func (*IssuerPublicKey) GetW

func (x *IssuerPublicKey) GetW() *amcl.ECP2

func (*IssuerPublicKey) ProtoMessage

func (*IssuerPublicKey) ProtoMessage()

func (*IssuerPublicKey) ProtoReflect added in v0.1.0

func (x *IssuerPublicKey) ProtoReflect() protoreflect.Message

func (*IssuerPublicKey) Reset

func (x *IssuerPublicKey) Reset()

func (*IssuerPublicKey) SetHash

func (IPk *IssuerPublicKey) SetHash(curve *math.Curve) error

SetHash appends a hash of a serialized public key

func (*IssuerPublicKey) String

func (x *IssuerPublicKey) String() string

type LogFunc

type LogFunc func(format string, a ...any)

LogFunc is a function adapter for logging.

func (LogFunc) Printf

func (l LogFunc) Printf(format string, a ...any)

Printf is used to create a formatted string log record.

type Logger

type Logger interface {
	Printf(format string, a ...any)
}

Logger defines the contract for logging. This interface is explicitly defined to be compatible with the logger in the standard library log package.

type NonRevocationProof

type NonRevocationProof struct {
	RevocationAlg      int32  `protobuf:"varint,1,opt,name=revocation_alg,json=revocationAlg,proto3" json:"revocation_alg,omitempty"`
	NonRevocationProof []byte `protobuf:"bytes,2,opt,name=non_revocation_proof,json=nonRevocationProof,proto3" json:"non_revocation_proof,omitempty"`
	// contains filtered or unexported fields
}

NonRevocationProof contains proof that the credential is not revoked

func (*NonRevocationProof) Descriptor deprecated

func (*NonRevocationProof) Descriptor() ([]byte, []int)

Deprecated: Use NonRevocationProof.ProtoReflect.Descriptor instead.

func (*NonRevocationProof) GetNonRevocationProof

func (x *NonRevocationProof) GetNonRevocationProof() []byte

func (*NonRevocationProof) GetRevocationAlg

func (x *NonRevocationProof) GetRevocationAlg() int32

func (*NonRevocationProof) ProtoMessage

func (*NonRevocationProof) ProtoMessage()

func (*NonRevocationProof) ProtoReflect added in v0.1.0

func (x *NonRevocationProof) ProtoReflect() protoreflect.Message

func (*NonRevocationProof) Reset

func (x *NonRevocationProof) Reset()

func (*NonRevocationProof) String

func (x *NonRevocationProof) String() string

type NymEID

type NymEID []byte

func (NymEID) AuditNymEid

func (nym NymEID) AuditNymEid(
	ipk *IssuerPublicKey,
	eidAttr *math.Zr,
	eidIndex int,
	RNymEid *math.Zr,
	curve *math.Curve,
	t Translator,
) error

type NymRH added in v0.0.2

type NymRH []byte

func (NymRH) AuditNymRh added in v0.0.2

func (nym NymRH) AuditNymRh(
	ipk *IssuerPublicKey,
	rhAttr *math.Zr,
	rhIndex int,
	RNymRh *math.Zr,
	curve *math.Curve,
	t Translator,
) error

type NymSignature

type NymSignature struct {

	// proof_c is the Fiat-Shamir challenge of the ZKP
	ProofC []byte `protobuf:"bytes,1,opt,name=proof_c,json=proofC,proto3" json:"proof_c,omitempty"`
	// proof_s_sk is the s-value proving knowledge of the user secret key
	ProofSSk []byte `protobuf:"bytes,2,opt,name=proof_s_sk,json=proofSSk,proto3" json:"proof_s_sk,omitempty"`
	// proof_s_r_nym is the s-value proving knowledge of the pseudonym secret
	ProofSRNym []byte `protobuf:"bytes,3,opt,name=proof_s_r_nym,json=proofSRNym,proto3" json:"proof_s_r_nym,omitempty"`
	// nonce is a fresh nonce used for the signature
	Nonce []byte `protobuf:"bytes,4,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// contains filtered or unexported fields
}

NymSignature specifies a signature object that signs a message with respect to a pseudonym. It differs from the standard idemix.signature in the fact that the standard signature object also proves that the pseudonym is based on a secret certified by a CA (issuer), whereas NymSignature only proves that the the owner of the pseudonym signed the message

func (*NymSignature) Descriptor deprecated

func (*NymSignature) Descriptor() ([]byte, []int)

Deprecated: Use NymSignature.ProtoReflect.Descriptor instead.

func (*NymSignature) GetNonce

func (x *NymSignature) GetNonce() []byte

func (*NymSignature) GetProofC

func (x *NymSignature) GetProofC() []byte

func (*NymSignature) GetProofSRNym

func (x *NymSignature) GetProofSRNym() []byte

func (*NymSignature) GetProofSSk

func (x *NymSignature) GetProofSSk() []byte

func (*NymSignature) ProtoMessage

func (*NymSignature) ProtoMessage()

func (*NymSignature) ProtoReflect added in v0.1.0

func (x *NymSignature) ProtoReflect() protoreflect.Message

func (*NymSignature) Reset

func (x *NymSignature) Reset()

func (*NymSignature) String

func (x *NymSignature) String() string

func (*NymSignature) Ver

func (sig *NymSignature) Ver(nym *math.G1, ipk *IssuerPublicKey, msg []byte, curve *math.Curve, tr Translator) error

Ver verifies an idemix NymSignature

type RHNym added in v0.0.2

type RHNym struct {
	Nym      *amcl.ECP `protobuf:"bytes,1,opt,name=nym,proto3" json:"nym,omitempty"`
	ProofSRh []byte    `protobuf:"bytes,2,opt,name=proof_s_rh,json=proofSRh,proto3" json:"proof_s_rh,omitempty"`
	// contains filtered or unexported fields
}

RHNym specifies a pseudonymous revocation handle object that consists of nym - pseudonymous revocation handle s_rh - field element

func (*RHNym) Descriptor deprecated added in v0.0.2

func (*RHNym) Descriptor() ([]byte, []int)

Deprecated: Use RHNym.ProtoReflect.Descriptor instead.

func (*RHNym) GetNym added in v0.0.2

func (x *RHNym) GetNym() *amcl.ECP

func (*RHNym) GetProofSRh added in v0.0.2

func (x *RHNym) GetProofSRh() []byte

func (*RHNym) ProtoMessage added in v0.0.2

func (*RHNym) ProtoMessage()

func (*RHNym) ProtoReflect added in v0.1.0

func (x *RHNym) ProtoReflect() protoreflect.Message

func (*RHNym) Reset added in v0.0.2

func (x *RHNym) Reset()

func (*RHNym) String added in v0.0.2

func (x *RHNym) String() string

type RevocationAlgorithm

type RevocationAlgorithm int32
const (
	ALG_NO_REVOCATION RevocationAlgorithm = iota
)

type Signature

type Signature struct {
	APrime             *amcl.ECP           `protobuf:"bytes,1,opt,name=a_prime,json=aPrime,proto3" json:"a_prime,omitempty"`
	ABar               *amcl.ECP           `protobuf:"bytes,2,opt,name=a_bar,json=aBar,proto3" json:"a_bar,omitempty"`
	BPrime             *amcl.ECP           `protobuf:"bytes,3,opt,name=b_prime,json=bPrime,proto3" json:"b_prime,omitempty"`
	ProofC             []byte              `protobuf:"bytes,4,opt,name=proof_c,json=proofC,proto3" json:"proof_c,omitempty"`
	ProofSSk           []byte              `protobuf:"bytes,5,opt,name=proof_s_sk,json=proofSSk,proto3" json:"proof_s_sk,omitempty"`
	ProofSE            []byte              `protobuf:"bytes,6,opt,name=proof_s_e,json=proofSE,proto3" json:"proof_s_e,omitempty"`
	ProofSR2           []byte              `protobuf:"bytes,7,opt,name=proof_s_r2,json=proofSR2,proto3" json:"proof_s_r2,omitempty"`
	ProofSR3           []byte              `protobuf:"bytes,8,opt,name=proof_s_r3,json=proofSR3,proto3" json:"proof_s_r3,omitempty"`
	ProofSSPrime       []byte              `protobuf:"bytes,9,opt,name=proof_s_s_prime,json=proofSSPrime,proto3" json:"proof_s_s_prime,omitempty"`
	ProofSAttrs        [][]byte            `protobuf:"bytes,10,rep,name=proof_s_attrs,json=proofSAttrs,proto3" json:"proof_s_attrs,omitempty"`
	Nonce              []byte              `protobuf:"bytes,11,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Nym                *amcl.ECP           `protobuf:"bytes,12,opt,name=nym,proto3" json:"nym,omitempty"`
	ProofSRNym         []byte              `protobuf:"bytes,13,opt,name=proof_s_r_nym,json=proofSRNym,proto3" json:"proof_s_r_nym,omitempty"`
	RevocationEpochPk  *amcl.ECP2          `protobuf:"bytes,14,opt,name=revocation_epoch_pk,json=revocationEpochPk,proto3" json:"revocation_epoch_pk,omitempty"`
	RevocationPkSig    []byte              `protobuf:"bytes,15,opt,name=revocation_pk_sig,json=revocationPkSig,proto3" json:"revocation_pk_sig,omitempty"`
	Epoch              int64               `protobuf:"varint,16,opt,name=epoch,proto3" json:"epoch,omitempty"`
	NonRevocationProof *NonRevocationProof `protobuf:"bytes,17,opt,name=non_revocation_proof,json=nonRevocationProof,proto3" json:"non_revocation_proof,omitempty"`
	EidNym             *EIDNym             `protobuf:"bytes,18,opt,name=eid_nym,json=eidNym,proto3" json:"eid_nym,omitempty"`
	RhNym              *RHNym              `protobuf:"bytes,19,opt,name=rh_nym,json=rhNym,proto3" json:"rh_nym,omitempty"`
	// contains filtered or unexported fields
}

Signature specifies a signature object that consists of a_prime, a_bar, b_prime, proof_* - randomized credential signature values and a zero-knowledge proof of knowledge of a credential and the corresponding user secret together with the attribute values nonce - a fresh nonce used for the signature nym - a fresh pseudonym (a commitment to to the user secret)

func (*Signature) AuditNymEid

func (sig *Signature) AuditNymEid(
	ipk *IssuerPublicKey,
	eidAttr *math.Zr,
	eidIndex int,
	RNymEid *math.Zr,
	curve *math.Curve,
	t Translator,
) error

func (*Signature) AuditNymRh added in v0.0.2

func (sig *Signature) AuditNymRh(
	ipk *IssuerPublicKey,
	rhAttr *math.Zr,
	rhIndex int,
	RNymRh *math.Zr,
	curve *math.Curve,
	t Translator,
) error

func (*Signature) Descriptor deprecated

func (*Signature) Descriptor() ([]byte, []int)

Deprecated: Use Signature.ProtoReflect.Descriptor instead.

func (*Signature) GetABar

func (x *Signature) GetABar() *amcl.ECP

func (*Signature) GetAPrime

func (x *Signature) GetAPrime() *amcl.ECP

func (*Signature) GetBPrime

func (x *Signature) GetBPrime() *amcl.ECP

func (*Signature) GetEidNym

func (x *Signature) GetEidNym() *EIDNym

func (*Signature) GetEpoch

func (x *Signature) GetEpoch() int64

func (*Signature) GetNonRevocationProof

func (x *Signature) GetNonRevocationProof() *NonRevocationProof

func (*Signature) GetNonce

func (x *Signature) GetNonce() []byte

func (*Signature) GetNym

func (x *Signature) GetNym() *amcl.ECP

func (*Signature) GetProofC

func (x *Signature) GetProofC() []byte

func (*Signature) GetProofSAttrs

func (x *Signature) GetProofSAttrs() [][]byte

func (*Signature) GetProofSE

func (x *Signature) GetProofSE() []byte

func (*Signature) GetProofSR2

func (x *Signature) GetProofSR2() []byte

func (*Signature) GetProofSR3

func (x *Signature) GetProofSR3() []byte

func (*Signature) GetProofSRNym

func (x *Signature) GetProofSRNym() []byte

func (*Signature) GetProofSSPrime

func (x *Signature) GetProofSSPrime() []byte

func (*Signature) GetProofSSk

func (x *Signature) GetProofSSk() []byte

func (*Signature) GetRevocationEpochPk

func (x *Signature) GetRevocationEpochPk() *amcl.ECP2

func (*Signature) GetRevocationPkSig

func (x *Signature) GetRevocationPkSig() []byte

func (*Signature) GetRhNym added in v0.0.2

func (x *Signature) GetRhNym() *RHNym

func (*Signature) ProtoMessage

func (*Signature) ProtoMessage()

func (*Signature) ProtoReflect added in v0.1.0

func (x *Signature) ProtoReflect() protoreflect.Message

func (*Signature) Reset

func (x *Signature) Reset()

func (*Signature) String

func (x *Signature) String() string

func (*Signature) Ver

func (sig *Signature) Ver(
	Disclosure []byte,
	ipk *IssuerPublicKey,
	msg []byte,
	attributeValues []*math.Zr,
	rhIndex, eidIndex int,
	revPk *ecdsa.PublicKey,
	epoch int,
	curve *math.Curve,
	t Translator,
	verType opts.VerificationType,
	meta *opts.IdemixSignerMetadata,
) error

Ver verifies an idemix signature Disclosure steers which attributes it expects to be disclosed attributeValues contains the desired attribute values. This function will check that if attribute i is disclosed, the i-th attribute equals attributeValues[i].

type Translator

type Translator interface {
	G1ToProto(*math.G1) *amcl.ECP
	G1FromProto(*amcl.ECP) (*math.G1, error)
	G1FromRawBytes([]byte) (*math.G1, error)
	G2ToProto(*math.G2) *amcl.ECP2
	G2FromProto(*amcl.ECP2) (*math.G2, error)
}

Directories

Path Synopsis
translator

Jump to

Keyboard shortcuts

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