common

package
v0.0.0-...-05508b9 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ECDSA签名算法
	ECDSA = "ECDSA"
	// Schnorr签名算法,EDDSA的前身
	Schnorr = "Schnorr"
	// Schnorr环签名算法
	SchnorrRing = "SchnorrRing"
	// 多重签名算法
	MultiSig = "MultiSig"
	// 门限签名算法
	TssSig = "TssSig"
	// Bls签名算法
	BlsSig = "BlsSig"
)

定义签名中所包含的标记符的值,及其所对应的签名算法的类型

Variables

View Source
var (
	InvalidInputParamsError        = errors.New("Invalid input params")
	NotExactTheSameCurveInputError = errors.New("The private keys of all the keys are not using the the same curve")

	TooSmallNumOfkeysError = errors.New("The total num of keys should be greater than one")
	EmptyMessageError      = errors.New("Message to be sign should not be nil")
	InValidSignatureError  = errors.New("XuperSignature is invalid")
)

Functions

func MarshalXuperSignature

func MarshalXuperSignature(sig *XuperSignature) ([]byte, error)

Types

type BlsSignature

type BlsSignature struct {
	S []byte
}

BLS签名

type ECDSASignature

type ECDSASignature struct {
	R, S *big.Int
}

ECDSA签名

type MultiSignature

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

多重签名

type PublicKeyFactor

type PublicKeyFactor struct {
	X, Y *big.Int
}

type RingSignature

type RingSignature struct {
	CurveName string
	Members   []*PublicKeyFactor
	E         *big.Int
	S         []*big.Int
}

Schnorr环签名

type SchnorrSignature

type SchnorrSignature struct {
	E, S *big.Int
}

Schnorr签名,EDDSA的前身

type TssSignature

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

门限签名

type XuperSignature

type XuperSignature struct {
	SigType    string
	SigContent []byte
}

统一的签名结构

Jump to

Keyboard shortcuts

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