Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined: bls12377.HashToCurveG1Svdw #404

Open
anishnath opened this issue May 12, 2023 · 2 comments
Open

undefined: bls12377.HashToCurveG1Svdw #404

anishnath opened this issue May 12, 2023 · 2 comments
Assignees

Comments

@anishnath
Copy link

Failed to compile the project with this error

❯ go run main.go
# github.com/coinbase/kryptology/pkg/core/curves
../go/pkg/mod/github.com/coinbase/[email protected]/pkg/core/curves/bls12377_curve.go:352:22: undefined: bls12377.HashToCurveG1Svdw
../go/pkg/mod/github.com/coinbase/[email protected]/pkg/core/curves/bls12377_curve.go:626:22: undefined: bls12377.HashToCurveG2Svdw
@joe-dakota
Copy link

Looks like this was due to this PR: #188

@joe-dakota
Copy link

FWIW, in a separate project, I vendored coinbase/kryptology and modified the lines such that:

diff --git a/go/vendorlibs/coinbase/kryptology/pkg/core/curves/bls12377_curve.go b/go/vendorlibs/coinbase/kryptolo
gy/pkg/core/curves/bls12377_curve.go
index c449431e..2b47613d 100644
--- a/go/vendorlibs/coinbase/kryptology/pkg/core/curves/bls12377_curve.go
+++ b/go/vendorlibs/coinbase/kryptology/pkg/core/curves/bls12377_curve.go
@@ -349,7 +349,7 @@ func (p *PointBls12377G1) Random(reader io.Reader) Point {
 
 func (p *PointBls12377G1) Hash(bytes []byte) Point {
        var domain = []byte("BLS12377G1_XMD:SHA-256_SVDW_RO_")
-       pt, err := bls12377.HashToG1Svdw(bytes, domain)
+       pt, err := bls12377.HashToG1(bytes, domain)
        if err != nil {
                return nil
        }
@@ -623,7 +623,7 @@ func (p *PointBls12377G2) Random(reader io.Reader) Point {
 
 func (p *PointBls12377G2) Hash(bytes []byte) Point {
        var domain = []byte("BLS12377G2_XMD:SHA-256_SVDW_RO_")
-       pt, err := bls12377.HashToCurveG2Svdw(bytes, domain)
+       pt, err := bls12377.HashToG2(bytes, domain)
        if err != nil {
                return nil
        }

And then I updated that project's go.mod to use it:

// kryptology has been archived, replacing with a vendored copy which has been modified:
// HashToCurveG1Svdw -> HashToG1
// HashToCurveG2Svdw -> HashToG2
replace github.com/coinbase/kryptology => ./vendorlibs/coinbase/kryptology

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants