Documentation ¶
Index ¶
- type CA
- type CACert
- type CAClient
- type CAServer
- type Client
- func (c *Client) GenerateMasterKey() *big.Int
- func (c *Client) GenerateNym(userSecret *big.Int, caCert *CACert, regKey string) (*Nym, error)
- func (c *Client) ObtainCredential(userSecret *big.Int, nym *Nym, orgPubKeys *PubKey) (*Cred, error)
- func (c *Client) TransferCredential(orgName string, userSecret *big.Int, nym *Nym, cred *Cred) (*string, error)
- type Cred
- type CredIssuer
- type CredVerifier
- type Nym
- type NymGenerator
- type OrgServer
- type PubKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CA ¶
type CA struct {
// contains filtered or unexported fields
}
func (*CA) GetChallenge ¶
func (ca *CA) GetChallenge(a, b, x *ec.GroupElement) *big.Int
type CACert ¶
type CACert struct { BlindedA *ec.GroupElement BlindedB *ec.GroupElement R *big.Int S *big.Int }
type CAClient ¶
type CAClient struct { pb.CA_ECClient // contains filtered or unexported fields }
func NewCAClient ¶
func (*CAClient) GenerateCertificate ¶
GenerateCertificate provides a certificate from trusted CA to the user. Note that CA needs to know the user. The certificate is then used for registering pseudonym (nym). The certificate contains blinded user's master key pair and a signature of it.
type CAServer ¶
type CAServer struct {
// contains filtered or unexported fields
}
func (*CAServer) GenerateCertificate ¶
func (s *CAServer) GenerateCertificate(stream pb. CA_EC_GenerateCertificateServer) error
func (*CAServer) RegisterTo ¶
type Client ¶
type Client struct { pb.Org_ECClient // contains filtered or unexported fields }
func (*Client) GenerateMasterKey ¶
TODO make it without connection ? GenerateMasterKey generates a master secret key to be used subsequently by all the protocols in the scheme.
func (*Client) GenerateNym ¶
GenerateNym generates a nym and registers it to the organization. Do not use the same CACert for different organizations - use it only once!
func (*Client) ObtainCredential ¶
func (c *Client) ObtainCredential(userSecret *big.Int, nym *Nym, orgPubKeys *PubKey) ( *Cred, error)
ObtainCredential returns anonymous credential.
func (*Client) TransferCredential ¶
func (c *Client) TransferCredential(orgName string, userSecret *big.Int, nym *Nym, cred *Cred) (*string, error)
TransferCredential transfers orgName's credential to organization where the authentication should happen (the organization takes credential issued by another organization).
type Cred ¶
type Cred struct { SmallAToGamma *ec.GroupElement SmallBToGamma *ec.GroupElement AToGamma *ec.GroupElement BToGamma *ec.GroupElement T1 *ecschnorr.BlindedTrans T2 *ecschnorr.BlindedTrans }
func NewCred ¶
func NewCred(aToGamma, bToGamma, AToGamma, BToGamma *ec.GroupElement, t1, t2 *ecschnorr.BlindedTrans) *Cred
type CredIssuer ¶
type CredIssuer struct {
// contains filtered or unexported fields
}
func NewCredIssuer ¶
func NewCredIssuer(secKey *psys.SecKey, curveType ec.Curve) *CredIssuer
func (*CredIssuer) GetChallenge ¶
func (i *CredIssuer) GetChallenge(a, b, x *ec.GroupElement) *big.Int
TODO GetChallenge?
func (*CredIssuer) GetProofData ¶
func (*CredIssuer) Verify ¶
func (i *CredIssuer) Verify(z *big.Int) ( *ec.GroupElement, *ec.GroupElement, *ec.GroupElement, *ec.GroupElement, *ec.GroupElement, *ec.GroupElement, 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(secKey *psys.SecKey, c ec.Curve) *CredVerifier
func (*CredVerifier) GetChallenge ¶
func (v *CredVerifier) GetChallenge(a, b, a1, b1, x1, x2 *ec.GroupElement) *big.Int
TODO GetChallenge?
type Nym ¶
type Nym struct { A *ec.GroupElement B *ec.GroupElement }
Nym represents a pseudonym in the pseudonym system scheme.
func NewNym ¶
func NewNym(a, b *ec.GroupElement) *Nym
type NymGenerator ¶
type NymGenerator struct {
// contains filtered or unexported fields
}
func NewNymGenerator ¶
func NewNymGenerator(pubKey *psys.PubKey, c ec.Curve) *NymGenerator
func (*NymGenerator) GetChallenge ¶
func (g *NymGenerator) GetChallenge(nymA, blindedA, nymB, blindedB, x1, x2 *ec.GroupElement, r, s *big.Int) (*big.Int, error)
type OrgServer ¶
type OrgServer struct { *NymGenerator *CredIssuer *CredVerifier SessMgr anauth.SessManager RegMgr anauth.RegManager // contains filtered or unexported fields }
func NewOrgServer ¶
func (*OrgServer) GenerateNym ¶
func (s *OrgServer) GenerateNym(stream pb.Org_EC_GenerateNymServer) error
func (*OrgServer) ObtainCred ¶
func (s *OrgServer) ObtainCred(stream pb.Org_EC_ObtainCredServer) error
func (*OrgServer) RegisterTo ¶
func (*OrgServer) TransferCred ¶
func (s *OrgServer) TransferCred(stream pb.Org_EC_TransferCredServer) error
type PubKey ¶
type PubKey struct {
H1, H2 *ec.GroupElement
}
func GenerateKeyPair ¶
GenerateKeyPair takes EC group and constructs a public key for pseudonym system scheme in EC arithmetic.
func NewPubKey ¶
func NewPubKey(h1, h2 *ec.GroupElement) *PubKey