Skip to content

Use standard way of generating a EC public key for the Schnorr signature#1167

Draft
FilipLaurentiu wants to merge 2 commits intolambdaclass:mainfrom
FilipLaurentiu:filip/schnorr_signature_standard_public_key
Draft

Use standard way of generating a EC public key for the Schnorr signature#1167
FilipLaurentiu wants to merge 2 commits intolambdaclass:mainfrom
FilipLaurentiu:filip/schnorr_signature_standard_public_key

Conversation

@FilipLaurentiu
Copy link
Copy Markdown

Use standard way of generating a EC public key for the Schnorr signature

Description

Description of the pull request changes and motivation.

Type of change

Please delete options that are not relevant.

  • New feature
  • Bug fix
  • Optimization

Checklist

  • Linked to Github Issue
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run

@FilipLaurentiu FilipLaurentiu requested a review from a team as a code owner February 11, 2026 15:53
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Feb 11, 2026

Greptile Overview

Greptile Summary

Changed Schnorr signature implementation from non-standard to standard cryptographic convention by modifying public key generation from $h = g^{-k}$ to $h = g^{k}$ and updating verification accordingly.

  • Changed get_public_key() to compute g^k instead of g^{-k}, aligning with standard Schnorr protocol (consistent with FROST implementation in this codebase)
  • Updated verify_signature() to use h^{-e} instead of h^e to maintain mathematical correctness
  • Added use std::ops::Neg import for negation operation
  • Updated README documentation to reflect standard formulas
  • Fixed typo in comment ("the the" → "the")

The change is mathematically sound and makes the implementation consistent with widely-accepted cryptographic standards and other implementations in the repository.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes correctly convert a non-standard but mathematically valid Schnorr signature implementation to the standard cryptographic convention. Both the old and new implementations are mathematically correct, but the new version aligns with widely-accepted standards and the repository's own FROST implementation. The mathematical transformation is sound, documentation is updated accordingly, and existing tests validate correctness.
  • No files require special attention

Important Files Changed

Filename Overview
examples/schnorr-signature/src/schnorr_signature.rs Changed public key generation from g^{-k} to standard g^{k} and updated verification to use h^{-e} instead of h^e, aligning with cryptographic standards
examples/schnorr-signature/README.md Updated documentation to reflect standard Schnorr signature scheme formulas for public key and verification steps

@FilipLaurentiu FilipLaurentiu marked this pull request as draft February 12, 2026 07:35
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.

1 participant