sm9

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 17 Imported by: 4

README

This part codes mainly refer two projects:

  1. bn256, 主要是基域运算
  2. gmssl sm9,主要是2-4-12塔式扩域,以及r-ate等

SM9 Sign Benchmark

goos: windows
goarch: amd64
pkg: github.com/emmansun/gmsm/sm9
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
BenchmarkSign-6   	    1344	    871597 ns/op	   35870 B/op	    1013 allocs/op

SM9 Verify Benchmark

goos: windows
goarch: amd64
pkg: github.com/emmansun/gmsm/sm9
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
BenchmarkVerify-6   	     352	   3331673 ns/op	  237676 B/op	    6283 allocs/op

SM9 Encrypt(XOR) Benchmark

goos: windows
goarch: amd64
pkg: github.com/emmansun/gmsm/sm9
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
BenchmarkEncrypt-6   	    1120	    971188 ns/op	   38125 B/op	    1036 allocs/op

SM9 Decrypt(XOR) Benchmark

goos: windows
goarch: amd64
pkg: github.com/emmansun/gmsm/sm9
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
BenchmarkDecrypt-6   	     507	   2345492 ns/op	  202360 B/op	    5228 allocs/op

SM9 Generate User Sign Private Key Benchmark

goos: windows
goarch: amd64
pkg: github.com/emmansun/gmsm/sm9
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
BenchmarkGenerateSignPrivKey-6   	    8078	    147638 ns/op	    3176 B/op	      47 allocs/op

SM9 Generate User Encrypt Private Key Benchmark

goos: windows
goarch: amd64
pkg: github.com/emmansun/gmsm/sm9
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
BenchmarkGenerateEncryptPrivKey-6   	    3445	    326796 ns/op	    3433 B/op	      47 allocs/op

To further improve Verify()/Decrypt() performance, need to improve Pair() method performance.

Documentation

Overview

Package sm9 handle shangmi sm9 algorithm and its curves and pairing implementation

Index

Constants

View Source
const (
	// hashmode used in h1: 0x01
	H1 hashMode = 1 + iota
	// hashmode used in h2: 0x02
	H2
)
View Source
const (
	ENC_TYPE_XOR encryptType = 0
	ENC_TYPE_ECB encryptType = 1
	ENC_TYPE_CBC encryptType = 2
	ENC_TYPE_OFB encryptType = 4
	ENC_TYPE_CFB encryptType = 8
)

Variables

View Source
var Gen1 = &G1{curveGen}

Gen1 is the generator of G1.

View Source
var Gen2 = &G2{twistGen}

Gen2 is the generator of G2.

View Source
var Order = bigFromHex("b640000002a3a6f1d603ab4ff58ec74449f2934b18ea8beee56ee19cd69ecf25")

Order is the number of elements in both G₁ and G₂: 36u⁴+36u³+18u²+6u+1.

Functions

func Decrypt added in v0.13.0

func Decrypt(priv *EncryptPrivateKey, uid, ciphertext []byte) ([]byte, error)

Decrypt decrypt chipher, ciphertext should be with format C1||C3||C2

func DecryptASN1 added in v0.13.0

func DecryptASN1(priv *EncryptPrivateKey, uid, ciphertext []byte) ([]byte, error)

DecryptASN1 decrypt chipher, ciphertext should be with ASN.1 format according SM9 cryptographic algorithm application specification

func Encrypt added in v0.13.0

func Encrypt(rand io.Reader, pub *EncryptMasterPublicKey, uid []byte, hid byte, plaintext []byte) ([]byte, error)

Encrypt encrypt plaintext, output ciphertext with format C1||C3||C2

func EncryptASN1 added in v0.13.0

func EncryptASN1(rand io.Reader, pub *EncryptMasterPublicKey, uid []byte, hid byte, plaintext []byte) ([]byte, error)

EncryptASN1 encrypt plaintext and output ciphertext with ASN.1 format according SM9 cryptographic algorithm application specification

func GenerateKey

func GenerateKey(curve Curve, rand io.Reader) (priv []byte, x, y *big.Int, err error)

GenerateKey returns a public/private key pair. The private key is generated using the given reader, which must return random data.

