starkkey

package
v2.6.1-mercury-20231117 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReportToSigData added in v2.3.0

func ReportToSigData(reportCtx types.ReportContext, report types.Report) (*big.Int, error)

func ToEncryptedJSON

func ToEncryptedJSON(key Key, password string, scryptParams utils.ScryptParams) (export []byte, err error)

ToEncryptedJSON returns encrypted JSON representing key

Types

type Key added in v2.3.0

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

Key represents Starknet key

func FromEncryptedJSON

func FromEncryptedJSON(keyJSON []byte, password string) (Key, error)

FromEncryptedJSON gets key from json and password

func GenerateKey added in v2.3.0

func GenerateKey(material io.Reader) (k Key, err error)

reimplements parts of https://github.com/smartcontractkit/caigo/blob/main/utils.go#L85 generate the PK as a pseudo-random number in the interval [1, CurveOrder - 1] using io.Reader, and Key struct

func MustNewInsecure added in v2.3.0

func MustNewInsecure(reader io.Reader) Key

MustNewInsecure return Key if no error

func New added in v2.3.0

func New() (Key, error)

New creates new Key

func (Key) GoString added in v2.3.0

func (key Key) GoString() string

GoString wraps String()

func (Key) ID added in v2.3.0

func (key Key) ID() string

ID gets Key ID

func (Key) PublicKey added in v2.3.0

func (key Key) PublicKey() PublicKey

PublicKey copies public key object

func (Key) Raw added in v2.3.0

func (key Key) Raw() Raw

Raw from private key

func (Key) StarkKeyStr added in v2.3.0

func (key Key) StarkKeyStr() string

StarkKeyStr is the starknet public key associated to the private key it is the X component of the ECDSA pubkey and used in the deployment of the account contract this func is used in exporting it via CLI and API

func (Key) String added in v2.3.0

func (key Key) String() string

String is the print-friendly format of the Key

func (Key) ToPrivKey added in v2.3.0

func (key Key) ToPrivKey() *big.Int

ToPrivKey returns the key usable for signing.

type OCR2Key added in v2.3.0

type OCR2Key struct {
	Key
}

func NewOCR2Key added in v2.3.0

func NewOCR2Key(material io.Reader) (*OCR2Key, error)

func (*OCR2Key) Marshal added in v2.3.0

func (sk *OCR2Key) Marshal() ([]byte, error)

func (*OCR2Key) MaxSignatureLength added in v2.3.0

func (sk *OCR2Key) MaxSignatureLength() int

func (*OCR2Key) PublicKey added in v2.3.0

func (sk *OCR2Key) PublicKey() types.OnchainPublicKey

func (*OCR2Key) Sign added in v2.3.0

func (sk *OCR2Key) Sign(reportCtx types.ReportContext, report types.Report) ([]byte, error)

func (*OCR2Key) Unmarshal added in v2.3.0

func (sk *OCR2Key) Unmarshal(in []byte) error

func (*OCR2Key) Verify added in v2.3.0

func (sk *OCR2Key) Verify(publicKey types.OnchainPublicKey, reportCtx types.ReportContext, report types.Report, signature []byte) bool

type PublicKey added in v2.3.0

type PublicKey struct {
	X, Y *big.Int
}

type Raw added in v2.3.0

type Raw []byte

Raw represents the Stark private key

func (Raw) GoString added in v2.3.0

func (raw Raw) GoString() string

GoString wraps String()

func (Raw) Key added in v2.3.0

func (raw Raw) Key() Key

Key gets the Key

func (Raw) String added in v2.3.0

func (raw Raw) String() string

String returns description

Jump to

Keyboard shortcuts

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