refactor/internal (#1216)

* refactor: update import paths in gateway handlers

* refactor: remove obsolete devtools Makefile and README

* build: optimize build process for improved efficiency

* refactor: remove obsolete pkl files related to Matrix and Sonr network configurations

* refactor: move embed code to x/dwn/types
This commit is contained in:
Prad Nukala
2024-12-24 16:10:20 +00:00
committed by GitHub
parent 0ec2f7d86a
commit 47c3a53080
356 changed files with 402 additions and 1613 deletions
-37
View File
@@ -1,37 +0,0 @@
package schnorr
import (
"crypto/rand"
"fmt"
"testing"
"github.com/stretchr/testify/require"
"golang.org/x/crypto/sha3"
"github.com/onsonr/sonr/crypto/core/curves"
)
func TestZKPOverMultipleCurves(t *testing.T) {
curveInstances := []*curves.Curve{
curves.K256(),
curves.P256(),
// TODO: the code fails on the following curves. Investigate if this is expected.
// curves.PALLAS(),
// curves.BLS12377G1(),
// curves.BLS12377G2(),
// curves.BLS12381G1(),
// curves.BLS12381G2(),
// curves.ED25519(),
}
for i, curve := range curveInstances {
uniqueSessionId := sha3.New256().Sum([]byte("random seed"))
prover := NewProver(curve, nil, uniqueSessionId)
secret := curve.Scalar.Random(rand.Reader)
proof, err := prover.Prove(secret)
require.NoError(t, err, fmt.Sprintf("failed in curve %d", i))
err = Verify(proof, curve, nil, uniqueSessionId)
require.NoError(t, err, fmt.Sprintf("failed in curve %d", i))
}
}