func Marshal

func Marshal(curve Curve, x, y *big.Int) []byte

Marshal converts a point on the curve into the uncompressed form specified in SEC 1, Version 2.0, Section 2.3.3. If the point is not on the curve (or is the conventional point at infinity), the behavior is undefined.

func MarshalCompressed

func MarshalCompressed(curve Curve, x, y *big.Int) []byte

MarshalCompressed converts a point on the curve into the compressed form specified in SEC 1, Version 2.0, Section 2.3.3. If the point is not on the curve (or is the conventional point at infinity), the behavior is undefined.

func NewCurveGenerator added in v0.13.0

func NewCurveGenerator() *curvePoint

func NewCurvePoint added in v0.13.0

func NewCurvePoint() *curvePoint

func NewTwistGenerator added in v0.13.0

func NewTwistGenerator() *twistPoint

func NewTwistPoint added in v0.13.0

func NewTwistPoint() *twistPoint

func SignASN1 added in v0.13.0

func SignASN1(rand io.Reader, priv *SignPrivateKey, hash []byte) ([]byte, error)

SignASN1 signs a hash (which should be the result of hashing a larger message) using the private key, priv. It returns the ASN.1 encoded signature.

func Unmarshal

func Unmarshal(curve Curve, data []byte) (x, y *big.Int)

Unmarshal converts a point, serialized by Marshal, into an x, y pair. It is an error if the point is not in uncompressed form, is not on the curve, or is the point at infinity. On error, x = nil.

func UnmarshalCompressed

func UnmarshalCompressed(curve Curve, data []byte) (x, y *big.Int)

UnmarshalCompressed converts a point, serialized by MarshalCompressed, into an x, y pair. It is an error if the point is not in compressed form, is not on the curve, or is the point at infinity. On error, x = nil.

func UnwrappKey added in v0.13.0

func UnwrappKey(priv *EncryptPrivateKey, uid []byte, cipher *G1, kLen int) ([]byte, error)

UnwrappKey unwrapper key from cipher, user id and aligned key length

func Verify added in v0.13.0

func Verify(pub *SignMasterPublicKey, uid []byte, hid byte, hash []byte, h *big.Int, s *G1) bool

Verify verifies the signature in h, s of hash using the master dsa public key and user id, uid and hid. Its return value records whether the signature is valid.

func VerifyASN1 added in v0.13.0

func VerifyASN1(pub *SignMasterPublicKey, uid []byte, hid byte, hash, sig []byte) bool

VerifyASN1 verifies the ASN.1 encoded signature, sig, of hash using the public key, pub. Its return value records whether the signature is valid.

Types

type Curve

type Curve interface {
	// Params returns the parameters for the curve.
	Params() *CurveParams
	// IsOnCurve reports whether the given (x,y) lies on the curve.
	IsOnCurve(x, y *big.Int) bool
	// Add returns the sum of (x1,y1) and (x2,y2)
	Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int)
	// Double returns 2*(x,y)
	Double(x1, y1 *big.Int) (x, y *big.Int)
	// ScalarMult returns k*(Bx,By) where k is a number in big-endian form.
	ScalarMult(x1, y1 *big.Int, k []byte) (x, y *big.Int)
	// ScalarBaseMult returns k*G, where G is the base point of the group
	// and k is an integer in big-endian form.
	ScalarBaseMult(k []byte) (x, y *big.Int)
}

A Curve represents a short-form Weierstrass curve with a=0.

The behavior of Add, Double, and ScalarMult when the input is not a point on the curve is undefined.

Note that the conventional point at infinity (0, 0) is not considered on the curve, although it can be returned by Add, Double, ScalarMult, or ScalarBaseMult (but not the Unmarshal or UnmarshalCompressed functions).

type CurveParams

type CurveParams struct {
	P       *big.Int // the order of the underlying field
	N       *big.Int // the order of the base point
	B       *big.Int // the constant of the curve equation
	Gx, Gy  *big.Int // (x,y) of the base point
	BitSize int      // the size of the underlying field
	Name    string   // the canonical name of the curve
}

CurveParams contains the parameters of an elliptic curve and also provides a generic, non-constant time implementation of Curve.

