crypto_lib

package
v0.0.0-...-78e3ed8 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPublicKey

func GetPublicKey(private_key string) string

Deduces the public key given a private key.

func Hash

func Hash(input1, input2 string) string

Computes the StarkWare version of the Pedersen hash of x and y. Full specification of the hash function can be found here: https://docs.starkware.co/starkex-docs/crypto/pedersen-hash-function

func Sign

func Sign(private_key, message, k string) (string, string)

Signs the given message hash with the provided private_key, with randomness k.

NOTE: k should be a strong cryptographical random, and not repeat. See: https://tools.ietf.org/html/rfc6979.

func Verify

func Verify(stark_key, msg_hash, r, s string) bool

Verifies ECDSA signature of a given message hash z with a given public key. Returns true if public_key signs the message. NOTE: This function assumes that the public_key is on the curve.

Types

This section is empty.

Jump to

Keyboard shortcuts

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