Documentation ¶
Index ¶
- func CreateODS(path string, roots *share.AxisRoots, eds *rsmt2d.ExtendedDataSquare) error
- func CreateODSQ4(pathODS, pathQ4 string, roots *share.AxisRoots, eds *rsmt2d.ExtendedDataSquare) error
- func ValidateODSQ4Size(pathODS, pathQ4 string, eds *rsmt2d.ExtendedDataSquare) error
- func ValidateODSSize(path string, eds *rsmt2d.ExtendedDataSquare) error
- type Codec
- type ODS
- func (o *ODS) AxisHalf(_ context.Context, axisType rsmt2d.Axis, axisIdx int) (eds.AxisHalf, error)
- func (o *ODS) AxisRoots(context.Context) (*share.AxisRoots, error)
- func (o *ODS) Close() error
- func (o *ODS) DataHash(context.Context) (share.DataHash, error)
- func (o *ODS) Reader() (io.Reader, error)
- func (o *ODS) RowNamespaceData(ctx context.Context, namespace libshare.Namespace, rowIdx int) (shwap.RowNamespaceData, error)
- func (o *ODS) Sample(ctx context.Context, rowIdx, colIdx int) (shwap.Sample, error)
- func (o *ODS) Shares(context.Context) ([]libshare.Share, error)
- func (o *ODS) Size(context.Context) int
- type ODSQ4
- func (odsq4 *ODSQ4) AxisHalf(ctx context.Context, axisType rsmt2d.Axis, axisIdx int) (eds.AxisHalf, error)
- func (odsq4 *ODSQ4) AxisRoots(ctx context.Context) (*share.AxisRoots, error)
- func (odsq4 *ODSQ4) Close() error
- func (odsq4 *ODSQ4) DataHash(ctx context.Context) (share.DataHash, error)
- func (odsq4 *ODSQ4) Reader() (io.Reader, error)
- func (odsq4 *ODSQ4) RowNamespaceData(ctx context.Context, namespace libshare.Namespace, rowIdx int) (shwap.RowNamespaceData, error)
- func (odsq4 *ODSQ4) Sample(ctx context.Context, rowIdx, colIdx int) (shwap.Sample, error)
- func (odsq4 *ODSQ4) Shares(ctx context.Context) ([]libshare.Share, error)
- func (odsq4 *ODSQ4) Size(ctx context.Context) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateODS ¶
CreateODS creates a new file under given FS path and writes the ODS into it out of given EDS. It may leave partially written file if any of the writes fail.
func CreateODSQ4 ¶
func CreateODSQ4( pathODS, pathQ4 string, roots *share.AxisRoots, eds *rsmt2d.ExtendedDataSquare, ) error
CreateODSQ4 creates ODS and Q4 files under the given FS paths.
func ValidateODSQ4Size ¶
func ValidateODSQ4Size(pathODS, pathQ4 string, eds *rsmt2d.ExtendedDataSquare) error
ValidateODSQ4Size checks the size of the ODS and Q4 files under the given FS paths.
func ValidateODSSize ¶
func ValidateODSSize(path string, eds *rsmt2d.ExtendedDataSquare) error
ValidateODSSize checks if the file under given FS path has the expected size.
Types ¶
type ODS ¶
type ODS struct {
// contains filtered or unexported fields
}
ODS implements eds.Accessor as an FS file. It stores the original data square(ODS), which is the first quadrant of EDS, and it's metadata in file's header.
func OpenODS ¶
OpenODS opens an existing ODS file under given FS path. It only reads the header with metadata. The other content of the File is read lazily. If file is empty, the ErrEmptyFile is returned. File must be closed after usage.
func (*ODS) AxisHalf ¶
AxisHalf returns half of shares axis of the given type and index. Side is determined by implementation. Implementations should indicate the side in the returned AxisHalf.
func (*ODS) AxisRoots ¶
AxisRoots reads AxisRoots stored in the file. AxisRoots are stored after the header and before the ODS data.
func (*ODS) Reader ¶
Reader returns binary reader for the file. It reads the shares from the ODS part of the square row by row.
func (*ODS) RowNamespaceData ¶
func (o *ODS) RowNamespaceData( ctx context.Context, namespace libshare.Namespace, rowIdx int, ) (shwap.RowNamespaceData, error)
RowNamespaceData returns data for the given namespace and row index.
func (*ODS) Sample ¶
Sample returns share and corresponding proof for row and column indices. Implementation can choose which axis to use for proof. Chosen axis for proof should be indicated in the returned Sample.
type ODSQ4 ¶
type ODSQ4 struct {
// contains filtered or unexported fields
}
ODSQ4 is an Accessor that combines ODS and Q4 files. It extends the ODS with the ability to read Q4 of the EDS. Reading from the fourth quadrant allows to efficiently read samples from Q2 and Q4 quadrants of the square, as well as reading columns from Q3 and Q4 quadrants. Reading from Q4 in those cases is more efficient than reading from Q1, because it would require reading the whole Q1 quadrant and reconstructing the data from it. It opens Q4 file lazily on the first read attempt.
func ODSWithQ4 ¶
ODSWithQ4 returns ODSQ4 instance over ODS. It opens Q4 file lazily under the given path.