func (*CurveParams) Add

func (curve *CurveParams) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)

func (*CurveParams) Double

func (curve *CurveParams) Double(x1, y1 *big.Int) (*big.Int, *big.Int)

func (*CurveParams) IsOnCurve

func (curve *CurveParams) IsOnCurve(x, y *big.Int) bool

func (*CurveParams) Params

func (curve *CurveParams) Params() *CurveParams

func (*CurveParams) ScalarBaseMult

func (curve *CurveParams) ScalarBaseMult(k []byte) (*big.Int, *big.Int)

func (*CurveParams) ScalarMult

func (curve *CurveParams) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)

type EncryptMasterPrivateKey added in v0.13.0

type EncryptMasterPrivateKey struct {
	EncryptMasterPublicKey
	D *big.Int
}

func GenerateEncryptMasterKey added in v0.13.0

func GenerateEncryptMasterKey(rand io.Reader) (*EncryptMasterPrivateKey, error)

GenerateEncryptMasterKey generates a master public and private key pair for encryption usage.

func (*EncryptMasterPrivateKey) GenerateUserKey added in v0.13.0

func (master *EncryptMasterPrivateKey) GenerateUserKey(uid []byte, hid byte) (*EncryptPrivateKey, error)

GenerateUserKey generate an user key for encryption.

func (*EncryptMasterPrivateKey) MarshalASN1 added in v0.13.0

func (master *EncryptMasterPrivateKey) MarshalASN1() ([]byte, error)

MarshalASN1 marshal encrypt master private key to asn.1 format data according SM9 cryptographic algorithm application specification

func (*EncryptMasterPrivateKey) Public added in v0.13.0

Public returns the public key corresponding to priv.

func (*EncryptMasterPrivateKey) UnmarshalASN1 added in v0.13.0

func (master *EncryptMasterPrivateKey) UnmarshalASN1(der []byte) error

UnmarshalASN1 unmarsal der data to encrpt master private key

type EncryptMasterPublicKey added in v0.13.0

type EncryptMasterPublicKey struct {
	MasterPublicKey *G1
	// contains filtered or unexported fields
}

func (*EncryptMasterPublicKey) Encrypt added in v0.13.0

func (pub *EncryptMasterPublicKey) Encrypt(rand io.Reader, uid []byte, hid byte, plaintext []byte) ([]byte, error)

Encrypt encrypt plaintext and output ciphertext with ASN.1 format according SM9 cryptographic algorithm application specification

func (*EncryptMasterPublicKey) GenerateUserPublicKey added in v0.13.0

func (pub *EncryptMasterPublicKey) GenerateUserPublicKey(uid []byte, hid byte) *G1

GenerateUserPublicKey generate user encrypt public key

func (*EncryptMasterPublicKey) MarshalASN1 added in v0.13.0

func (pub *EncryptMasterPublicKey) MarshalASN1() ([]byte, error)

MarshalASN1 marshal encrypt master public key to asn.1 format data according SM9 cryptographic algorithm application specification

func (*EncryptMasterPublicKey) Pair added in v0.13.0

func (pub *EncryptMasterPublicKey) Pair() *GT

func (*EncryptMasterPublicKey) ScalarBaseMult added in v0.13.0

func (pub *EncryptMasterPublicKey) ScalarBaseMult(r *big.Int) *GT

func (*EncryptMasterPublicKey) UnmarshalASN1 added in v0.13.0

func (pub *EncryptMasterPublicKey) UnmarshalASN1(der []byte) error

UnmarshalASN1 unmarsal der data to encrypt master public key

func (*EncryptMasterPublicKey) WrappKey added in v0.13.0

func (pub *EncryptMasterPublicKey) WrappKey(rand io.Reader, uid []byte, hid byte, kLen int) ([]byte, []byte, error)

WrappKey wrapp key and marshal the cipher as ASN1 format.

func (*EncryptMasterPublicKey) WrappKeyASN1 added in v0.13.0

func (pub *EncryptMasterPublicKey) WrappKeyASN1(rand io.Reader, uid []byte, hid byte, kLen int) ([]byte, error)

