mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-03 19:51:15 +00:00
Fix curve (#429)
* update secp256k1 library from go-eth code * cast deprecated functions to use new BitCurve type * add IsOnCurve checks and tests * add test outcome check * fix test
This commit is contained in:
parent
bbd7d00068
commit
b272e7418c
1 changed files with 4 additions and 10 deletions
|
|
@ -231,7 +231,7 @@ func TestOnCurveDeserialize(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCurveScalarMult(t *testing.T) {
|
||||
curve := crypto.S256()
|
||||
curve := crypto.S256().(*secp256k1.BitCurve)
|
||||
|
||||
x, y := curve.ScalarBaseMult(curve.Params().N.Bytes())
|
||||
if x == nil && y == nil {
|
||||
|
|
@ -262,13 +262,7 @@ func TestNilPointerDereferencePanic(t *testing.T) {
|
|||
t.Error("Failed to Serialize input Ring signature")
|
||||
}
|
||||
|
||||
deserializedSig, err := Deserialize(sig)
|
||||
if err != nil {
|
||||
t.Error("Failed to Deserialize Ring signature")
|
||||
}
|
||||
|
||||
verified := Verify(deserializedSig, false)
|
||||
if verified {
|
||||
t.Error("Should failed to verify Ring signature as the signature is invalid")
|
||||
}
|
||||
_ , err = Deserialize(sig)
|
||||
// Should failed to verify Ring signature as the signature is invalid
|
||||
assert.EqualError(t, err, "failed to deserialize, invalid ring signature")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue