...

Package bridge

import "github.com/hyperledger/fabric/bccsp/idemix/bridge"
Overview
Index

Overview ▾

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Index ▾

func NewRandOrPanic() *amcl.RAND
type Big
    func (b *Big) Bytes() ([]byte, error)
type CredRequest
    func (cr *CredRequest) Sign(sk handlers.Big, ipk handlers.IssuerPublicKey, nonce []byte) (res []byte, err error)
    func (*CredRequest) Verify(credentialRequest []byte, ipk handlers.IssuerPublicKey, nonce []byte) (err error)
type Credential
    func (c *Credential) Sign(key handlers.IssuerSecretKey, credentialRequest []byte, attributes []bccsp.IdemixAttribute) (res []byte, err error)
    func (*Credential) Verify(sk handlers.Big, ipk handlers.IssuerPublicKey, credential []byte, attributes []bccsp.IdemixAttribute) (err error)
type Ecp
    func (o *Ecp) Bytes() ([]byte, error)
type Issuer
    func (i *Issuer) NewKey(attributeNames []string) (res handlers.IssuerSecretKey, err error)
    func (*Issuer) NewPublicKeyFromBytes(raw []byte, attributes []string) (res handlers.IssuerPublicKey, err error)
type IssuerPublicKey
    func (o *IssuerPublicKey) Bytes() ([]byte, error)
    func (o *IssuerPublicKey) Hash() []byte
type IssuerSecretKey
    func (o *IssuerSecretKey) Bytes() ([]byte, error)
    func (o *IssuerSecretKey) Public() handlers.IssuerPublicKey
type NymSignatureScheme
    func (n *NymSignatureScheme) Sign(sk handlers.Big, Nym handlers.Ecp, RNym handlers.Big, ipk handlers.IssuerPublicKey, digest []byte) (res []byte, err error)
    func (*NymSignatureScheme) Verify(ipk handlers.IssuerPublicKey, Nym handlers.Ecp, signature, digest []byte) (err error)
type Revocation
    func (*Revocation) NewKey() (*ecdsa.PrivateKey, error)
    func (*Revocation) Sign(key *ecdsa.PrivateKey, unrevokedHandles [][]byte, epoch int, alg bccsp.RevocationAlgorithm) (res []byte, err error)
    func (*Revocation) Verify(pk *ecdsa.PublicKey, criRaw []byte, epoch int, alg bccsp.RevocationAlgorithm) (err error)
type SignatureScheme
    func (s *SignatureScheme) Sign(cred []byte, sk handlers.Big, Nym handlers.Ecp, RNym handlers.Big, ipk handlers.IssuerPublicKey, attributes []bccsp.IdemixAttribute, msg []byte, rhIndex int, criRaw []byte) (res []byte, err error)
    func (*SignatureScheme) Verify(ipk handlers.IssuerPublicKey, signature, digest []byte, attributes []bccsp.IdemixAttribute, rhIndex int, revocationPublicKey *ecdsa.PublicKey, epoch int) (err error)
type User
    func (u *User) MakeNym(sk handlers.Big, ipk handlers.IssuerPublicKey) (r1 handlers.Ecp, r2 handlers.Big, err error)
    func (u *User) NewKey() (res handlers.Big, err error)
    func (*User) NewKeyFromBytes(raw []byte) (res handlers.Big, err error)
    func (*User) NewPublicNymFromBytes(raw []byte) (r handlers.Ecp, err error)

Package files

credential.go credrequest.go issuer.go math.go nymsignaturescheme.go rand.go revocation.go signaturescheme.go user.go

func NewRandOrPanic

func NewRandOrPanic() *amcl.RAND

NewRandOrPanic return a new amcl PRG or panic

type Big

Big encapsulate an amcl big integer

type Big struct {
    E *FP256BN.BIG
}

func (*Big) Bytes

func (b *Big) Bytes() ([]byte, error)

type CredRequest

CredRequest encapsulates the idemix algorithms to produce (sign) a credential request and verify it. Recall that a credential request is produced by a user, and it is verified by the issuer at credential creation time.

type CredRequest struct {
    NewRand func() *amcl.RAND
}

func (*CredRequest) Sign

func (cr *CredRequest) Sign(sk handlers.Big, ipk handlers.IssuerPublicKey, nonce []byte) (res []byte, err error)

Sign produces an idemix credential request. It takes in input a user secret key and an issuer public key.

func (*CredRequest) Verify

func (*CredRequest) Verify(credentialRequest []byte, ipk handlers.IssuerPublicKey, nonce []byte) (err error)

Verify checks that the passed credential request is valid with the respect to the passed issuer public key.

type Credential

Credential encapsulates the idemix algorithms to produce (sign) a credential and verify it. Recall that a credential is produced by the Issuer upon a credential request, and it is verified by the requester.

type Credential struct {
    NewRand func() *amcl.RAND
}

func (*Credential) Sign

func (c *Credential) Sign(key handlers.IssuerSecretKey, credentialRequest []byte, attributes []bccsp.IdemixAttribute) (res []byte, err error)

Sign produces an idemix credential. It takes in input the issuer secret key, a serialised credential request, and a list of attribute values. Notice that attributes should not contain attributes whose type is IdemixHiddenAttribute cause the credential needs to carry all the attribute values.

func (*Credential) Verify

func (*Credential) Verify(sk handlers.Big, ipk handlers.IssuerPublicKey, credential []byte, attributes []bccsp.IdemixAttribute) (err error)