WrappKey wrapp key and marshal the result of SM9KeyPackage as ASN1 format. according SM9 cryptographic algorithm application specification

type EncryptPrivateKey added in v0.13.0

type EncryptPrivateKey struct {
	PrivateKey *G2
	EncryptMasterPublicKey
}

func (*EncryptPrivateKey) MarshalASN1 added in v0.13.0

func (priv *EncryptPrivateKey) MarshalASN1() ([]byte, error)

MarshalASN1 marshal encrypt user private key to asn.1 format data according SM9 cryptographic algorithm application specification

func (*EncryptPrivateKey) MasterPublic added in v0.13.0

func (priv *EncryptPrivateKey) MasterPublic() *EncryptMasterPublicKey

MasterPublic returns the master public key corresponding to priv.

func (*EncryptPrivateKey) SetMasterPublicKey added in v0.13.0

func (priv *EncryptPrivateKey) SetMasterPublicKey(pub *EncryptMasterPublicKey)

SetMasterPublicKey bind the encrypt master public key to it.

func (*EncryptPrivateKey) UnmarshalASN1 added in v0.13.0

func (priv *EncryptPrivateKey) UnmarshalASN1(der []byte) error

UnmarshalASN1 unmarsal der data to encrypt user private key Note, priv's EncryptMasterPublicKey should be handled separately.

func (*EncryptPrivateKey) UnwrappKey added in v0.13.0

func (priv *EncryptPrivateKey) UnwrappKey(uid, cipherDer []byte, kLen int) ([]byte, error)

type G1

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

G1 is an abstract cyclic group. The zero value is suitable for use as the output of an operation, but cannot be used as an input.

func RandomG1

func RandomG1(r io.Reader) (*big.Int, *G1, error)

RandomG1 returns x and g₁ˣ where x is a random, non-zero number read from r.

func Sign added in v0.13.0

func Sign(rand io.Reader, priv *SignPrivateKey, hash []byte) (h *big.Int, s *G1, err error)

Sign signs a hash (which should be the result of hashing a larger message) using the user dsa key. It returns the signature as a pair of h and s.

func UnmarshalSM9KeyPackage added in v0.13.0

func UnmarshalSM9KeyPackage(der []byte) ([]byte, *G1, error)

UnmarshalSM9KeyPackage is an utility to unmarshal SM9KeyPackage

func WrappKey added in v0.13.0

func WrappKey(rand io.Reader, pub *EncryptMasterPublicKey, uid []byte, hid byte, kLen int) (key []byte, cipher *G1, err error)

WrappKey generate and wrapp key wtih reciever's uid and system hid

func (*G1) Add

func (e *G1) Add(a, b *G1) *G1

Add sets e to a+b and then returns e.

func (*G1) Double

func (e *G1) Double(a *G1) *G1

Double sets e to [2]a and then returns e.

func (*G1) Marshal

func (e *G1) Marshal() []byte

Marshal converts e to a byte slice.

func (*G1) MarshalUncompressed added in v0.13.0

func (e *G1) MarshalUncompressed() []byte

Marshal converts e to a byte slice with prefix

func (*G1) Neg

func (e *G1) Neg(a *G1) *G1

Neg sets e to -a and then returns e.

func (*G1) ScalarBaseMult

func (e *G1) ScalarBaseMult(k *big.Int) *G1

ScalarBaseMult sets e to g*k where g is the generator of the group and then returns e.

func (*G1) ScalarMult

func (e *G1) ScalarMult(a *G1, k *big.Int) *G1

ScalarMult sets e to a*k and then returns e.

func (*G1) Set

func (e *G1) Set(a *G1) *G1

Set sets e to a and then returns e.

func (*G1) String

func (g *G1) String() string

func (*G1) Unmarshal

func (e *G1) Unmarshal(m []byte) ([]byte, error)

Unmarshal sets e to the result of converting the output of Marshal back into a group element and then returns e.

type G1Curve

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

func (*G1Curve) Add

func (g1 *G1Curve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)

func (*G1Curve) Double

func (g1 *G1Curve) Double(x, y *big.Int) (*big.Int, *big.Int)

func (*G1Curve) IsOnCurve

func (g1 *G1Curve) IsOnCurve(x, y *big.Int) bool

