singhdas

package
v0.0.0-...-cc363e2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2015 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package singhdas implementes "A Novel Proficient Blind Signature Scheme using ECC" by Nitu Singh and Sumanjit Das Some of the tests/verifications are not necessary but done anyways.

Index

Constants

View Source
const SchemeName = "SNG"

SchemeName is the name of this blinding scheme

Variables

This section is empty.

Functions

This section is empty.

Types

type BlindMessage

type BlindMessage struct {
	SchemeName  string
	DataType    genericblinding.DataType
	PubKey      eccutil.Point
	Message     *big.Int
	SignerBlind eccutil.Point
}

BlindMessage contains the client-produced blinding factors

func NewBlindMessage

func NewBlindMessage(PubKey *eccutil.Point) BlindMessage

NewBlindMessage returns a new BlindingParamClient

func (BlindMessage) Marshal

func (blindMessage BlindMessage) Marshal() ([]byte, error)

Marshal a BlindingParamClient

func (BlindMessage) SchemeData

func (blindMessage BlindMessage) SchemeData() (string, genericblinding.DataType, *eccutil.Point)

SchemeData returns general data for the scheme and BlindingData type

func (BlindMessage) UniqueID

func (blindMessage BlindMessage) UniqueID() []byte

UniqueID returns a unique ID for this element. Constant in this case (zeros)

func (BlindMessage) Unmarshal

func (blindMessage BlindMessage) Unmarshal(b []byte) (genericblinding.BlindingData, error)

Unmarshal []byte into BlindingParamClient

type BlindMessageInt

type BlindMessageInt struct {
	Message     *big.Int
	SignerBlind *eccutil.Point
}

BlindMessageInt encapsulates a blinded message

type BlindSignature

type BlindSignature struct {
	SchemeName  string
	DataType    genericblinding.DataType
	PubKey      eccutil.Point
	SignerBlind eccutil.Point
	S           *big.Int
}

BlindSignature contains the client-produced blinding factors

func NewBlindSignature

func NewBlindSignature(PubKey *eccutil.Point) BlindSignature

NewBlindSignature returns a new BlindingParamClient

func (BlindSignature) Marshal

func (blindSignature BlindSignature) Marshal() ([]byte, error)

Marshal a BlindingParamClient

func (BlindSignature) SchemeData

func (blindSignature BlindSignature) SchemeData() (string, genericblinding.DataType, *eccutil.Point)

SchemeData returns general data for the scheme and BlindingData type

func (BlindSignature) UniqueID

func (blindSignature BlindSignature) UniqueID() []byte

UniqueID returns a unique ID for this element. Constant in this case (zeros)

func (BlindSignature) Unmarshal

func (blindSignature BlindSignature) Unmarshal(b []byte) (genericblinding.BlindingData, error)

Unmarshal []byte into BlindingParamClient

type BlindSignatureInt

type BlindSignatureInt struct {
	SignerBlind *eccutil.Point
	S           *big.Int
}

BlindSignatureInt represents a single blind signature

type BlindingFactors

type BlindingFactors struct {
	SchemeName string
	DataType   genericblinding.DataType
	PubKey     eccutil.Point

	R2          *big.Int
	R1inv       *big.Int
	R1          *big.Int
	N           *big.Int
	Hm          *big.Int
	R           eccutil.Point
	SignerBlind eccutil.Point
	IsUsed      bool
}

BlindingFactors contains the client-produced blinding factors

func NewBlindingFactors

func NewBlindingFactors(PubKey *eccutil.Point) BlindingFactors

NewBlindingFactors returns a new BlindingParamClient

func (BlindingFactors) Marshal

func (blindingFactors BlindingFactors) Marshal() ([]byte, error)

Marshal a BlindingParamClient

func (BlindingFactors) SchemeData

func (blindingFactors BlindingFactors) SchemeData() (string, genericblinding.DataType, *eccutil.Point)

SchemeData returns general data for the scheme and BlindingData type

func (BlindingFactors) UniqueID

func (blindingFactors BlindingFactors) UniqueID() []byte

UniqueID returns a unique ID for this element. Constant in this case (zeros)

