mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-04 18:31:41 +00:00
(no commit message provided)
This commit is contained in:
committed by
Prad Nukala (aider)
parent
5fd43dfd6b
commit
2f976209db
@@ -1,26 +0,0 @@
|
||||
//
|
||||
// Copyright Coinbase, Inc. All Rights Reserved.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestEd25519ScalarMult(t *testing.T) {
|
||||
// These values were caught during testing where this combination
|
||||
// yields leading zeros in which big.Int chops.
|
||||
// This test makes sure that this case is correctly handled
|
||||
y := new(big.Int).SetBytes([]byte{37, 228, 49, 105, 78, 97, 108, 221, 63, 25, 125, 212, 108, 189, 247, 169, 52, 86, 150, 97, 93, 199, 212, 254, 122, 98, 189, 7, 97, 14, 78, 12})
|
||||
x := new(big.Int).SetInt64(4)
|
||||
curve := Ed25519()
|
||||
require.True(t, curve.IsOnCurve(nil, y))
|
||||
_, newY := curve.ScalarMult(nil, y, x.Bytes())
|
||||
require.True(t, curve.IsOnCurve(nil, newY))
|
||||
}
|
||||
Reference in New Issue
Block a user