Documentation ¶
Index ¶
- Variables
- func BigToBytes(big *FP256BN.BIG) []byte
- func Ecp2FromProto(p *ECP2) *FP256BN.ECP2
- func EcpFromProto(p *ECP) *FP256BN.ECP
- func EcpToBytes(E *FP256BN.ECP) []byte
- func GenerateLongTermRevocationKey() (*ecdsa.PrivateKey, error)
- func GetRand() (*amcl.RAND, error)
- func HashModOrder(data []byte) *FP256BN.BIG
- func MakeNym(sk *FP256BN.BIG, IPk *IssuerPublicKey, rng *amcl.RAND) (*FP256BN.ECP, *FP256BN.BIG)
- func Modadd(a, b, m *FP256BN.BIG) *FP256BN.BIG
- func Modsub(a, b, m *FP256BN.BIG) *FP256BN.BIG
- func RandModOrder(rng *amcl.RAND) *FP256BN.BIG
- func VerifyEpochPK(pk *ecdsa.PublicKey, epochPK *ECP2, epochPkSig []byte, epoch int, ...) error
- func WBBKeyGen(rng *amcl.RAND) (*FP256BN.BIG, *FP256BN.ECP2)
- func WBBSign(sk *FP256BN.BIG, m *FP256BN.BIG) *FP256BN.ECP
- func WBBVerify(pk *FP256BN.ECP2, sig *FP256BN.ECP, m *FP256BN.BIG) error
- type CredRequest
- func (m *CredRequest) Check(ipk *IssuerPublicKey) error
- func (*CredRequest) Descriptor() ([]byte, []int)
- func (m *CredRequest) GetIssuerNonce() []byte
- func (m *CredRequest) GetNym() *ECP
- func (m *CredRequest) GetProofC() []byte
- func (m *CredRequest) GetProofS() []byte
- func (*CredRequest) ProtoMessage()
- func (m *CredRequest) Reset()
- func (m *CredRequest) String() string
- func (m *CredRequest) XXX_DiscardUnknown()
- func (m *CredRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *CredRequest) XXX_Merge(src proto.Message)
- func (m *CredRequest) XXX_Size() int
- func (m *CredRequest) XXX_Unmarshal(b []byte) error
- type Credential
- func (*Credential) Descriptor() ([]byte, []int)
- func (m *Credential) GetA() *ECP
- func (m *Credential) GetAttrs() [][]byte
- func (m *Credential) GetB() *ECP
- func (m *Credential) GetE() []byte
- func (m *Credential) GetS() []byte
- func (*Credential) ProtoMessage()
- func (m *Credential) Reset()
- func (m *Credential) String() string
- func (cred *Credential) Ver(sk *FP256BN.BIG, ipk *IssuerPublicKey) error
- func (m *Credential) XXX_DiscardUnknown()
- func (m *Credential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Credential) XXX_Merge(src proto.Message)
- func (m *Credential) XXX_Size() int
- func (m *Credential) XXX_Unmarshal(b []byte) error
- type CredentialRevocationInformation
- func (*CredentialRevocationInformation) Descriptor() ([]byte, []int)
- func (m *CredentialRevocationInformation) GetEpoch() int64
- func (m *CredentialRevocationInformation) GetEpochPk() *ECP2
- func (m *CredentialRevocationInformation) GetEpochPkSig() []byte
- func (m *CredentialRevocationInformation) GetRevocationAlg() int32
- func (m *CredentialRevocationInformation) GetRevocationData() []byte
- func (*CredentialRevocationInformation) ProtoMessage()
- func (m *CredentialRevocationInformation) Reset()
- func (m *CredentialRevocationInformation) String() string
- func (m *CredentialRevocationInformation) XXX_DiscardUnknown()
- func (m *CredentialRevocationInformation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *CredentialRevocationInformation) XXX_Merge(src proto.Message)
- func (m *CredentialRevocationInformation) XXX_Size() int
- func (m *CredentialRevocationInformation) XXX_Unmarshal(b []byte) error
- type ECP
- func (*ECP) Descriptor() ([]byte, []int)
- func (m *ECP) GetX() []byte
- func (m *ECP) GetY() []byte
- func (*ECP) ProtoMessage()
- func (m *ECP) Reset()
- func (m *ECP) String() string
- func (m *ECP) XXX_DiscardUnknown()
- func (m *ECP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ECP) XXX_Merge(src proto.Message)
- func (m *ECP) XXX_Size() int
- func (m *ECP) XXX_Unmarshal(b []byte) error
- type ECP2
- func (*ECP2) Descriptor() ([]byte, []int)
- func (m *ECP2) GetXa() []byte
- func (m *ECP2) GetXb() []byte
- func (m *ECP2) GetYa() []byte
- func (m *ECP2) GetYb() []byte
- func (*ECP2) ProtoMessage()
- func (m *ECP2) Reset()
- func (m *ECP2) String() string
- func (m *ECP2) XXX_DiscardUnknown()
- func (m *ECP2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ECP2) XXX_Merge(src proto.Message)
- func (m *ECP2) XXX_Size() int
- func (m *ECP2) XXX_Unmarshal(b []byte) error
- type IssuerKey
- func (*IssuerKey) Descriptor() ([]byte, []int)
- func (m *IssuerKey) GetIpk() *IssuerPublicKey
- func (m *IssuerKey) GetIsk() []byte
- func (*IssuerKey) ProtoMessage()
- func (m *IssuerKey) Reset()
- func (m *IssuerKey) String() string
- func (m *IssuerKey) XXX_DiscardUnknown()
- func (m *IssuerKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *IssuerKey) XXX_Merge(src proto.Message)
- func (m *IssuerKey) XXX_Size() int
- func (m *IssuerKey) XXX_Unmarshal(b []byte) error
- type IssuerPublicKey
- func (IPk *IssuerPublicKey) Check() error
- func (*IssuerPublicKey) Descriptor() ([]byte, []int)
- func (m *IssuerPublicKey) GetAttributeNames() []string
- func (m *IssuerPublicKey) GetBarG1() *ECP
- func (m *IssuerPublicKey) GetBarG2() *ECP
- func (m *IssuerPublicKey) GetHAttrs() []*ECP
- func (m *IssuerPublicKey) GetHRand() *ECP
- func (m *IssuerPublicKey) GetHSk() *ECP
- func (m *IssuerPublicKey) GetHash() []byte
- func (m *IssuerPublicKey) GetProofC() []byte
- func (m *IssuerPublicKey) GetProofS() []byte
- func (m *IssuerPublicKey) GetW() *ECP2
- func (*IssuerPublicKey) ProtoMessage()
- func (m *IssuerPublicKey) Reset()
- func (IPk *IssuerPublicKey) SetHash() error
- func (m *IssuerPublicKey) String() string
- func (m *IssuerPublicKey) XXX_DiscardUnknown()
- func (m *IssuerPublicKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *IssuerPublicKey) XXX_Merge(src proto.Message)
- func (m *IssuerPublicKey) XXX_Size() int
- func (m *IssuerPublicKey) XXX_Unmarshal(b []byte) error
- type NonRevocationProof
- func (*NonRevocationProof) Descriptor() ([]byte, []int)
- func (m *NonRevocationProof) GetNonRevocationProof() []byte
- func (m *NonRevocationProof) GetRevocationAlg() int32
- func (*NonRevocationProof) ProtoMessage()
- func (m *NonRevocationProof) Reset()
- func (m *NonRevocationProof) String() string
- func (m *NonRevocationProof) XXX_DiscardUnknown()
- func (m *NonRevocationProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *NonRevocationProof) XXX_Merge(src proto.Message)
- func (m *NonRevocationProof) XXX_Size() int
- func (m *NonRevocationProof) XXX_Unmarshal(b []byte) error
- type NymSignature
- func (*NymSignature) Descriptor() ([]byte, []int)
- func (m *NymSignature) GetNonce() []byte
- func (m *NymSignature) GetProofC() []byte
- func (m *NymSignature) GetProofSRNym() []byte
- func (m *NymSignature) GetProofSSk() []byte
- func (*NymSignature) ProtoMessage()
- func (m *NymSignature) Reset()
- func (m *NymSignature) String() string
- func (sig *NymSignature) Ver(nym *FP256BN.ECP, ipk *IssuerPublicKey, msg []byte) error
- func (m *NymSignature) XXX_DiscardUnknown()
- func (m *NymSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *NymSignature) XXX_Merge(src proto.Message)
- func (m *NymSignature) XXX_Size() int
- func (m *NymSignature) XXX_Unmarshal(b []byte) error
- type RevocationAlgorithm
- type Signature
- func (*Signature) Descriptor() ([]byte, []int)
- func (m *Signature) GetABar() *ECP
- func (m *Signature) GetAPrime() *ECP
- func (m *Signature) GetBPrime() *ECP
- func (m *Signature) GetEpoch() int64
- func (m *Signature) GetNonRevocationProof() *NonRevocationProof
- func (m *Signature) GetNonce() []byte
- func (m *Signature) GetNym() *ECP
- func (m *Signature) GetProofC() []byte
- func (m *Signature) GetProofSAttrs() [][]byte
- func (m *Signature) GetProofSE() []byte
- func (m *Signature) GetProofSR2() []byte
- func (m *Signature) GetProofSR3() []byte
- func (m *Signature) GetProofSRNym() []byte
- func (m *Signature) GetProofSSPrime() []byte
- func (m *Signature) GetProofSSk() []byte
- func (m *Signature) GetRevocationEpochPk() *ECP2
- func (m *Signature) GetRevocationPkSig() []byte
- func (*Signature) ProtoMessage()
- func (m *Signature) Reset()
- func (m *Signature) String() string
- func (sig *Signature) Ver(Disclosure []byte, ipk *IssuerPublicKey, msg []byte, ...) error
- func (m *Signature) XXX_DiscardUnknown()
- func (m *Signature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Signature) XXX_Merge(src proto.Message)
- func (m *Signature) XXX_Size() int
- func (m *Signature) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var FieldBytes = int(FP256BN.MODBYTES)
FieldBytes是组顺序的字节长度
var GenG1 = FP256BN.NewECPbigs( FP256BN.NewBIGints(FP256BN.CURVE_Gx), FP256BN.NewBIGints(FP256BN.CURVE_Gy))
geng1是g1组的生成器
var GenG2 = FP256BN.NewECP2fp2s( FP256BN.NewFP2bigs(FP256BN.NewBIGints(FP256BN.CURVE_Pxa), FP256BN.NewBIGints(FP256BN.CURVE_Pxb)), FP256BN.NewFP2bigs(FP256BN.NewBIGints(FP256BN.CURVE_Pya), FP256BN.NewBIGints(FP256BN.CURVE_Pyb)))
geng2是g2组的生成器
gengt是gt组的生成器
var GroupOrder = FP256BN.NewBIGints(FP256BN.CURVE_Order)
GroupOrder是组的顺序
var ProofBytes = map[RevocationAlgorithm]int{ ALG_NO_REVOCATION: 0, }
Functions ¶
func Ecp2FromProto ¶
ecp2fromproto将proto结构*ecp2转换为*amcl.ecp2
func EcpToBytes ¶
func GenerateLongTermRevocationKey ¶
func GenerateLongTermRevocationKey() (*ecdsa.PrivateKey, error)
GenerateLongterRevocationKey生成用于吊销的长期签名密钥
func RandModOrder ¶
randmodorder返回0,…,grouporder-1中的随机元素
func VerifyEpochPK ¶
func VerifyEpochPK(pk *ecdsa.PublicKey, epochPK *ECP2, epochPkSig []byte, epoch int, alg RevocationAlgorithm) error
verifyepochpk验证某个时期的吊销pk是否有效, 通过检查它是否使用长期吊销密钥签名。 注意,即使我们不使用撤销(即alg=alg_no_撤销),我们也需要 验证签名以确保颁发者确实签署了没有吊销的签名 在这个时代使用。
func WBBKeyGen ¶
wbbkeygen创建了一个新的弱Boneh-Boyen签名密钥对(http://ia.cr/2004/171)
Types ¶
type CredRequest ¶
type CredRequest struct { Nym *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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
CredRequest指定一个凭据请求对象,该对象由 Nym-一个假名,它是对用户秘密的承诺。 颁发者提供的随机非颁发者提供的非颁发者 证明,证明 Nym内的用户秘密
func NewCredRequest ¶
func NewCredRequest(sk *FP256BN.BIG, IssuerNonce []byte, ipk *IssuerPublicKey, rng *amcl.RAND) *CredRequest
NewCredRequest创建新的凭证请求,这是交互式凭证颁发协议的第一条消息 (从用户到颁发者)
func (*CredRequest) Descriptor ¶
func (*CredRequest) Descriptor() ([]byte, []int)
func (*CredRequest) GetIssuerNonce ¶
func (m *CredRequest) GetIssuerNonce() []byte
func (*CredRequest) GetNym ¶
func (m *CredRequest) GetNym() *ECP
func (*CredRequest) GetProofC ¶
func (m *CredRequest) GetProofC() []byte
func (*CredRequest) GetProofS ¶
func (m *CredRequest) GetProofS() []byte
func (*CredRequest) ProtoMessage ¶
func (*CredRequest) ProtoMessage()
func (*CredRequest) Reset ¶
func (m *CredRequest) Reset()
func (*CredRequest) String ¶
func (m *CredRequest) String() string
func (*CredRequest) XXX_DiscardUnknown ¶
func (m *CredRequest) XXX_DiscardUnknown()
func (*CredRequest) XXX_Marshal ¶
func (m *CredRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CredRequest) XXX_Merge ¶
func (dst *CredRequest) XXX_Merge(src proto.Message)
func (*CredRequest) XXX_Size ¶
func (m *CredRequest) XXX_Size() int
func (*CredRequest) XXX_Unmarshal ¶
func (m *CredRequest) XXX_Unmarshal(b []byte) error
type Credential ¶
type Credential struct { A *ECP `protobuf:"bytes,1,opt,name=a,proto3" json:"a,omitempty"` B *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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Credential指定一个由 A、B、E、S—签名值 attrs-属性值
func NewCredential ¶
func NewCredential(key *IssuerKey, m *CredRequest, attrs []*FP256BN.BIG, rng *amcl.RAND) (*Credential, error)
NewCredential颁发新的凭据,这是交互式颁发协议的最后一步 在此步骤中,所有属性值都由颁发者添加,然后与承诺一起签名 来自凭据请求的用户密钥
func (*Credential) Descriptor ¶
func (*Credential) Descriptor() ([]byte, []int)
func (*Credential) GetA ¶
func (m *Credential) GetA() *ECP
func (*Credential) GetAttrs ¶
func (m *Credential) GetAttrs() [][]byte
func (*Credential) GetB ¶
func (m *Credential) GetB() *ECP
func (*Credential) GetE ¶
func (m *Credential) GetE() []byte
func (*Credential) GetS ¶
func (m *Credential) GetS() []byte
func (*Credential) ProtoMessage ¶
func (*Credential) ProtoMessage()
func (*Credential) Reset ¶
func (m *Credential) Reset()
func (*Credential) String ¶
func (m *Credential) String() string
func (*Credential) Ver ¶
func (cred *Credential) Ver(sk *FP256BN.BIG, ipk *IssuerPublicKey) error
Ver通过验证签名以加密方式验证凭证 属性值和用户密钥
func (*Credential) XXX_DiscardUnknown ¶
func (m *Credential) XXX_DiscardUnknown()
func (*Credential) XXX_Marshal ¶
func (m *Credential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Credential) XXX_Merge ¶
func (dst *Credential) XXX_Merge(src proto.Message)
func (*Credential) XXX_Size ¶
func (m *Credential) XXX_Size() int
func (*Credential) XXX_Unmarshal ¶
func (m *Credential) XXX_Unmarshal(b []byte) error
type CredentialRevocationInformation ¶
type CredentialRevocationInformation struct { //epoch包含此CRI有效的epoch(时间窗口) Epoch int64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` //epoch_pk是吊销机构在这个时期使用的公钥。 EpochPk *ECP2 `protobuf:"bytes,2,opt,name=epoch_pk,json=epochPk,proto3" json:"epoch_pk,omitempty"` //epoch_pk_sig是epoch pk上的签名,在吊销机构的长期密钥下有效。 EpochPkSig []byte `protobuf:"bytes,3,opt,name=epoch_pk_sig,json=epochPkSig,proto3" json:"epoch_pk_sig,omitempty"` //revocation表示使用哪种撤销算法 RevocationAlg int32 `protobuf:"varint,4,opt,name=revocation_alg,json=revocationAlg,proto3" json:"revocation_alg,omitempty"` //吊销数据包含特定于所用吊销算法的数据 RevocationData []byte `protobuf:"bytes,5,opt,name=revocation_data,json=revocationData,proto3" json:"revocation_data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func CreateCRI ¶
func CreateCRI(key *ecdsa.PrivateKey, unrevokedHandles []*FP256BN.BIG, epoch int, alg RevocationAlgorithm, rng *amcl.RAND) (*CredentialRevocationInformation, error)
createcri创建特定时间段(epoch)的凭证吊销信息。 用户可以使用CRI来证明他们没有被撤销。 注意,当不使用撤销(即alg=alg_no_撤销)时,不使用输入的未撤销数据, 由此产生的CRI可以被任何签名者使用。
func (*CredentialRevocationInformation) Descriptor ¶
func (*CredentialRevocationInformation) Descriptor() ([]byte, []int)
func (*CredentialRevocationInformation) GetEpoch ¶
func (m *CredentialRevocationInformation) GetEpoch() int64
func (*CredentialRevocationInformation) GetEpochPk ¶
func (m *CredentialRevocationInformation) GetEpochPk() *ECP2
func (*CredentialRevocationInformation) GetEpochPkSig ¶
func (m *CredentialRevocationInformation) GetEpochPkSig() []byte
func (*CredentialRevocationInformation) GetRevocationAlg ¶
func (m *CredentialRevocationInformation) GetRevocationAlg() int32
func (*CredentialRevocationInformation) GetRevocationData ¶
func (m *CredentialRevocationInformation) GetRevocationData() []byte
func (*CredentialRevocationInformation) ProtoMessage ¶
func (*CredentialRevocationInformation) ProtoMessage()
func (*CredentialRevocationInformation) Reset ¶
func (m *CredentialRevocationInformation) Reset()
func (*CredentialRevocationInformation) String ¶
func (m *CredentialRevocationInformation) String() string
func (*CredentialRevocationInformation) XXX_DiscardUnknown ¶
func (m *CredentialRevocationInformation) XXX_DiscardUnknown()
func (*CredentialRevocationInformation) XXX_Marshal ¶
func (m *CredentialRevocationInformation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CredentialRevocationInformation) XXX_Merge ¶
func (dst *CredentialRevocationInformation) XXX_Merge(src proto.Message)
func (*CredentialRevocationInformation) XXX_Size ¶
func (m *CredentialRevocationInformation) XXX_Size() int
func (*CredentialRevocationInformation) XXX_Unmarshal ¶
func (m *CredentialRevocationInformation) XXX_Unmarshal(b []byte) error
type ECP ¶
type ECP struct { X []byte `protobuf:"bytes,1,opt,name=x,proto3" json:"x,omitempty"` Y []byte `protobuf:"bytes,2,opt,name=y,proto3" json:"y,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
ECP是由其坐标指定的椭圆曲线点。 ECP对应于第一组(g1)的一个元素。
func (*ECP) Descriptor ¶
func (*ECP) ProtoMessage ¶
func (*ECP) ProtoMessage()
func (*ECP) XXX_DiscardUnknown ¶
func (m *ECP) XXX_DiscardUnknown()
func (*ECP) XXX_Unmarshal ¶
type ECP2 ¶
type ECP2 struct { Xa []byte `protobuf:"bytes,1,opt,name=xa,proto3" json:"xa,omitempty"` Xb []byte `protobuf:"bytes,2,opt,name=xb,proto3" json:"xb,omitempty"` Ya []byte `protobuf:"bytes,3,opt,name=ya,proto3" json:"ya,omitempty"` Yb []byte `protobuf:"bytes,4,opt,name=yb,proto3" json:"yb,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
ECP2是由其坐标指定的椭圆曲线点。 ECP2对应于第二组(G2)的一个元素。
func (*ECP2) Descriptor ¶
func (*ECP2) ProtoMessage ¶
func (*ECP2) ProtoMessage()
func (*ECP2) XXX_DiscardUnknown ¶
func (m *ECP2) XXX_DiscardUnknown()
func (*ECP2) XXX_Unmarshal ¶
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
issuer key指定一个由 isk-颁发者密钥和 IssuerPublickey-颁发者公钥
func NewIssuerKey ¶
NewIssuerKey创建一个新的具有属性名称数组的Issuer密钥对 将包含在此颁发者认证的凭据中(凭据规范) 参见http://eprint.iacr.org/2016/663.pdf第4.3,供参考。
func (*IssuerKey) Descriptor ¶
func (*IssuerKey) GetIpk ¶
func (m *IssuerKey) GetIpk() *IssuerPublicKey
func (*IssuerKey) ProtoMessage ¶
func (*IssuerKey) ProtoMessage()
func (*IssuerKey) XXX_DiscardUnknown ¶
func (m *IssuerKey) XXX_DiscardUnknown()
func (*IssuerKey) XXX_Marshal ¶
func (*IssuerKey) XXX_Unmarshal ¶
type IssuerPublicKey ¶
type IssuerPublicKey struct { AttributeNames []string `protobuf:"bytes,1,rep,name=attribute_names,json=attributeNames,proto3" json:"attribute_names,omitempty"` HSk *ECP `protobuf:"bytes,2,opt,name=h_sk,json=hSk,proto3" json:"h_sk,omitempty"` HRand *ECP `protobuf:"bytes,3,opt,name=h_rand,json=hRand,proto3" json:"h_rand,omitempty"` HAttrs []*ECP `protobuf:"bytes,4,rep,name=h_attrs,json=hAttrs,proto3" json:"h_attrs,omitempty"` W *ECP2 `protobuf:"bytes,5,opt,name=w,proto3" json:"w,omitempty"` BarG1 *ECP `protobuf:"bytes,6,opt,name=bar_g1,json=barG1,proto3" json:"bar_g1,omitempty"` BarG2 *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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
IssuerPublickey指定由以下内容组成的颁发者公钥 属性名称-由颁发者颁发的凭证的属性名称列表 h_sk、h_rand、h_attrs、w、bar_g1、bar_g2-与签名键、随机性和属性相对应的组元素 proof_c,proof_s组成一个零知识的密钥知识证明 哈希是附加到它的公钥的哈希
func (*IssuerPublicKey) Check ¶
func (IPk *IssuerPublicKey) Check() error
检查此颁发者公钥是否有效,即 所有组件都存在,并且一个zk证明可以验证
func (*IssuerPublicKey) Descriptor ¶
func (*IssuerPublicKey) Descriptor() ([]byte, []int)
func (*IssuerPublicKey) GetAttributeNames ¶
func (m *IssuerPublicKey) GetAttributeNames() []string
func (*IssuerPublicKey) GetBarG1 ¶
func (m *IssuerPublicKey) GetBarG1() *ECP
func (*IssuerPublicKey) GetBarG2 ¶
func (m *IssuerPublicKey) GetBarG2() *ECP
func (*IssuerPublicKey) GetHAttrs ¶
func (m *IssuerPublicKey) GetHAttrs() []*ECP
func (*IssuerPublicKey) GetHRand ¶
func (m *IssuerPublicKey) GetHRand() *ECP
func (*IssuerPublicKey) GetHSk ¶
func (m *IssuerPublicKey) GetHSk() *ECP
func (*IssuerPublicKey) GetHash ¶
func (m *IssuerPublicKey) GetHash() []byte
func (*IssuerPublicKey) GetProofC ¶
func (m *IssuerPublicKey) GetProofC() []byte
func (*IssuerPublicKey) GetProofS ¶
func (m *IssuerPublicKey) GetProofS() []byte
func (*IssuerPublicKey) GetW ¶
func (m *IssuerPublicKey) GetW() *ECP2
func (*IssuerPublicKey) ProtoMessage ¶
func (*IssuerPublicKey) ProtoMessage()
func (*IssuerPublicKey) Reset ¶
func (m *IssuerPublicKey) Reset()
func (*IssuerPublicKey) String ¶
func (m *IssuerPublicKey) String() string
func (*IssuerPublicKey) XXX_DiscardUnknown ¶
func (m *IssuerPublicKey) XXX_DiscardUnknown()
func (*IssuerPublicKey) XXX_Marshal ¶
func (m *IssuerPublicKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*IssuerPublicKey) XXX_Merge ¶
func (dst *IssuerPublicKey) XXX_Merge(src proto.Message)
func (*IssuerPublicKey) XXX_Size ¶
func (m *IssuerPublicKey) XXX_Size() int
func (*IssuerPublicKey) XXX_Unmarshal ¶
func (m *IssuerPublicKey) XXX_Unmarshal(b []byte) error
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
非吊销证明包含凭证未被吊销的证明
func (*NonRevocationProof) Descriptor ¶
func (*NonRevocationProof) Descriptor() ([]byte, []int)
func (*NonRevocationProof) GetNonRevocationProof ¶
func (m *NonRevocationProof) GetNonRevocationProof() []byte
func (*NonRevocationProof) GetRevocationAlg ¶
func (m *NonRevocationProof) GetRevocationAlg() int32
func (*NonRevocationProof) ProtoMessage ¶
func (*NonRevocationProof) ProtoMessage()
func (*NonRevocationProof) Reset ¶
func (m *NonRevocationProof) Reset()
func (*NonRevocationProof) String ¶
func (m *NonRevocationProof) String() string
func (*NonRevocationProof) XXX_DiscardUnknown ¶
func (m *NonRevocationProof) XXX_DiscardUnknown()
func (*NonRevocationProof) XXX_Marshal ¶
func (m *NonRevocationProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NonRevocationProof) XXX_Merge ¶
func (dst *NonRevocationProof) XXX_Merge(src proto.Message)
func (*NonRevocationProof) XXX_Size ¶
func (m *NonRevocationProof) XXX_Size() int
func (*NonRevocationProof) XXX_Unmarshal ¶
func (m *NonRevocationProof) XXX_Unmarshal(b []byte) error
type NymSignature ¶
type NymSignature struct { //证明是菲亚特·沙米尔对ZKP的挑战 ProofC []byte `protobuf:"bytes,1,opt,name=proof_c,json=proofC,proto3" json:"proof_c,omitempty"` //proof_s_sk是用户密钥的s值证明知识 ProofSSk []byte `protobuf:"bytes,2,opt,name=proof_s_sk,json=proofSSk,proto3" json:"proof_s_sk,omitempty"` //证明化名是证明化名秘密的S值。 ProofSRNym []byte `protobuf:"bytes,3,opt,name=proof_s_r_nym,json=proofSRNym,proto3" json:"proof_s_r_nym,omitempty"` //nonce是用于签名的新nonce Nonce []byte `protobuf:"bytes,4,opt,name=nonce,proto3" json:"nonce,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
NymSignature指定对消息签名的签名对象 关于笔名。它不同于标准的idemix.signature,事实上 标准签名对象还证明了该笔名是基于 CA(发行人),而NymSignature仅证明该假名的所有者 在邮件上签名
func NewNymSignature ¶
func NewNymSignature(sk *FP256BN.BIG, Nym *FP256BN.ECP, RNym *FP256BN.BIG, ipk *IssuerPublicKey, msg []byte, rng *amcl.RAND) (*NymSignature, error)
NewSignature创建新的Idemix假名签名
func (*NymSignature) Descriptor ¶
func (*NymSignature) Descriptor() ([]byte, []int)
func (*NymSignature) GetNonce ¶
func (m *NymSignature) GetNonce() []byte
func (*NymSignature) GetProofC ¶
func (m *NymSignature) GetProofC() []byte
func (*NymSignature) GetProofSRNym ¶
func (m *NymSignature) GetProofSRNym() []byte
func (*NymSignature) GetProofSSk ¶
func (m *NymSignature) GetProofSSk() []byte
func (*NymSignature) ProtoMessage ¶
func (*NymSignature) ProtoMessage()
func (*NymSignature) Reset ¶
func (m *NymSignature) Reset()
func (*NymSignature) String ¶
func (m *NymSignature) String() string
func (*NymSignature) Ver ¶
func (sig *NymSignature) Ver(nym *FP256BN.ECP, ipk *IssuerPublicKey, msg []byte) error
验证IDemix NymSignature
func (*NymSignature) XXX_DiscardUnknown ¶
func (m *NymSignature) XXX_DiscardUnknown()
func (*NymSignature) XXX_Marshal ¶
func (m *NymSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NymSignature) XXX_Merge ¶
func (dst *NymSignature) XXX_Merge(src proto.Message)
func (*NymSignature) XXX_Size ¶
func (m *NymSignature) XXX_Size() int
func (*NymSignature) XXX_Unmarshal ¶
func (m *NymSignature) XXX_Unmarshal(b []byte) error
type RevocationAlgorithm ¶
type RevocationAlgorithm int32
const (
ALG_NO_REVOCATION RevocationAlgorithm = iota
)
type Signature ¶
type Signature struct { APrime *ECP `protobuf:"bytes,1,opt,name=a_prime,json=aPrime,proto3" json:"a_prime,omitempty"` ABar *ECP `protobuf:"bytes,2,opt,name=a_bar,json=aBar,proto3" json:"a_bar,omitempty"` BPrime *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 *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 *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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
签名指定一个签名对象,该对象由 一个主、一个条、一个主、证明随机凭证签名值 一个零知识的凭证 以及相应的用户秘密和属性值 nonce-用于签名的新nonce 新的笔名(对用户秘密的承诺)
func NewSignature ¶
func NewSignature(cred *Credential, sk *FP256BN.BIG, Nym *FP256BN.ECP, RNym *FP256BN.BIG, ipk *IssuerPublicKey, Disclosure []byte, msg []byte, rhIndex int, cri *CredentialRevocationInformation, rng *amcl.RAND) (*Signature, error)
NewSignature创建新的Idemix签名(Schnorr类型签名) []字节的公开控制公开哪些属性: 如果disclosure[i]=0,则属性i保持隐藏,否则将被公开。 我们要求撤销处理保持未公开(即披露[Rhindex]=0)。 我们使用http://eprint.iacr.org/2016/663.pdf,sec.提供的零知识证明。4.5证明对BBS+签名的了解
func (*Signature) Descriptor ¶
func (*Signature) GetNonRevocationProof ¶
func (m *Signature) GetNonRevocationProof() *NonRevocationProof
func (*Signature) GetProofSAttrs ¶
func (*Signature) GetProofSE ¶
func (*Signature) GetProofSR2 ¶
func (*Signature) GetProofSR3 ¶
func (*Signature) GetProofSRNym ¶
func (*Signature) GetProofSSPrime ¶
func (*Signature) GetProofSSk ¶
func (*Signature) GetRevocationEpochPk ¶
func (*Signature) GetRevocationPkSig ¶
func (*Signature) ProtoMessage ¶
func (*Signature) ProtoMessage()
func (*Signature) Ver ¶
func (sig *Signature) Ver(Disclosure []byte, ipk *IssuerPublicKey, msg []byte, attributeValues []*FP256BN.BIG, rhIndex int, revPk *ecdsa.PublicKey, epoch int) error
Ver验证IDemix签名 披露控制其期望披露的属性 attributeValues包含所需的属性值。 此函数将检查如果属性i被公开,则第i个属性等于属性值[i]。
func (*Signature) XXX_DiscardUnknown ¶
func (m *Signature) XXX_DiscardUnknown()