keys: add a test for X/Y > P decoding case

This commit is contained in:
Roman Khimov 2019-12-25 18:01:54 +03:00
parent 6c471ecd98
commit fa0537758f

View file

@ -69,6 +69,12 @@ func TestDecodeFromStringBadCompressed(t *testing.T) {
require.Error(t, err)
}
func TestDecodeFromStringBadXMoreThanP(t *testing.T) {
str := "02ffffffff00000001000000000000000000000001ffffffffffffffffffffffff"
_, err := NewPublicKeyFromString(str)
require.Error(t, err)
}
func TestDecodeFromStringNotOnCurve(t *testing.T) {
str := "04ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
_, err := NewPublicKeyFromString(str)