Skip to content

ECDSA Signature: Add New Method IsVerified #1454

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

ltp456
Copy link

@ltp456 ltp456 commented Mar 25, 2025

Description

In the current implementation, the ECDSA signature only provides a Verify method, which uses api.AssertIsEqual to verify the signature. If the signature is invalid, it returns an error.

However, in some environments, we need to determine whether the signature is valid and proceed accordingly based on the result.

To address this, we need a new method, IsVerified, which returns 1 if the signature is valid and 0 otherwise.

Type of change

  • New feature (non-breaking change which adds functionality)

How has this been tested?

  • ecdsa_test.go TestEcdsaPublicKeyIsVerifiedOK
  • ecdsa_test.go TestEcdsaPublicKeyIsVerifiedNegative

How has this been benchmarked?

  • Benchmark A, on Macbook pro M1, 32GB RAM
  • Benchmark B, on x86 Intel xxx, 16GB RAM

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants