Skip to content

Commit

Permalink
remove unnecessary identityChallengeSigner Verify method
Browse files Browse the repository at this point in the history
  • Loading branch information
cce committed Jun 27, 2024
1 parent a6248b2 commit a807471
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
5 changes: 0 additions & 5 deletions network/netidentity.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ type identityChallengeScheme interface {
type identityChallengeSigner interface {
Sign(message crypto.Hashable) crypto.Signature
SignBytes(message []byte) crypto.Signature
Verify(message crypto.Hashable, sig crypto.Signature) bool
PublicKey() crypto.PublicKey
}

Expand All @@ -113,10 +112,6 @@ func (s *identityChallengeLegacySigner) SignBytes(message []byte) crypto.Signatu
return s.keys.SignBytes(message)
}

func (s *identityChallengeLegacySigner) Verify(message crypto.Hashable, sig crypto.Signature) bool {
return s.keys.SignatureVerifier.Verify(message, sig)
}

func (s *identityChallengeLegacySigner) PublicKey() crypto.PublicKey {
return s.keys.SignatureVerifier
}
Expand Down
10 changes: 0 additions & 10 deletions network/p2p/peerID.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,6 @@ func (p *PeerIDChallengeSigner) SignBytes(message []byte) algocrypto.Signature {
return algocrypto.Signature(sig)
}

// Verify implements the identityChallengeSigner interface.
func (p *PeerIDChallengeSigner) Verify(message algocrypto.Hashable, sig algocrypto.Signature) bool {
// libp2p Ed25519PublicKey.Verify() returns a bool and no error
ret, err := p.key.GetPublic().Verify(algocrypto.HashRep(message), sig[:])
if err != nil {
panic(err)
}
return ret
}

// PublicKey implements the identityChallengeSigner interface.
func (p *PeerIDChallengeSigner) PublicKey() algocrypto.PublicKey {
// libp2p Ed25519PublicKey.Raw() returns a 32-byte public key and no error
Expand Down

0 comments on commit a807471

Please sign in to comment.