Documentation ¶
Overview ¶
Package jcc implements "An ECC-Based Blind Signature Scheme" by Fuh-Gwo Jeng, Tzer-Long Chen and Tzer-Shyong Chen A lot of the sanity checks performed by the code make no mathematical sense since they are impossible to produce if the code is actually bug-less Under certain conditions both msg and the image of the msg have valid signatures (implausible)
Generate key:
Private key == blinding factor (ni)
Blind:
blind message = scalarmult(message,scalarmult(blinding factor, PublicKey)) (POINT)
Sign:
r = nv x blind message (POINT); s = (nv+ns) x blind message (POINT) ns is the privat key of the signer record nv,blind message. protect priv-key of signer
Unblind:
s' = s - m x ni x Ps (Ps public key signer) (POINT) m' = ni(ni-1)m
Verify:
r == s' - m' x Ps
Public data:
Signer: Public Key. Private key and token remain secret Client: Blind() output: bmsg is public and sent to Signer. bfac is secret, needed for unblinding bfac should be destroyed after unblind (and verification) Blind() input msg must be retained until unblinding and destroyed after Signature (r, sb, mb): From signer -> r From client -> Output of Unblind(): sb, mb Verification operates on: Signer public key, Signature(r, sb, mb)
For more information: http://ojs.academypublisher.com/index.php/jnw/article/viewFile/0508921928/2053
Index ¶
- Constants
- func Fakeunique(x [32]byte) bool
- type BlindMessage
- type BlindSignature
- func (blindSignature BlindSignature) Marshal() ([]byte, error)
- func (blindSignature BlindSignature) SchemeData() (string, genericblinding.DataType, *eccutil.Point)
- func (blindSignature BlindSignature) UniqueID() []byte
- func (blindSignature BlindSignature) Unmarshal(b []byte) (genericblinding.BlindingData, error)
- type BlindingClient
- type BlindingFactors
- func (blindingFactors BlindingFactors) Marshal() ([]byte, error)
- func (blindingFactors BlindingFactors) SchemeData() (string, genericblinding.DataType, *eccutil.Point)
- func (blindingFactors BlindingFactors) UniqueID() []byte
- func (blindingFactors BlindingFactors) Unmarshal(b []byte) (genericblinding.BlindingData, error)
- type BlindingParamClient
- func (blindingParamClient BlindingParamClient) Marshal() ([]byte, error)
- func (blindingParamClient BlindingParamClient) SchemeData() (string, genericblinding.DataType, *eccutil.Point)
- func (blindingParamClient BlindingParamClient) UniqueID() []byte
- func (blindingParamClient BlindingParamClient) Unmarshal(b []byte) (genericblinding.BlindingData, error)
- type BlindingParamServer
- func (blindingParamServer BlindingParamServer) Marshal() ([]byte, error)
- func (blindingParamServer BlindingParamServer) SchemeData() (string, genericblinding.DataType, *eccutil.Point)
- func (blindingParamServer BlindingParamServer) UniqueID() []byte
- func (blindingParamServer BlindingParamServer) Unmarshal(b []byte) (genericblinding.BlindingData, error)
- type BlindingServer
- type ClearMessage
- type ClearSignature
- func (clearSignature ClearSignature) Marshal() ([]byte, error)
- func (clearSignature ClearSignature) SchemeData() (string, genericblinding.DataType, *eccutil.Point)
- func (clearSignature ClearSignature) UniqueID() []byte
- func (clearSignature ClearSignature) Unmarshal(b []byte) (genericblinding.BlindingData, error)
- type GenericBlindingClient
- func (client GenericBlindingClient) Blind(bpci genericblinding.BlindingParamClient, cmi genericblinding.ClearMessage) (genericblinding.BlindingFactors, genericblinding.BlindMessage, error)
- func (client GenericBlindingClient) Unblind(bfi genericblinding.BlindingFactors, cmi genericblinding.ClearMessage, ...) (genericblinding.ClearSignature, genericblinding.ClearMessage, error)
- func (client GenericBlindingClient) Verify(csi genericblinding.ClearSignature, cmi genericblinding.ClearMessage) (bool, error)
- type GenericBlindingServer
Constants ¶
const MaxLoopCount = 1000
MaxLoopCount is the maximum number of tries we do for parameter search
const SchemeName = "JCC"
SchemeName is the name of this blinding scheme
Variables ¶
This section is empty.
Functions ¶
func Fakeunique ¶
Fakeunique is a test function for the uniqueness-test. Must be implemented for production use
Types ¶
type BlindMessage ¶
type BlindMessage struct { SchemeName string DataType genericblinding.DataType PubKey eccutil.Point Message 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 BlindSignature ¶
type BlindSignature struct { SchemeName string DataType genericblinding.DataType PubKey eccutil.Point R, S eccutil.Point }
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 BlindingClient ¶
BlindingClient a blinding client
func NewBlindingClient ¶
func NewBlindingClient(curve *eccutil.Curve, pubKey *eccutil.Point) *BlindingClient
NewBlindingClient returns a new BlindingClient
func (BlindingClient) Blind ¶
Blind returns a blinded message and the blinding factor. bmsg is sent to signer (public), bfac is private and needed for unblinding
type BlindingFactors ¶
type BlindingFactors struct { SchemeName string DataType genericblinding.DataType PubKey eccutil.Point Factor []byte }
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 BlindingParamClient ¶
type BlindingParamClient struct { SchemeName string DataType genericblinding.DataType PubKey eccutil.Point }
BlindingParamClient is not needed in JCC
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 }
BlindingParamServer is not needed in JCC
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 BlindingServer ¶
BlindingServer is holds a blinding server
func NewBlindingServer ¶
func NewBlindingServer(privkey []byte, pubkey *eccutil.Point, curve *eccutil.Curve, uniqueTest func([32]byte) bool) *BlindingServer
NewBlindingServer creates a new BlindingServer
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 SB, R eccutil.Point }
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 GenericBlindingClient ¶
type GenericBlindingClient struct {
BlindingClient
}
GenericBlindingClient a blinding client using the generic interface
func NewGenericBlindingClient ¶
func NewGenericBlindingClient(curve *eccutil.Curve, pubKey *eccutil.Point) *GenericBlindingClient
NewGenericBlindingClient returns a new GenericBlindingClient
func (GenericBlindingClient) Blind ¶
func (client GenericBlindingClient) Blind(bpci genericblinding.BlindingParamClient, cmi genericblinding.ClearMessage) (genericblinding.BlindingFactors, genericblinding.BlindMessage, error)
Blind returns a blinded message and the blinding factor. BlindingParamClient can be nil
func (GenericBlindingClient) Unblind ¶
func (client GenericBlindingClient) Unblind(bfi genericblinding.BlindingFactors, cmi genericblinding.ClearMessage, bsi genericblinding.BlindSignature) (genericblinding.ClearSignature, genericblinding.ClearMessage, error)
Unblind unblinds a signature
func (GenericBlindingClient) Verify ¶
func (client GenericBlindingClient) Verify(csi genericblinding.ClearSignature, cmi genericblinding.ClearMessage) (bool, error)
Verify a signature
type GenericBlindingServer ¶
type GenericBlindingServer struct {
BlindingServer
}
GenericBlindingServer is holds a blinding server
func NewGenericBlindingServer ¶
func NewGenericBlindingServer(privkey []byte, pubkey *eccutil.Point, curve *eccutil.Curve, uniqueTest func([32]byte) bool) *GenericBlindingServer
NewGenericBlindingServer creates a new BlindingServer
func (GenericBlindingServer) GetParams ¶
func (server GenericBlindingServer) GetParams() (genericblinding.BlindingParamClient, genericblinding.BlindingParamServer, error)
GetParams returns signature request parameters. Unused in JCC
func (GenericBlindingServer) Sign ¶
func (server GenericBlindingServer) Sign(bpsi genericblinding.BlindingParamServer, bmi genericblinding.BlindMessage) (genericblinding.BlindSignature, error)
Sign a message. BlindingParamServer can be nil (not used in JCC)