Verify checks that an idemix credential is cryptographically correct. It takes in input the user secret key (sk), the issuer public key (ipk), the serialised credential (credential), and a list of attributes. The list of attributes is optional, in case it is specified, Verify checks that the credential carries the specified attributes.

type Ecp

Ecp encapsulate an amcl elliptic curve point

type Ecp struct {
    E *FP256BN.ECP
}

func (*Ecp) Bytes

func (o *Ecp) Bytes() ([]byte, error)

type Issuer

Issuer encapsulates the idemix algorithms to generate issuer key-pairs

type Issuer struct {
    NewRand func() *amcl.RAND
}

func (*Issuer) NewKey

func (i *Issuer) NewKey(attributeNames []string) (res handlers.IssuerSecretKey, err error)

NewKey generates a new issuer key-pair

func (*Issuer) NewPublicKeyFromBytes

func (*Issuer) NewPublicKeyFromBytes(raw []byte, attributes []string) (res handlers.IssuerPublicKey, err error)

type IssuerPublicKey

IssuerPublicKey encapsulate an idemix issuer public key.

type IssuerPublicKey struct {
    PK *cryptolib.IssuerPublicKey
}

func (*IssuerPublicKey) Bytes

func (o *IssuerPublicKey) Bytes() ([]byte, error)

func (*IssuerPublicKey) Hash

func (o *IssuerPublicKey) Hash() []byte

type IssuerSecretKey

IssuerPublicKey encapsulate an idemix issuer secret key.

type IssuerSecretKey struct {
    SK *cryptolib.IssuerKey
}

func (*IssuerSecretKey) Bytes

func (o *IssuerSecretKey) Bytes() ([]byte, error)

func (*IssuerSecretKey) Public

func (o *IssuerSecretKey) Public() handlers.IssuerPublicKey

type NymSignatureScheme

NymSignatureScheme encapsulates the idemix algorithms to sign and verify using an idemix pseudonym.

type NymSignatureScheme struct {
    NewRand func() *amcl.RAND
}

func (*NymSignatureScheme) Sign

func (n *NymSignatureScheme) Sign(sk handlers.Big, Nym handlers.Ecp, RNym handlers.Big, ipk handlers.IssuerPublicKey, digest []byte) (res []byte, err error)

Sign produces a signature over the passed digest. It takes in input, the user secret key (sk), the pseudonym public key (Nym) and secret key (RNym), and the issuer public key (ipk).

func (*NymSignatureScheme) Verify

func (*NymSignatureScheme) Verify(ipk handlers.IssuerPublicKey, Nym handlers.Ecp, signature, digest []byte) (err error)

Verify checks that the passed signatures is valid with the respect to the passed digest, issuer public key, and pseudonym public key.

type Revocation

Revocation encapsulates the idemix algorithms for revocation

type Revocation struct {
}

func (*Revocation) NewKey

func (*Revocation) NewKey() (*ecdsa.PrivateKey, error)

NewKey generate a new revocation key-pair.

func (*Revocation) Sign

func (*Revocation) Sign(key *ecdsa.PrivateKey, unrevokedHandles [][]byte, epoch int, alg bccsp.RevocationAlgorithm) (res []byte, err error)

Sign generates a new CRI with the respect to the passed unrevoked handles, epoch, and revocation algorithm.

func (*Revocation) Verify

func (*Revocation) Verify(pk *ecdsa.PublicKey, criRaw []byte, epoch int, alg bccsp.RevocationAlgorithm) (err error)

Verify checks that the passed serialised CRI (criRaw) is valid with the respect to the passed revocation public key, epoch, and revocation algorithm.

type SignatureScheme

SignatureScheme encapsulates the idemix algorithms to sign and verify using an idemix credential.

type SignatureScheme struct {
    NewRand func() *amcl.RAND
}

func (*SignatureScheme) Sign

func (s *SignatureScheme) Sign(cred []byte, sk handlers.Big, Nym handlers.Ecp, RNym handlers.Big, ipk handlers.IssuerPublicKey, attributes []bccsp.IdemixAttribute,
    msg []byte, rhIndex int, criRaw []byte) (res []byte, err error)

Sign produces an idemix-signature with the respect to the passed serialised credential (cred), user secret key (sk), pseudonym public key (Nym) and secret key (RNym), issuer public key (ipk), and attributes to be disclosed.

func (*SignatureScheme) Verify

func (*SignatureScheme) Verify(ipk handlers.IssuerPublicKey, signature, digest []byte, attributes []bccsp.IdemixAttribute, rhIndex int, revocationPublicKey *ecdsa.PublicKey, epoch int) (err error)

Verify checks that an idemix signature is valid with the respect to the passed issuer public key, digest, attributes, revocation index (rhIndex), revocation public key, and epoch.

type User

User encapsulates the idemix algorithms to generate user secret keys and pseudonym.

type User struct {
    NewRand func() *amcl.RAND
}

func (*User) MakeNym

func (u *User) MakeNym(sk handlers.Big, ipk handlers.IssuerPublicKey) (r1 handlers.Ecp, r2 handlers.Big, err error)

MakeNym generates a new pseudonym key-pair derived from the passed user secret key (sk) and issuer public key (ipk)

func (*User) NewKey

func (u *User) NewKey() (res handlers.Big, err error)

NewKey generates an idemix user secret key

func (*User) NewKeyFromBytes

func (*User) NewKeyFromBytes(raw []byte) (res handlers.Big, err error)

func (*User) NewPublicNymFromBytes

func (*User) NewPublicNymFromBytes(raw []byte) (r handlers.Ecp, err error)