Documentation ¶
Index ¶
- Constants
- func Bytes32ArrayEncoded(input [][32]byte) []byte
- func Eq(x, y Value) bool
- func IsValidTupleSize(size *big.Int) bool
- func IsValidTupleSizeI64(size int64) bool
- func MarshalOperation(op Operation, wr io.Writer) error
- func MarshalOperationProof(op Operation, wr io.Writer, includeVal bool) error
- func MarshalValue(v Value, w io.Writer) error
- func NewBigIntFromBuf(buf *BigIntegerBuf) *big.Int
- func NewHashFromBuf(buf *HashBuf) [32]byte
- func TypeCodeName(code uint8) string
- type BasicOperation
- type BigIntegerBuf
- func (*BigIntegerBuf) Descriptor() ([]byte, []int)
- func (m *BigIntegerBuf) GetValue() []byte
- func (*BigIntegerBuf) ProtoMessage()
- func (m *BigIntegerBuf) Reset()
- func (m *BigIntegerBuf) String() string
- func (m *BigIntegerBuf) XXX_DiscardUnknown()
- func (m *BigIntegerBuf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BigIntegerBuf) XXX_Merge(src proto.Message)
- func (m *BigIntegerBuf) XXX_Size() int
- func (m *BigIntegerBuf) XXX_Unmarshal(b []byte) error
- type CodePointBuf
- func (*CodePointBuf) Descriptor() ([]byte, []int)
- func (m *CodePointBuf) GetNextHash() *HashBuf
- func (m *CodePointBuf) GetOp() *OperationBuf
- func (m *CodePointBuf) GetPc() int64
- func (*CodePointBuf) ProtoMessage()
- func (m *CodePointBuf) Reset()
- func (m *CodePointBuf) String() string
- func (m *CodePointBuf) XXX_DiscardUnknown()
- func (m *CodePointBuf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CodePointBuf) XXX_Merge(src proto.Message)
- func (m *CodePointBuf) XXX_Size() int
- func (m *CodePointBuf) XXX_Unmarshal(b []byte) error
- type CodePointValue
- func (cv CodePointValue) Clone() Value
- func (cv CodePointValue) CloneShallow() Value
- func (cv CodePointValue) Equal(val Value) bool
- func (cv CodePointValue) Hash() [32]byte
- func (cv CodePointValue) InternalTypeCode() uint8
- func (cv CodePointValue) Marshal(w io.Writer) error
- func (cv CodePointValue) MarshalForProof(w io.Writer) error
- func (cv CodePointValue) Size() int64
- func (cv CodePointValue) String() string
- func (cv CodePointValue) TypeCode() uint8
- type HashBuf
- func (*HashBuf) Descriptor() ([]byte, []int)
- func (m *HashBuf) GetValue() []byte
- func (*HashBuf) ProtoMessage()
- func (m *HashBuf) Reset()
- func (m *HashBuf) String() string
- func (m *HashBuf) XXX_DiscardUnknown()
- func (m *HashBuf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HashBuf) XXX_Merge(src proto.Message)
- func (m *HashBuf) XXX_Size() int
- func (m *HashBuf) XXX_Unmarshal(b []byte) error
- type HashOnlyValue
- func (nv HashOnlyValue) Clone() Value
- func (nv HashOnlyValue) CloneShallow() Value
- func (nv HashOnlyValue) Equal(val Value) bool
- func (nv HashOnlyValue) Hash() [32]byte
- func (nv HashOnlyValue) InternalTypeCode() byte
- func (nv HashOnlyValue) Marshal(wr io.Writer) error
- func (nv HashOnlyValue) Size() int64
- func (nv HashOnlyValue) String() string
- func (nv HashOnlyValue) TypeCode() byte
- type ImmediateOperation
- type IntValue
- func (iv IntValue) BigInt() *big.Int
- func (iv IntValue) Clone() Value
- func (iv IntValue) CloneShallow() Value
- func (iv IntValue) Equal(val Value) bool
- func (iv IntValue) Hash() [32]byte
- func (iv IntValue) InternalTypeCode() uint8
- func (iv IntValue) Marshal(w io.Writer) error
- func (iv IntValue) Size() int64
- func (iv IntValue) String() string
- func (iv IntValue) ToBytes() [32]byte
- func (iv IntValue) TypeCode() uint8
- type Opcode
- type Operation
- type OperationBuf
- func (*OperationBuf) Descriptor() ([]byte, []int)
- func (m *OperationBuf) GetImmediate() *ValueBuf
- func (m *OperationBuf) GetOpCode() uint32
- func (*OperationBuf) ProtoMessage()
- func (m *OperationBuf) Reset()
- func (m *OperationBuf) String() string
- func (m *OperationBuf) XXX_DiscardUnknown()
- func (m *OperationBuf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *OperationBuf) XXX_Merge(src proto.Message)
- func (m *OperationBuf) XXX_Size() int
- func (m *OperationBuf) XXX_Unmarshal(b []byte) error
- type TupleBuf
- func (*TupleBuf) Descriptor() ([]byte, []int)
- func (m *TupleBuf) GetValues() []*ValueBuf
- func (*TupleBuf) ProtoMessage()
- func (m *TupleBuf) Reset()
- func (m *TupleBuf) String() string
- func (m *TupleBuf) XXX_DiscardUnknown()
- func (m *TupleBuf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TupleBuf) XXX_Merge(src proto.Message)
- func (m *TupleBuf) XXX_Size() int
- func (m *TupleBuf) XXX_Unmarshal(b []byte) error
- type TupleValue
- func NewEmptyTuple() TupleValue
- func NewRepeatedTuple(value Value, size int64) (TupleValue, error)
- func NewSizedTupleFromReader(rd io.Reader, size byte) (TupleValue, error)
- func NewTuple2(value1 Value, value2 Value) TupleValue
- func NewTupleFromBuf(buf *TupleBuf) (TupleValue, error)
- func NewTupleFromSlice(slice []Value) (TupleValue, error)
- func NewTupleOfSizeWithContents(contents [MaxTupleSize]Value, size int8) (TupleValue, error)
- func (tv TupleValue) Clone() Value
- func (tv TupleValue) CloneShallow() Value
- func (tv TupleValue) Contents() []Value
- func (tv TupleValue) Equal(val Value) bool
- func (tv TupleValue) Get(idx IntValue) (Value, error)
- func (tv TupleValue) GetByInt64(idx int64) (Value, error)
- func (tv TupleValue) Hash() [32]byte
- func (tv TupleValue) InternalTypeCode() uint8
- func (tv TupleValue) IsValidIndex(idx IntValue) bool
- func (tv TupleValue) Len() int64
- func (tv TupleValue) Marshal(wr io.Writer) error
- func (tv TupleValue) Set(idx IntValue, val Value) (TupleValue, error)
- func (tv TupleValue) SetByInt64(idx int64, val Value) (TupleValue, error)
- func (tv TupleValue) Size() int64
- func (tv TupleValue) String() string
- func (tv TupleValue) TypeCode() uint8
- type UnmarshalError
- type Value
- type ValueBuf
- func (*ValueBuf) Descriptor() ([]byte, []int)
- func (m *ValueBuf) GetCodePointVal() *CodePointBuf
- func (m *ValueBuf) GetIntVal() *BigIntegerBuf
- func (m *ValueBuf) GetTupleVal() *TupleBuf
- func (m *ValueBuf) GetType() uint32
- func (m *ValueBuf) GetValue() isValueBuf_Value
- func (*ValueBuf) ProtoMessage()
- func (m *ValueBuf) Reset()
- func (m *ValueBuf) String() string
- func (m *ValueBuf) XXX_DiscardUnknown()
- func (m *ValueBuf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ValueBuf) XXX_Merge(src proto.Message)
- func (*ValueBuf) XXX_OneofWrappers() []interface{}
- func (m *ValueBuf) XXX_Size() int
- func (m *ValueBuf) XXX_Unmarshal(b []byte) error
- type ValueBuf_CodePointVal
- type ValueBuf_IntVal
- type ValueBuf_TupleVal
Constants ¶
View Source
const ( TypeCodeInt uint8 = 0 TypeCodeCodePoint = 1 TypeCodeHashOnly = 2 TypeCodeTuple = 3 )
View Source
const BytesPerInt = 32
View Source
const MaxTupleSize = 8
Variables ¶
This section is empty.
Functions ¶
func Bytes32ArrayEncoded ¶
func IsValidTupleSize ¶
func IsValidTupleSizeI64 ¶
func MarshalOperationProof ¶
func NewBigIntFromBuf ¶
func NewBigIntFromBuf(buf *BigIntegerBuf) *big.Int
func NewHashFromBuf ¶
func TypeCodeName ¶
Types ¶
type BasicOperation ¶
type BasicOperation struct {
Op Opcode
}
func NewBasicOperationFromReader ¶
func NewBasicOperationFromReader(rd io.Reader) (BasicOperation, error)
func (BasicOperation) GetOp ¶
func (op BasicOperation) GetOp() Opcode
func (BasicOperation) MarshalProof ¶
func (op BasicOperation) MarshalProof(wr io.Writer, includeVal bool) error
func (BasicOperation) TypeCode ¶
func (op BasicOperation) TypeCode() uint8
type BigIntegerBuf ¶
type BigIntegerBuf struct { Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewBigIntBuf ¶
func NewBigIntBuf(buf *big.Int) *BigIntegerBuf
func (*BigIntegerBuf) Descriptor ¶
func (*BigIntegerBuf) Descriptor() ([]byte, []int)
func (*BigIntegerBuf) GetValue ¶
func (m *BigIntegerBuf) GetValue() []byte
func (*BigIntegerBuf) ProtoMessage ¶
func (*BigIntegerBuf) ProtoMessage()
func (*BigIntegerBuf) Reset ¶
func (m *BigIntegerBuf) Reset()
func (*BigIntegerBuf) String ¶
func (m *BigIntegerBuf) String() string
func (*BigIntegerBuf) XXX_DiscardUnknown ¶
func (m *BigIntegerBuf) XXX_DiscardUnknown()
func (*BigIntegerBuf) XXX_Marshal ¶
func (m *BigIntegerBuf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BigIntegerBuf) XXX_Merge ¶
func (m *BigIntegerBuf) XXX_Merge(src proto.Message)
func (*BigIntegerBuf) XXX_Size ¶
func (m *BigIntegerBuf) XXX_Size() int
func (*BigIntegerBuf) XXX_Unmarshal ¶
func (m *BigIntegerBuf) XXX_Unmarshal(b []byte) error
type CodePointBuf ¶
type CodePointBuf struct { Pc int64 `protobuf:"varint,1,opt,name=pc,proto3" json:"pc,omitempty"` Op *OperationBuf `protobuf:"bytes,2,opt,name=op,proto3" json:"op,omitempty"` NextHash *HashBuf `protobuf:"bytes,3,opt,name=nextHash,proto3" json:"nextHash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewCodePointBuf ¶
func NewCodePointBuf(val CodePointValue) *CodePointBuf
func (*CodePointBuf) Descriptor ¶
func (*CodePointBuf) Descriptor() ([]byte, []int)
func (*CodePointBuf) GetNextHash ¶
func (m *CodePointBuf) GetNextHash() *HashBuf
func (*CodePointBuf) GetOp ¶
func (m *CodePointBuf) GetOp() *OperationBuf
func (*CodePointBuf) GetPc ¶
func (m *CodePointBuf) GetPc() int64
func (*CodePointBuf) ProtoMessage ¶
func (*CodePointBuf) ProtoMessage()
func (*CodePointBuf) Reset ¶
func (m *CodePointBuf) Reset()
func (*CodePointBuf) String ¶
func (m *CodePointBuf) String() string
func (*CodePointBuf) XXX_DiscardUnknown ¶
func (m *CodePointBuf) XXX_DiscardUnknown()
func (*CodePointBuf) XXX_Marshal ¶
func (m *CodePointBuf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CodePointBuf) XXX_Merge ¶
func (m *CodePointBuf) XXX_Merge(src proto.Message)
func (*CodePointBuf) XXX_Size ¶
func (m *CodePointBuf) XXX_Size() int
func (*CodePointBuf) XXX_Unmarshal ¶
func (m *CodePointBuf) XXX_Unmarshal(b []byte) error
type CodePointValue ¶
var ErrorCodePoint CodePointValue
func NewCodePointForProofFromReader ¶
func NewCodePointForProofFromReader(rd io.Reader) (CodePointValue, error)
func NewCodePointFromBuf ¶
func NewCodePointFromBuf(buf *CodePointBuf) (CodePointValue, error)
func NewCodePointValueFromReader ¶
func NewCodePointValueFromReader(rd io.Reader) (CodePointValue, error)
func (CodePointValue) Clone ¶
func (cv CodePointValue) Clone() Value
func (CodePointValue) CloneShallow ¶
func (cv CodePointValue) CloneShallow() Value
func (CodePointValue) Equal ¶
func (cv CodePointValue) Equal(val Value) bool
func (CodePointValue) Hash ¶
func (cv CodePointValue) Hash() [32]byte
func (CodePointValue) InternalTypeCode ¶
func (cv CodePointValue) InternalTypeCode() uint8
func (CodePointValue) MarshalForProof ¶
func (cv CodePointValue) MarshalForProof(w io.Writer) error
func (CodePointValue) Size ¶
func (cv CodePointValue) Size() int64
func (CodePointValue) String ¶
func (cv CodePointValue) String() string
func (CodePointValue) TypeCode ¶
func (cv CodePointValue) TypeCode() uint8
type HashBuf ¶
type HashBuf struct { Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewHashBuf ¶
func (*HashBuf) Descriptor ¶
func (*HashBuf) ProtoMessage ¶
func (*HashBuf) ProtoMessage()
func (*HashBuf) XXX_DiscardUnknown ¶
func (m *HashBuf) XXX_DiscardUnknown()
func (*HashBuf) XXX_Marshal ¶
func (*HashBuf) XXX_Unmarshal ¶
type HashOnlyValue ¶
type HashOnlyValue struct {
// contains filtered or unexported fields
}
func NewHashOnlyValue ¶
func NewHashOnlyValue(hash [32]byte, size int64) HashOnlyValue
func NewHashOnlyValueFromReader ¶
func NewHashOnlyValueFromReader(rd io.Reader) (HashOnlyValue, error)
func NewHashOnlyValueFromValue ¶
func NewHashOnlyValueFromValue(val Value) HashOnlyValue
func (HashOnlyValue) Clone ¶
func (nv HashOnlyValue) Clone() Value
func (HashOnlyValue) CloneShallow ¶
func (nv HashOnlyValue) CloneShallow() Value
func (HashOnlyValue) Equal ¶
func (nv HashOnlyValue) Equal(val Value) bool
func (HashOnlyValue) Hash ¶
func (nv HashOnlyValue) Hash() [32]byte
func (HashOnlyValue) InternalTypeCode ¶
func (nv HashOnlyValue) InternalTypeCode() byte
func (HashOnlyValue) Size ¶
func (nv HashOnlyValue) Size() int64
func (HashOnlyValue) String ¶
func (nv HashOnlyValue) String() string
func (HashOnlyValue) TypeCode ¶
func (nv HashOnlyValue) TypeCode() byte
type ImmediateOperation ¶
func NewImmediateOperationFromReader ¶
func NewImmediateOperationFromReader(rd io.Reader) (ImmediateOperation, error)
func (ImmediateOperation) GetOp ¶
func (op ImmediateOperation) GetOp() Opcode
func (ImmediateOperation) MarshalProof ¶
func (op ImmediateOperation) MarshalProof(wr io.Writer, includeVal bool) error
func (ImmediateOperation) TypeCode ¶
func (op ImmediateOperation) TypeCode() uint8
type IntValue ¶
type IntValue struct {
// contains filtered or unexported fields
}
var IntegerZero IntValue
func NewBooleanValue ¶
func NewInt64Value ¶
func NewIntValue ¶
func (IntValue) CloneShallow ¶
func (IntValue) InternalTypeCode ¶
type Operation ¶
type Operation interface { GetOp() Opcode TypeCode() uint8 Marshal(wr io.Writer) error MarshalProof(wr io.Writer, includeVal bool) error }
func NewOperationFromBuf ¶
func NewOperationFromBuf(buf *OperationBuf) (Operation, error)
type OperationBuf ¶
type OperationBuf struct { OpCode uint32 `protobuf:"varint,1,opt,name=opCode,proto3" json:"opCode,omitempty"` Immediate *ValueBuf `protobuf:"bytes,2,opt,name=immediate,proto3" json:"immediate,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewOperationBuf ¶
func NewOperationBuf(op Operation) *OperationBuf
func (*OperationBuf) Descriptor ¶
func (*OperationBuf) Descriptor() ([]byte, []int)
func (*OperationBuf) GetImmediate ¶
func (m *OperationBuf) GetImmediate() *ValueBuf
func (*OperationBuf) GetOpCode ¶
func (m *OperationBuf) GetOpCode() uint32
func (*OperationBuf) ProtoMessage ¶
func (*OperationBuf) ProtoMessage()
func (*OperationBuf) Reset ¶
func (m *OperationBuf) Reset()
func (*OperationBuf) String ¶
func (m *OperationBuf) String() string
func (*OperationBuf) XXX_DiscardUnknown ¶
func (m *OperationBuf) XXX_DiscardUnknown()
func (*OperationBuf) XXX_Marshal ¶
func (m *OperationBuf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*OperationBuf) XXX_Merge ¶
func (m *OperationBuf) XXX_Merge(src proto.Message)
func (*OperationBuf) XXX_Size ¶
func (m *OperationBuf) XXX_Size() int
func (*OperationBuf) XXX_Unmarshal ¶
func (m *OperationBuf) XXX_Unmarshal(b []byte) error
type TupleBuf ¶
type TupleBuf struct { Values []*ValueBuf `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewTupleBuf ¶
func NewTupleBuf(val TupleValue) *TupleBuf
func (*TupleBuf) Descriptor ¶
func (*TupleBuf) ProtoMessage ¶
func (*TupleBuf) ProtoMessage()
func (*TupleBuf) XXX_DiscardUnknown ¶
func (m *TupleBuf) XXX_DiscardUnknown()
func (*TupleBuf) XXX_Marshal ¶
func (*TupleBuf) XXX_Unmarshal ¶
type TupleValue ¶
type TupleValue struct {
// contains filtered or unexported fields
}
func NewEmptyTuple ¶
func NewEmptyTuple() TupleValue
func NewRepeatedTuple ¶
func NewRepeatedTuple(value Value, size int64) (TupleValue, error)
func NewSizedTupleFromReader ¶
func NewSizedTupleFromReader(rd io.Reader, size byte) (TupleValue, error)
func NewTuple2 ¶
func NewTuple2(value1 Value, value2 Value) TupleValue
func NewTupleFromBuf ¶
func NewTupleFromBuf(buf *TupleBuf) (TupleValue, error)
func NewTupleFromSlice ¶
func NewTupleFromSlice(slice []Value) (TupleValue, error)
func NewTupleOfSizeWithContents ¶
func NewTupleOfSizeWithContents(contents [MaxTupleSize]Value, size int8) (TupleValue, error)
func (TupleValue) Clone ¶
func (tv TupleValue) Clone() Value
func (TupleValue) CloneShallow ¶
func (tv TupleValue) CloneShallow() Value
func (TupleValue) Contents ¶
func (tv TupleValue) Contents() []Value
func (TupleValue) Equal ¶
func (tv TupleValue) Equal(val Value) bool
func (TupleValue) GetByInt64 ¶
func (tv TupleValue) GetByInt64(idx int64) (Value, error)
func (TupleValue) Hash ¶
func (tv TupleValue) Hash() [32]byte
func (TupleValue) InternalTypeCode ¶
func (tv TupleValue) InternalTypeCode() uint8
func (TupleValue) IsValidIndex ¶
func (tv TupleValue) IsValidIndex(idx IntValue) bool
func (TupleValue) Len ¶
func (tv TupleValue) Len() int64
func (TupleValue) Set ¶
func (tv TupleValue) Set(idx IntValue, val Value) (TupleValue, error)
func (TupleValue) SetByInt64 ¶
func (tv TupleValue) SetByInt64(idx int64, val Value) (TupleValue, error)
func (TupleValue) Size ¶
func (tv TupleValue) Size() int64
func (TupleValue) String ¶
func (tv TupleValue) String() string
func (TupleValue) TypeCode ¶
func (tv TupleValue) TypeCode() uint8
type UnmarshalError ¶
type UnmarshalError struct {
// contains filtered or unexported fields
}
func (UnmarshalError) Error ¶
func (e UnmarshalError) Error() string
type Value ¶
type Value interface { TypeCode() uint8 InternalTypeCode() uint8 Clone() Value CloneShallow() Value Equal(Value) bool Hash() [32]byte Size() int64 Marshal(io.Writer) error }
func NewIntValueFromString ¶
func NewValueFromBuf ¶
type ValueBuf ¶
type ValueBuf struct { Type uint32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` // Types that are valid to be assigned to Value: // *ValueBuf_IntVal // *ValueBuf_TupleVal // *ValueBuf_CodePointVal Value isValueBuf_Value `protobuf_oneof:"value"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewValueBuf ¶
func (*ValueBuf) Descriptor ¶
func (*ValueBuf) GetCodePointVal ¶
func (m *ValueBuf) GetCodePointVal() *CodePointBuf
func (*ValueBuf) GetIntVal ¶
func (m *ValueBuf) GetIntVal() *BigIntegerBuf
func (*ValueBuf) GetTupleVal ¶
func (*ValueBuf) ProtoMessage ¶
func (*ValueBuf) ProtoMessage()
func (*ValueBuf) XXX_DiscardUnknown ¶
func (m *ValueBuf) XXX_DiscardUnknown()
func (*ValueBuf) XXX_Marshal ¶
func (*ValueBuf) XXX_OneofWrappers ¶
func (*ValueBuf) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*ValueBuf) XXX_Unmarshal ¶
type ValueBuf_CodePointVal ¶
type ValueBuf_CodePointVal struct {
CodePointVal *CodePointBuf `protobuf:"bytes,4,opt,name=codePointVal,proto3,oneof"`
}
type ValueBuf_IntVal ¶
type ValueBuf_IntVal struct {
IntVal *BigIntegerBuf `protobuf:"bytes,2,opt,name=intVal,proto3,oneof"`
}
type ValueBuf_TupleVal ¶
type ValueBuf_TupleVal struct {
TupleVal *TupleBuf `protobuf:"bytes,3,opt,name=tupleVal,proto3,oneof"`
}
Click to show internal directories.
Click to hide internal directories.