func (BlindingFactors) Unmarshal

func (blindingFactors BlindingFactors) Unmarshal(b []byte) (genericblinding.BlindingData, error)

Unmarshal []byte into BlindingParamClient

type BlindingFactorsInt

type BlindingFactorsInt struct {
	N           *big.Int
	Hm          *big.Int
	R           *eccutil.Point
	SignerBlind *eccutil.Point
	// contains filtered or unexported fields
}

BlindingFactorsInt holds parameters required for unblinding

type BlindingParamClient

type BlindingParamClient struct {
	SchemeName string
	DataType   genericblinding.DataType
	PubKey     eccutil.Point
	Q          eccutil.Point // Public, given to requestor
}

BlindingParamClient is not needed in SNG

func NewBlindingParamClient

func NewBlindingParamClient(PubKey *eccutil.Point) BlindingParamClient

NewBlindingParamClient returns a new BlindingParamClient

func (BlindingParamClient) Marshal

func (blindingParamClient BlindingParamClient) Marshal() ([]byte, error)

Marshal a BlindingParamClient

func (BlindingParamClient) SchemeData

func (blindingParamClient BlindingParamClient) SchemeData() (string, genericblinding.DataType, *eccutil.Point)

SchemeData returns general data for the scheme and BlindingData type

func (BlindingParamClient) UniqueID

func (blindingParamClient BlindingParamClient) UniqueID() []byte

UniqueID returns a unique ID for this element. Constant in this case (zeros)

func (BlindingParamClient) Unmarshal

func (blindingParamClient BlindingParamClient) Unmarshal(b []byte) (genericblinding.BlindingData, error)

Unmarshal []byte into BlindingParamClient

type BlindingParamServer

type BlindingParamServer struct {
	SchemeName string
	DataType   genericblinding.DataType
	PubKey     eccutil.Point
	K          *big.Int      // Private, never share
	Q          eccutil.Point // Public, given to requestor
	R          *big.Int
	IsUsed     bool // Never use twice
}

BlindingParamServer is not needed in SNG

func NewBlindingParamServer

func NewBlindingParamServer(PubKey *eccutil.Point) BlindingParamServer

NewBlindingParamServer returns a new BlindingParamServer

func (BlindingParamServer) Marshal

func (blindingParamServer BlindingParamServer) Marshal() ([]byte, error)

Marshal a BlindingParamServer

func (BlindingParamServer) SchemeData

func (blindingParamServer BlindingParamServer) SchemeData() (string, genericblinding.DataType, *eccutil.Point)

SchemeData returns general data for the scheme and BlindingData type

func (BlindingParamServer) UniqueID

func (blindingParamServer BlindingParamServer) UniqueID() []byte

UniqueID returns a unique ID for this element. Constant in this case (zeros)

func (BlindingParamServer) Unmarshal

func (blindingParamServer BlindingParamServer) Unmarshal(b []byte) (genericblinding.BlindingData, error)

Unmarshal []byte into BlindingParamServer

type ClearMessage

type ClearMessage struct {
	SchemeName string
	DataType   genericblinding.DataType
	Message    []byte
}

ClearMessage contains a message

func NewClearMessage

func NewClearMessage(msg []byte) ClearMessage

NewClearMessage returns a new BlindingParamClient

func (ClearMessage) Marshal

func (clearMessage ClearMessage) Marshal() ([]byte, error)

Marshal a BlindingParamClient

func (ClearMessage) SchemeData

func (clearMessage ClearMessage) SchemeData() (string, genericblinding.DataType, *eccutil.Point)

SchemeData returns general data for the scheme and BlindingData type

func (ClearMessage) UniqueID

func (clearMessage ClearMessage) UniqueID() []byte

UniqueID returns a unique ID for this element. Constant in this case (zeros)

func (ClearMessage) Unmarshal

func (clearMessage ClearMessage) Unmarshal(b []byte) (genericblinding.BlindingData, error)

Unmarshal []byte into BlindingParamClient

type ClearSignature

type ClearSignature struct {
	SchemeName string
	DataType   genericblinding.DataType
	PubKey     eccutil.Point
	S          *big.Int
	R2         *big.Int
	R          eccutil.Point
	Hm         *big.Int
}