func (*G1Curve) Params

func (g1 *G1Curve) Params() *CurveParams

func (*G1Curve) ScalarBaseMult

func (g1 *G1Curve) ScalarBaseMult(k []byte) (*big.Int, *big.Int)

func (*G1Curve) ScalarMult

func (g1 *G1Curve) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)

func (*G1Curve) Unmarshal

func (curve *G1Curve) Unmarshal(data []byte) (x, y *big.Int)

func (*G1Curve) UnmarshalCompressed

func (curve *G1Curve) UnmarshalCompressed(data []byte) (x, y *big.Int)

type G2

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

G2 is an abstract cyclic group. The zero value is suitable for use as the output of an operation, but cannot be used as an input.

func RandomG2

func RandomG2(r io.Reader) (*big.Int, *G2, error)

RandomG2 returns x and g₂ˣ where x is a random, non-zero number read from r.

func (*G2) Add

func (e *G2) Add(a, b *G2) *G2

Add sets e to a+b and then returns e.

func (*G2) Marshal

func (e *G2) Marshal() []byte

Marshal converts e into a byte slice.

func (*G2) MarshalUncompressed added in v0.13.0

func (e *G2) MarshalUncompressed() []byte

Marshal converts e into a byte slice with prefix

func (*G2) Neg

func (e *G2) Neg(a *G2) *G2

Neg sets e to -a and then returns e.

func (*G2) ScalarBaseMult

func (e *G2) ScalarBaseMult(k *big.Int) *G2

ScalarBaseMult sets e to g*k where g is the generator of the group and then returns out.

func (*G2) ScalarMult

func (e *G2) ScalarMult(a *G2, k *big.Int) *G2

ScalarMult sets e to a*k and then returns e.

func (*G2) Set

func (e *G2) Set(a *G2) *G2

Set sets e to a and then returns e.

func (*G2) String

func (e *G2) String() string

func (*G2) Unmarshal

func (e *G2) Unmarshal(m []byte) ([]byte, error)

Unmarshal sets e to the result of converting the output of Marshal back into a group element and then returns e.

type GT

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

GT is an abstract cyclic group. The zero value is suitable for use as the output of an operation, but cannot be used as an input.

func Miller

func Miller(g1 *G1, g2 *G2) *GT

Miller applies Miller's algorithm, which is a bilinear function from the source groups to F_p^12. Miller(g1, g2).Finalize() is equivalent to Pair(g1, g2).

func Pair

func Pair(g1 *G1, g2 *G2) *GT

Pair calculates an R-Ate pairing.

func RandomGT

func RandomGT(r io.Reader) (*big.Int, *GT, error)

RandomGT returns x and e(g₁, g₂)ˣ where x is a random, non-zero number read from r.

func (*GT) Add

func (e *GT) Add(a, b *GT) *GT

Add sets e to a+b and then returns e.

func (*GT) Finalize

func (e *GT) Finalize() *GT

Finalize is a linear function from F_p^12 to GT.

func (*GT) Marshal

func (e *GT) Marshal() []byte

Marshal converts e into a byte slice.

func (*GT) Neg

func (e *GT) Neg(a *GT) *GT

Neg sets e to -a and then returns e.

func (*GT) ScalarBaseMult

func (e *GT) ScalarBaseMult(k *big.Int) *GT

ScalarBaseMult sets e to g*k where g is the generator of the group and then returns out.

func (*GT) ScalarMult

func (e *GT) ScalarMult(a *GT, k *big.Int) *GT

ScalarMult sets e to a*k and then returns e.

func (*GT) Set

func (e *GT) Set(a *GT) *GT

Set sets e to a and then returns e.

func (*GT) SetOne added in v0.13.0

func (e *GT) SetOne() *GT

Set sets e to one and then returns e.

func (*GT) String

func (g *GT) String() string

func (*GT) Unmarshal

func (e *GT) Unmarshal(m []byte) ([]byte, error)

Unmarshal sets e to the result of converting the output of Marshal back into a group element and then returns e.

type SignMasterPrivateKey added in v0.13.0

type SignMasterPrivateKey struct {
	SignMasterPublicKey
	D *big.Int
}

