Documentation ¶
Index ¶
- Constants
- Variables
- type Felt
- func (z *Felt) Add(x, y *Felt) *Felt
- func (z *Felt) BigInt(res *big.Int) *big.Int
- func (z *Felt) Bits() [4]uint64
- func (z *Felt) Bytes() [32]byte
- func (z *Felt) Cmp(x *Felt) int
- func (z *Felt) Double(x *Felt) *Felt
- func (z *Felt) Equal(x *Felt) bool
- func (z *Felt) Exp(x *Felt, y *big.Int) *Felt
- func (z *Felt) Halve()
- func (z *Felt) Impl() *fp.Element
- func (z *Felt) IsOne() bool
- func (z *Felt) IsZero() bool
- func (z *Felt) Marshal() []byte
- func (z *Felt) MarshalCBOR() ([]byte, error)
- func (z *Felt) MarshalJSON() ([]byte, error)
- func (z *Felt) Mul(x, y *Felt) *Felt
- func (z *Felt) Set(x *Felt) *Felt
- func (z *Felt) SetBigInt(v *big.Int) *Felt
- func (z *Felt) SetBytes(e []byte) *Felt
- func (z *Felt) SetRandom() (*Felt, error)
- func (z *Felt) SetString(number string) (*Felt, error)
- func (z *Felt) SetUint64(v uint64) *Felt
- func (z *Felt) ShortString() string
- func (z *Felt) String() string
- func (z *Felt) Sub(x, y *Felt) *Felt
- func (z *Felt) Text(base int) string
- func (z *Felt) Uint64() uint64
- func (z *Felt) UnmarshalCBOR(data []byte) error
- func (z *Felt) UnmarshalJSON(data []byte) error
Constants ¶
const ( Base16 = 16 Base10 = 10 )
Variables ¶
var Zero = Felt{}
Zero felt constant
Functions ¶
This section is empty.
Types ¶
type Felt ¶
type Felt struct {
// contains filtered or unexported fields
}
func (*Felt) Double ¶ added in v0.2.1
Double forwards the call to underlying field element implementation
func (*Felt) Halve ¶
func (z *Felt) Halve()
Halve forwards the call to underlying field element implementation
func (*Felt) MarshalCBOR ¶
MarshalCBOR lets Felt be encoded in CBOR format with private `val`
func (*Felt) MarshalJSON ¶
MarshalJSON forwards the call to underlying field element implementation
func (*Felt) SetBigInt ¶ added in v0.4.0
SetBigInt forwards the call to underlying field element implementation
func (*Felt) ShortString ¶
ShortString prints the felt to a string in a shortened format
func (*Felt) Uint64 ¶ added in v0.4.0
Uint64 forwards the call to underlying field element implementation
func (*Felt) UnmarshalCBOR ¶
UnmarshalCBOR lets Felt be decoded from CBOR format with private `val`
func (*Felt) UnmarshalJSON ¶
UnmarshalJSON accepts numbers and strings as input. See Element.SetString for valid prefixes (0x, 0b, ...). If there is an error, we try to explicitly unmarshal from hex before returning an error. This implementation is based on gnark-crypto's UnmarshalJSON.