eckcdsa

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package eckcdsa implements the EC-KCDSA(Korean Certificate-based Digital Signature Algorithm using Elliptic Curves) as defined in TTAK.KO-12.0015/R3

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParametersNotSetUp = errors.New("krypto/eckcdsa: parameters not set up before generating key")
	ErrInvalidK           = errors.New("krypto/eckcdsa: use another K")
)

Functions

func Sign

func Sign(randReader io.Reader, priv *PrivateKey, h hash.Hash, M []byte) (r, s *big.Int, err error)

Sign data using K generated randomly like in crypto/ecdsa packages.

func SignUsingK

func SignUsingK(k *big.Int, priv *PrivateKey, h hash.Hash, M []byte) (r, s *big.Int, err error)

Sign data using K Specified

func Verify

func Verify(pub *PublicKey, h hash.Hash, M []byte, r, s *big.Int) bool

Types

type PrivateKey

type PrivateKey struct {
	PublicKey
	D *big.Int
}

func GenerateKey

func GenerateKey(c elliptic.Curve, randReader io.Reader) (*PrivateKey, error)

Generate the paramters

func (*PrivateKey) Public added in v1.2.2

func (priv *PrivateKey) Public() crypto.PublicKey

Public returns the public key corresponding to priv.

type PublicKey

type PublicKey struct {
	elliptic.Curve

	X *big.Int
	Y *big.Int
}

func (*PublicKey) Equal added in v1.2.2

func (pub *PublicKey) Equal(x crypto.PublicKey) bool

Equal reports whether pub and x have the same value.

Jump to

Keyboard shortcuts

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