ClearSignature contains the client-produced blinding factors

func NewClearSignature

func NewClearSignature(PubKey *eccutil.Point) ClearSignature

NewClearSignature returns a new BlindingParamClient

func (ClearSignature) Marshal

func (clearSignature ClearSignature) Marshal() ([]byte, error)

Marshal a BlindingParamClient

func (ClearSignature) SchemeData

func (clearSignature ClearSignature) SchemeData() (string, genericblinding.DataType, *eccutil.Point)

SchemeData returns general data for the scheme and BlindingData type

func (ClearSignature) UniqueID

func (clearSignature ClearSignature) UniqueID() []byte

UniqueID returns a unique ID for this element. Constant in this case (zeros)

func (ClearSignature) Unmarshal

func (clearSignature ClearSignature) Unmarshal(b []byte) (genericblinding.BlindingData, error)

Unmarshal []byte into BlindingParamClient

type GenericSigner

type GenericSigner struct {
	Signer
}

GenericSigner is a generic interface signer instance

func NewGenericBlindingServer

func NewGenericBlindingServer(privkey []byte, pubkey *eccutil.Point, curve *eccutil.Curve) *GenericSigner

NewGenericBlindingServer returns a new signer

func (GenericSigner) GetParams

GetParams generates one-time BlindingParam

func (GenericSigner) Sign

Sign a BlindMessage usign BlindingParam

type GenericSignerClient

type GenericSignerClient struct {
	SignerClient
}

GenericSignerClient encapsulates a client to a signer using generic interface

func NewGenericBlindingClient

func NewGenericBlindingClient(pubkey *eccutil.Point, curve *eccutil.Curve) *GenericSignerClient

NewGenericBlindingClient returns a new client to a signer over curve with publickey

func (GenericSignerClient) Blind

Blind a ClearMessage with server-supplied BlindingParamClient

func (GenericSignerClient) Unblind

Unblind a BlindSignature of ClearMessage using BlindingFactors

func (GenericSignerClient) Verify

Verify that ClearSignature is a signature of ClearMessage

type SignParamsInt

type SignParamsInt struct {
	Q *eccutil.Point // Public, given to requestor
	// contains filtered or unexported fields
}

SignParamsInt encapsulates a single signature temporary key

type SignatureInt

type SignatureInt struct {
	S *big.Int

	R  *eccutil.Point
	Hm *big.Int
	// contains filtered or unexported fields
}

SignatureInt is a plain signature

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

Signer is a signer instance

func NewSigner

func NewSigner(privkey []byte, pubkey *eccutil.Point, curve *eccutil.Curve) *Signer

NewSigner returns a new signer

func (Signer) NewRequest

func (signer Signer) NewRequest() (signparams *SignParamsInt, err error)

NewRequest issues a new request keypair

func (Signer) Sign

func (signer Signer) Sign(blindMessage *BlindMessageInt, signParams *SignParamsInt) (S *BlindSignatureInt, err error)

Sign signs a blinded message

type SignerClient

type SignerClient struct {
	// contains filtered or unexported fields
}

SignerClient encapsulates a client to a signer

func NewSignerClient

func NewSignerClient(pubkey *eccutil.Point, curve *eccutil.Curve) *SignerClient

NewSignerClient returns a new client to a signer over curve with publickey

func (SignerClient) Blind

func (client SignerClient) Blind(message []byte, signerBlind *eccutil.Point) (blindMessage *BlindMessageInt, blindingFactors *BlindingFactorsInt, err error)

Blind blinds a message msg for signerBlind and returns the blinded message and the blinding factors

func (SignerClient) UnBlind

func (client SignerClient) UnBlind(blindSignature *BlindSignatureInt, blindingFactors *BlindingFactorsInt) (*SignatureInt, error)

UnBlind a signature using blinding factor

func (SignerClient) Verify

func (client SignerClient) Verify(message []byte, signature *SignatureInt) (bool, error)

Verify verifies that a signature signs message by the signer defined in SignerClient

Jump to

Keyboard shortcuts

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