jcc

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 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

View Source
const MaxLoopCount = 1000

MaxLoopCount is the maximum number of tries we do for parameter search

View Source
const SchemeName = "JCC"

SchemeName is the name of this blinding scheme

Variables

This section is empty.

Functions

func Fakeunique

func Fakeunique(x [32]byte) bool

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

type BlindingClient struct {
	PubKey *eccutil.Point
	// contains filtered or unexported fields
}

BlindingClient a blinding client

func NewBlindingClient

func NewBlindingClient(curve *eccutil.Curve, pubKey *eccutil.Point) *BlindingClient

NewBlindingClient returns a new BlindingClient

func (BlindingClient) Blind

func (client BlindingClient) Blind(msg []byte) (bmsg *eccutil.Point, bfac []byte, err error)

Blind returns a blinded message and the blinding factor. bmsg is sent to signer (public), bfac is private and needed for unblinding

func (BlindingClient) Unblind

func (client BlindingClient) Unblind(bfac, msg []byte, s *eccutil.Point) (sb *eccutil.Point, mb []byte)

Unblind unblinds a signature. sb and mb are required for verification

func (BlindingClient) Verify

func (client BlindingClient) Verify(r, sb *eccutil.Point, mb []byte) bool

Verify a signature

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

type BlindingServer struct {
	PubKey *eccutil.Point
	// contains filtered or unexported fields
}

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

func (BlindingServer) Sign

func (bs BlindingServer) Sign(bmsg *eccutil.Point) (r, s *eccutil.Point, err error)

Sign a blind message, return signature. callback for checking bmsg -> nv uniqueness. r and s are returned to client. r is public for verification

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

Blind returns a blinded message and the blinding factor. BlindingParamClient can be nil

func (GenericBlindingClient) Verify

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

GetParams returns signature request parameters. Unused in JCC

func (GenericBlindingServer) Sign

Sign a message. BlindingParamServer can be nil (not used in JCC)

Jump to

Keyboard shortcuts

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