Skip to content

Commit 405c706

Browse files
crypto/kzg4844: update docs
1 parent 88ae2dd commit 405c706

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

crypto/kzg4844/kzg4844.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,17 @@ func VerifyBlobProof(blob *Blob, commitment Commitment, proof Proof) error {
149149
return gokzgVerifyBlobProof(blob, commitment, proof)
150150
}
151151

152+
// ComputeCells returns the KZG cell proofs that are used to verify the blob against
153+
// the commitment.
154+
//
155+
// This method does not verify that the commitment is correct with respect to blob.
156+
func ComputeCells(blob *Blob) ([]Proof, error) {
157+
if useCKZG.Load() {
158+
return ckzgComputeCells(blob)
159+
}
160+
return gokzgComputeCells(blob)
161+
}
162+
152163
// CalcBlobHashV1 calculates the 'versioned blob hash' of a commitment.
153164
// The given hasher must be a sha256 hash instance, otherwise the result will be invalid!
154165
func CalcBlobHashV1(hasher hash.Hash, commit *Commitment) (vh [32]byte) {
@@ -166,10 +177,3 @@ func CalcBlobHashV1(hasher hash.Hash, commit *Commitment) (vh [32]byte) {
166177
func IsValidVersionedHash(h []byte) bool {
167178
return len(h) == 32 && h[0] == 0x01
168179
}
169-
170-
func ComputeCells(blob *Blob) ([]Proof, error) {
171-
if useCKZG.Load() {
172-
return ckzgComputeCells(blob)
173-
}
174-
return gokzgComputeCells(blob)
175-
}

crypto/kzg4844/kzg4844_ckzg_cgo.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ func ckzgVerifyBlobProof(blob *Blob, commitment Commitment, proof Proof) error {
132132
return nil
133133
}
134134

135+
// ckzgComputeCells returns the KZG cell proofs that are used to verify the blob against
136+
// the commitment.
137+
//
138+
// This method does not verify that the commitment is correct with respect to blob.
135139
func ckzgComputeCells(blob *Blob) ([]Proof, error) {
136140
ckzgIniter.Do(ckzgInit)
137141

crypto/kzg4844/kzg4844_ckzg_nocgo.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ func ckzgVerifyBlobProof(blob *Blob, commitment Commitment, proof Proof) error {
6161
panic("unsupported platform")
6262
}
6363

64-
// ckzgComputeCells.
64+
// ckzgComputeCells returns the KZG cell proofs that are used to verify the blob against
65+
// the commitment.
66+
//
67+
// This method does not verify that the commitment is correct with respect to blob.
6568
func ckzgComputeCells(blob *Blob) ([]Proof, error) {
6669
panic("unsupported platform")
6770
}

crypto/kzg4844/kzg4844_gokzg.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ func gokzgVerifyBlobProof(blob *Blob, commitment Commitment, proof Proof) error
9797
return context.VerifyBlobKZGProof((*gokzg4844.Blob)(blob), (gokzg4844.KZGCommitment)(commitment), (gokzg4844.KZGProof)(proof))
9898
}
9999

100+
// gokzgComputeCells returns the KZG cell proofs that are used to verify the blob against
101+
// the commitment.
102+
//
103+
// This method does not verify that the commitment is correct with respect to blob.
100104
func gokzgComputeCells(blob *Blob) ([]Proof, error) {
101105
gokzgIniter.Do(gokzgInit)
102106

0 commit comments

Comments
 (0)