engine

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CurveEngine

type CurveEngine interface {
	SetRandomProvider(rand Rand)

	GetBGS() int
	GetBFS() int
	GetG1S() int
	GetG2S() int
	GetSecretKeySize() int
	GetPublicKeySize() int

	KeyPairFromBytes(S []byte) (*KeyPair, error)
	KeyPairGenerateIKM(IKM []byte) (*KeyPair, error)
	KeyPairGenerate() (*KeyPair, error)
	GeneratePublicKey(S []byte) ([]byte, error)

	Sign(M []byte, S []byte) (*Signature1, error)
	FirstVerify(sig *Signature1, M []byte, W []byte) bool
	Verify(sig *Signature2, M []byte, W []byte) bool

	Signature1FromBytes(data []byte) *Signature1
	Signature2FromBytes(data []byte) *Signature2

	PrsResigningKey(SignerW2 []byte, ReSignerS []byte) ([]byte, error)
	PrsResign(inSig *Signature1, RK []byte) (*Signature2, error)
}

type CurveEngineBls12381Impl

type CurveEngineBls12381Impl struct {
	CurveEngine
	// contains filtered or unexported fields
}

func NewBLS12381Engine

func NewBLS12381Engine() (*CurveEngineBls12381Impl, error)

func (*CurveEngineBls12381Impl) BIGCurveOrder

func (e *CurveEngineBls12381Impl) BIGCurveOrder() *BLS12381.BIG

func (*CurveEngineBls12381Impl) BIGToTrimmedBytes

func (e *CurveEngineBls12381Impl) BIGToTrimmedBytes(big *BLS12381.BIG) []byte

func (*CurveEngineBls12381Impl) FirstVerify

func (e *CurveEngineBls12381Impl) FirstVerify(sig *Signature1, M []byte, W []byte) bool

func (*CurveEngineBls12381Impl) GeneratePublicKey

func (e *CurveEngineBls12381Impl) GeneratePublicKey(S []byte) ([]byte, error)

func (*CurveEngineBls12381Impl) GetBFS

func (e *CurveEngineBls12381Impl) GetBFS() int

func (*CurveEngineBls12381Impl) GetBGS

func (e *CurveEngineBls12381Impl) GetBGS() int

func (*CurveEngineBls12381Impl) GetG1S

func (e *CurveEngineBls12381Impl) GetG1S() int

func (*CurveEngineBls12381Impl) GetG2S

func (e *CurveEngineBls12381Impl) GetG2S() int

func (*CurveEngineBls12381Impl) GetPublicKeySize

func (e *CurveEngineBls12381Impl) GetPublicKeySize() int

func (*CurveEngineBls12381Impl) GetSecretKeySize

func (e *CurveEngineBls12381Impl) GetSecretKeySize() int

func (*CurveEngineBls12381Impl) KeyPairFromBytes

func (e *CurveEngineBls12381Impl) KeyPairFromBytes(S []byte) (*KeyPair, error)

func (*CurveEngineBls12381Impl) KeyPairGenerate

func (e *CurveEngineBls12381Impl) KeyPairGenerate() (*KeyPair, error)

func (*CurveEngineBls12381Impl) KeyPairGenerateIKM

func (e *CurveEngineBls12381Impl) KeyPairGenerateIKM(IKM []byte) (*KeyPair, error)

func (*CurveEngineBls12381Impl) PrsResign

func (e *CurveEngineBls12381Impl) PrsResign(inSig *Signature1, RK []byte) (*Signature2, error)

func (*CurveEngineBls12381Impl) PrsResigningKey

func (e *CurveEngineBls12381Impl) PrsResigningKey(SignerW2 []byte, ReSignerS []byte) ([]byte, error)

func (*CurveEngineBls12381Impl) SetRandomProvider

func (e *CurveEngineBls12381Impl) SetRandomProvider(rand Rand)

func (*CurveEngineBls12381Impl) Sign

func (e *CurveEngineBls12381Impl) Sign(M []byte, S []byte) (*Signature1, error)

func (*CurveEngineBls12381Impl) Signature1FromBytes

func (e *CurveEngineBls12381Impl) Signature1FromBytes(data []byte) *Signature1

func (*CurveEngineBls12381Impl) Signature2FromBytes

func (e *CurveEngineBls12381Impl) Signature2FromBytes(data []byte) *Signature2

func (*CurveEngineBls12381Impl) Verify

func (e *CurveEngineBls12381Impl) Verify(sig *Signature2, M []byte, W []byte) bool

type KeyPair

type KeyPair struct {
	S  []byte // private
	W1 []byte // public G1
	W2 []byte // public G2
}

type Rand

type Rand = func() byte

type Signable

type Signable interface {
	// contains filtered or unexported methods
}

type Signature1

type Signature1 struct {
	R []byte
	S []byte
}

func (*Signature1) Encode

func (s *Signature1) Encode() []byte

type Signature2

type Signature2 struct {
	R []byte
	S []byte
}

func (*Signature2) Encode

func (s *Signature2) Encode() []byte

Jump to

Keyboard shortcuts

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