Skip to content

Commit

Permalink
Export KZGToVersionedHash
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan-Wilson committed Aug 11, 2023
1 parent 6f8d8d2 commit 07a0cd2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ func (b *kzgPointEvaluation) Run(input []byte) ([]byte, error) {
// input kzg point: next 48 bytes
var commitment kzg4844.Commitment
copy(commitment[:], input[96:])
if kZGToVersionedHash(commitment) != versionedHash {
if KZGToVersionedHash(commitment) != versionedHash {
return nil, errBlobVerifyMismatchedVersion
}

Expand All @@ -1149,8 +1149,8 @@ func (b *kzgPointEvaluation) Run(input []byte) ([]byte, error) {
return common.Hex2Bytes(blobPrecompileReturnValue), nil
}

// kZGToVersionedHash implements kzg_to_versioned_hash from EIP-4844
func kZGToVersionedHash(kzg kzg4844.Commitment) common.Hash {
// KZGToVersionedHash implements kzg_to_versioned_hash from EIP-4844
func KZGToVersionedHash(kzg kzg4844.Commitment) common.Hash {
h := sha256.Sum256(kzg[:])
h[0] = blobCommitmentVersionKZG

Expand Down

0 comments on commit 07a0cd2

Please sign in to comment.