mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-26 16:45:18 +00:00
33 lines
617 B
Go
33 lines
617 B
Go
//
|
|
// Copyright Coinbase, Inc. All Rights Reserved.
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
// Copyright Coinbase, Inc. All Rights Reserved.
|
|
//
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package sharing
|
|
|
|
import (
|
|
crand "crypto/rand"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"source.quilibrium.com/quilibrium/monorepo/nekryptology/pkg/core/curves"
|
|
)
|
|
|
|
func TestNewPoly(t *testing.T) {
|
|
curve := curves.BLS12381G1()
|
|
secret := curve.NewScalar().Hash([]byte("test"))
|
|
|
|
poly := new(Polynomial).Init(secret, 4, crand.Reader)
|
|
require.NotNil(t, poly)
|
|
|
|
require.Equal(t, poly.Coefficients[0], secret)
|
|
}
|