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: 14 Imported by: 0

Documentation

Overview

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLowS

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

IsLow checks that s is a low-S

func PemDecodeKey

func PemDecodeKey(keyBytes []byte) (interface{}, error)

PemDecodeKey takes bytes and returns a Go key

func PemEncodeKey

func PemEncodeKey(key interface{}) ([]byte, error)

PemEncodeKey takes a Go key and converts it to bytes

func ToLowS

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

Types

type ECDSASignature

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

type ECDSASigner

type ECDSASigner struct {
	*ECDSAVerifier
	SK *ecdsa.PrivateKey
}

func NewECDSASigner

func NewECDSASigner() (*ECDSASigner, error)

func (*ECDSASigner) Serialize

func (s *ECDSASigner) Serialize() ([]byte, error)

func (*ECDSASigner) Sign

func (d *ECDSASigner) Sign(message []byte) ([]byte, error)

type ECDSAVerifier

type ECDSAVerifier struct {
	PK *ecdsa.PublicKey
}

func NewECDSAVerifier

func NewECDSAVerifier(pk *ecdsa.PublicKey) *ECDSAVerifier

func (*ECDSAVerifier) Serialize

func (v *ECDSAVerifier) Serialize() ([]byte, error)

func (*ECDSAVerifier) Verify

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

Jump to

Keyboard shortcuts

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