mirror of
https://github.com/sonr-io/crypto.git
synced 2026-01-12 04:09:13 +00:00
20 lines
435 B
Go
20 lines
435 B
Go
|
|
package k256_test
|
||
|
|
|
||
|
|
import (
|
||
|
|
"testing"
|
||
|
|
|
||
|
|
"github.com/stretchr/testify/require"
|
||
|
|
|
||
|
|
"github.com/sonr-io/sonr/crypto/core/curves/native"
|
||
|
|
"github.com/sonr-io/sonr/crypto/core/curves/native/k256"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestK256PointArithmetic_Hash(t *testing.T) {
|
||
|
|
var b [32]byte
|
||
|
|
sc, err := k256.K256PointNew().Hash(b[:], native.EllipticPointHasherSha256())
|
||
|
|
|
||
|
|
require.NoError(t, err)
|
||
|
|
require.True(t, !sc.IsIdentity())
|
||
|
|
require.True(t, sc.IsOnCurve())
|
||
|
|
}
|