package
0.0.0-20241021085721-f59787bd92d4
Repository: https://github.com/brevis-network/zk-utils.git
Documentation: pkg.go.dev

# Functions

Addr2Hex returns hex without 0x.
No description provided by the author
No description provided by the author
No description provided by the author
BitsToFrBigInt convert bits to ecc fr, if the result exceed the modulus, return the mod result.
No description provided by the author
No description provided by the author
Bytes2Addr returns Address from b Addr.Bytes() does the reverse.
Bytes2AddrHex returns hex without 0x.
No description provided by the author
Bytes2Hash converts bytes to Hash.
Bytes2Hex returns hex string without 0x prefix.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Simple check if a string is in array or not.
No description provided by the author
No description provided by the author
DecodeByteToBinary decode a byte to the binary uint array.
DecomposeBits returns little endian bits of data.
only for bn254.
No description provided by the author
FlipByGroups flips the order of the groups of groupSize.
FormatAddrHex formats a string into standard Addr string.
No description provided by the author
No description provided by the author
Hex2Addr accepts hex string with or without 0x prefix and return Address.
No description provided by the author
Hex2Bytes supports hex string with or without 0x prefix Calls hex.DecodeString directly and ignore err similar to ec.FromHex but better.
Hex2Hash accepts hex string with or without 0x prefix and return Hash.
IsValidTxHash verifies whether a string can represent a valid hash or not.
MiMCBlockPad0 pad 0 into miMC block up to specific block size in Big-Endian.
No description provided by the author
No description provided by the author
PackBitsToFr fill bits to maximum size of fr length.
No description provided by the author
if in is 20 bytes, return directly.
No description provided by the author
ParseBytes32 decomposes data (big endian) into little endian bits then recomposes the result into two big ints in the form of {lo, hi}.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
copied from https://github.com/Consensys/gnark/blob/5711c4ae475535ce2a0febdeade86ff98914a378/internal/utils/convert.go#L39C1-L39C1 with minor changes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

HashLength is the expected length of the hash.
ZeroAddr is all 0s.
ZeroAddrHex is string of 20 0s.
ZeroBigInt is big.NewInt(0).
ZeroHash is all 0s.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author