Skip to content

Commit

Permalink
make verify function public (#907)
Browse files Browse the repository at this point in the history
* make verify function public

* update function verify signature
  • Loading branch information
Sanchit011 committed Apr 19, 2023
1 parent ead79dc commit d92949e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zboxcore/client/entity.go
Expand Up @@ -32,8 +32,8 @@ func init() {
return sys.Sign(hash, client.SignatureScheme, GetClientSysKeys())
}

sys.Verify = verifySignature
sys.VerifyWith = verifySignatureWith
sys.Verify = VerifySignature
sys.VerifyWith = VerifySignatureWith
}

// PopulateClient populates single client
Expand Down Expand Up @@ -130,7 +130,7 @@ func SignHash(hash string, signatureScheme string, keys []sys.KeyPair) (string,
return retSignature, nil
}

func verifySignature(signature string, msg string) (bool, error) {
func VerifySignature(signature string, msg string) (bool, error) {
ss := zcncrypto.NewSignatureScheme(client.SignatureScheme)
if err := ss.SetPublicKey(client.ClientKey); err != nil {
return false, err
Expand All @@ -139,7 +139,7 @@ func verifySignature(signature string, msg string) (bool, error) {
return ss.Verify(signature, msg)
}

func verifySignatureWith(pubKey, signature, hash string) (bool, error) {
func VerifySignatureWith(pubKey, signature, hash string) (bool, error) {
sch := zcncrypto.NewSignatureScheme(client.SignatureScheme)
err := sch.SetPublicKey(pubKey)
if err != nil {
Expand Down

0 comments on commit d92949e

Please sign in to comment.