Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove publicKeyAtInfinity check #60

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ func (p *PublicKey) Verify(s *Signature, t *merlin.Transcript) (bool, error) {
return false, errors.New("transcript provided is nil")
}

if p.key.Equal(publicKeyAtInfinity) == 1 {
return false, errPublicKeyAtInfinity
}

t.AppendMessage([]byte("proto-name"), []byte("Schnorr-sig"))
pubc := p.Encode()
t.AppendMessage([]byte("sign:pk"), pubc[:])
Expand Down
16 changes: 0 additions & 16 deletions sign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package schnorrkel

import (
"encoding/hex"
"errors"
"fmt"
"testing"

Expand Down Expand Up @@ -210,18 +209,3 @@ func TestVerify_rust(t *testing.T) {
require.NoError(t, err)
require.True(t, ok)
}

func TestVerify_PublicKeyAtInfinity(t *testing.T) {
transcript := merlin.NewTranscript("hello")
priv := SecretKey{}
pub, err := priv.Public()
require.NoError(t, err)
require.Equal(t, pub.key, publicKeyAtInfinity)

sig, err := priv.Sign(transcript)
require.NoError(t, err)

transcript2 := merlin.NewTranscript("hello")
_, err = pub.Verify(sig, transcript2)
require.True(t, errors.Is(err, errPublicKeyAtInfinity))
}
Loading