Documentation
¶
Index ¶
- func BigIntToFelt(big *big.Int) *felt.Felt
- func BigToHex(in *big.Int) string
- func BytesToBig(bytes []byte) *big.Int
- func ComputeFact(programHash *big.Int, programOutputs []*big.Int) *big.Int
- func FeltArrToBigIntArr(f []*felt.Felt) []*big.Int
- func FeltToBigInt(f *felt.Felt) *big.Int
- func FmtKecBytes(in *big.Int, rolen int) (buf []byte)
- func GetSelectorFromName(funcName string) *big.Int
- func GetSelectorFromNameFelt(funcName string) *felt.Felt
- func HexArrToFelt(hexArr []string) ([]*felt.Felt, error)
- func HexToBN(hexString string) *big.Int
- func HexToBytes(hexString string) ([]byte, error)
- func HexToFelt(hex string) (*felt.Felt, error)
- func HexToShortStr(hexStr string) string
- func Keccak256(data ...[]byte) []byte
- func MaskBits(mask, wordSize int, slice []byte) (ret []byte)
- func SNValToBN(str string) *big.Int
- func SplitFactStr(fact string) (fact_low, fact_high string)
- func StrToBig(str string) *big.Int
- func TestHexArrToFelt(t testing.TB, hexArr []string) []*felt.Felt
- func TestHexToFelt(t testing.TB, hex string) *felt.Felt
- func UTF8StrToBig(str string) *big.Int
- func Uint64ToFelt(num uint64) *felt.Felt
- type KeccakState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToBig ¶ added in v0.4.6
func ComputeFact ¶ added in v0.4.6
compute the keccack fact given the program hash and outputs
func FmtKecBytes ¶ added in v0.4.6
format the bytes in Keccak hash
func GetSelectorFromName ¶ added in v0.4.6
todo(): this is used by the signer. Should it return a felt?
func GetSelectorFromNameFelt ¶ added in v0.4.6
func HexToBN ¶ added in v0.4.6
trim "0x" prefix(if exists) and converts hexidecimal string to big int
func HexToBytes ¶ added in v0.4.6
trim "0x" prefix(if exists) and converts hexidecimal string to byte slice
func HexToShortStr ¶ added in v0.4.6
convert hex string to Starknet 'short string'
func Keccak256 ¶ added in v0.4.6
Keccak256 calculates and returns the Keccak256 hash of the input data. (ref: https://github.com/ethereum/go-ethereum/blob/master/crypto/crypto.go)
func SplitFactStr ¶ added in v0.4.6
split a fact into two felts
func UTF8StrToBig ¶ added in v0.4.6
Convert utf8 string to big int
func Uint64ToFelt ¶
Types ¶
type KeccakState ¶ added in v0.4.6
KeccakState wraps sha3.state. In addition to the usual hash methods, it also supports Read to get a variable amount of data from the hash state. Read is faster than Sum because it doesn't copy the internal state, but also modifies the internal state.
func NewKeccakState ¶ added in v0.4.6
func NewKeccakState() KeccakState
NewKeccakState creates a new KeccakState (ref: https://github.com/ethereum/go-ethereum/blob/master/crypto/crypto.go)