ecdsa

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurveHalfOrdersAt

func GetCurveHalfOrdersAt(c elliptic.Curve) *big.Int

func IsLowS

func IsLowS(k *ecdsa.PublicKey, s *big.Int) (bool, error)

IsLowS checks that s is a low-S

func NewIdentityFromBytes

func NewIdentityFromBytes(raw []byte) (view.Identity, driver.Verifier, error)

func NewIdentityFromPEMCert

func NewIdentityFromPEMCert(raw []byte) (view.Identity, driver.Verifier, error)

func NewSigner

func NewSigner() (view.Identity, driver.Signer, driver.Verifier, error)

func NewSignerFromPEM

func NewSignerFromPEM(raw []byte) (driver.Signer, error)

func NewTwoPartyCollectEphemeralKeysView

func NewTwoPartyCollectEphemeralKeysView(other view.Identity) *twoPartyCollectEphemeralKeyView

func NewTwoPartyEphemeralKeyResponderView

func NewTwoPartyEphemeralKeyResponderView() *twoPartyEphemeralKeyResponderView

Types

type Signature

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

type Signer

type Signer struct {
	PrivateKey *ecdsa.PrivateKey
}

Signer implements the crypto.Signer interface for ECDSA keys. The Sign method ensures signatures are created with Low S values since Fabric normalizes all signatures to Low S. See https://github.com/bitcoin/bips/blob/master/bip-0146.mediawiki#low_s for more detail.

func (*Signer) Public

func (e *Signer) Public() crypto.PublicKey

Public returns the ecdsa.PublicKey associated with PrivateKey.

func (*Signer) Sign

func (e *Signer) Sign(message []byte) ([]byte, error)

Sign signs the digest and ensures that signatures use the Low S value.

type Verifier

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

func (Verifier) Verify

func (d Verifier) Verify(message, sigma []byte) error

Jump to

Keyboard shortcuts

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