func GenerateSignMasterKey added in v0.13.0

func GenerateSignMasterKey(rand io.Reader) (*SignMasterPrivateKey, error)

GenerateSignMasterKey generates a master public and private key pair for DSA usage.

func (*SignMasterPrivateKey) GenerateUserKey added in v0.13.0

func (master *SignMasterPrivateKey) GenerateUserKey(uid []byte, hid byte) (*SignPrivateKey, error)

GenerateUserKey generate an user dsa key.

func (*SignMasterPrivateKey) MarshalASN1 added in v0.13.0

func (master *SignMasterPrivateKey) MarshalASN1() ([]byte, error)

MarshalASN1 marshal sign master private key to asn.1 format data according SM9 cryptographic algorithm application specification

func (*SignMasterPrivateKey) Public added in v0.13.0

func (master *SignMasterPrivateKey) Public() *SignMasterPublicKey

Public returns the public key corresponding to priv.

func (*SignMasterPrivateKey) UnmarshalASN1 added in v0.13.0

func (master *SignMasterPrivateKey) UnmarshalASN1(der []byte) error

UnmarshalASN1 unmarsal der data to sign master private key

type SignMasterPublicKey added in v0.13.0

type SignMasterPublicKey struct {
	MasterPublicKey *G2
	// contains filtered or unexported fields
}

func (*SignMasterPublicKey) GenerateUserPublicKey added in v0.13.0

func (pub *SignMasterPublicKey) GenerateUserPublicKey(uid []byte, hid byte) *G2

GenerateUserPublicKey generate user sign public key

func (*SignMasterPublicKey) MarshalASN1 added in v0.13.0

func (pub *SignMasterPublicKey) MarshalASN1() ([]byte, error)

MarshalASN1 marshal sign master public key to asn.1 format data according SM9 cryptographic algorithm application specification

func (*SignMasterPublicKey) Pair added in v0.13.0

func (pub *SignMasterPublicKey) Pair() *GT

func (*SignMasterPublicKey) ScalarBaseMult added in v0.13.0

func (pub *SignMasterPublicKey) ScalarBaseMult(r *big.Int) *GT

func (*SignMasterPublicKey) UnmarshalASN1 added in v0.13.0

func (pub *SignMasterPublicKey) UnmarshalASN1(der []byte) error

UnmarshalASN1 unmarsal der data to sign master public key

func (*SignMasterPublicKey) Verify added in v0.13.0

func (pub *SignMasterPublicKey) Verify(uid []byte, hid byte, hash, sig []byte) bool

Verify verifies the ASN.1 encoded signature, sig, of hash using the public key, pub. Its return value records whether the signature is valid.

type SignPrivateKey added in v0.13.0

type SignPrivateKey struct {
	PrivateKey *G1
	SignMasterPublicKey
}

func (*SignPrivateKey) MarshalASN1 added in v0.13.0

func (priv *SignPrivateKey) MarshalASN1() ([]byte, error)

MarshalASN1 marshal sign user private key to asn.1 format data according SM9 cryptographic algorithm application specification

func (*SignPrivateKey) MasterPublic added in v0.13.0

func (priv *SignPrivateKey) MasterPublic() *SignMasterPublicKey

MasterPublic returns the master public key corresponding to priv.

func (*SignPrivateKey) SetMasterPublicKey added in v0.13.0

func (priv *SignPrivateKey) SetMasterPublicKey(pub *SignMasterPublicKey)

SetMasterPublicKey bind the sign master public key to it.

func (*SignPrivateKey) Sign added in v0.13.0

func (priv *SignPrivateKey) Sign(rand io.Reader, hash []byte, opts crypto.SignerOpts) ([]byte, error)

Sign signs digest with user's DSA key, reading randomness from rand. The opts argument is not currently used but, in keeping with the crypto.Signer interface.

func (*SignPrivateKey) UnmarshalASN1 added in v0.13.0

func (priv *SignPrivateKey) UnmarshalASN1(der []byte) error

UnmarshalASN1 unmarsal der data to sign user private key Note, priv's SignMasterPublicKey should be handled separately.

Jump to

Keyboard shortcuts

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