common

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CurveOrder is the order of the secp256k1 elliptic curve.
	CurveOrder = secp256k1.S256().Params().N

	// CurveOrderHalf = CurveOrder / 2.
	CurveOrderHalf = new(big.Int).Div(CurveOrder, new(big.Int).SetUint64(2))
)

Functions

func KmsToEVMSignature

func KmsToEVMSignature(pubKey ecdsa.PublicKey,
	kmsSig KmsSignature,
	digestedMsg common.Hash,
) ([]byte, error)

KmsToEVMSignature converts a KmsSignature into an EVM-compatible signature of the following form: r || s || v, with v either 0 or 1. The `WithSignature` function will adjust the value of v based on the Signer type (types.Signer). Reference: https://eips.ethereum.org/EIPS/eip-155.

Types

type KmsSignature

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

KmsSignature represents decoded signatures returned from the KMS.

A KmsSignature only consists of 2 points: R, S. In order for it to be EVM-compatible, we need to manually convert it to the (r || s || v) form.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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