Skip to content

fix: correct integer comparison - #147

Merged
lescuer97 merged 1 commit into
elnosh:mainfrom
lescuer97:fix_integer_compare
Aug 13, 2025
Merged

fix: correct integer comparison#147
lescuer97 merged 1 commit into
elnosh:mainfrom
lescuer97:fix_integer_compare

Conversation

@lescuer97

Copy link
Copy Markdown
Collaborator

Fix the integer representation compare values. Before it was just comparing memory addresses this is clearly wrong

@lescuer97
lescuer97 requested a review from elnosh August 12, 2025 22:43
@lescuer97
lescuer97 merged commit c0aac85 into elnosh:main Aug 13, 2025
4 checks passed
Amperstrand added a commit to OpenTollGate/gonuts-tollgate that referenced this pull request Jul 25, 2026
…n) (#8)

Replaces SHA-256 hash approach for V2 keyset ID derivation with
math/big.Int based keysetIdToBigInt() from elnosh/gonuts upstream
(lescur97's PRs elnosh#146, elnosh#147). The big.Int approach is cleaner, handles
arbitrary-length IDs without overflow risk, and supports both hex and
base64 keyset ID formats.

Adds CheckCollidingKeysets() to detect keyset ID collisions after modulo
reduction — prevents two different keyset IDs from mapping to the same
BIP32 derivation path.

Adopted from: elnosh#146
             elnosh#147

6 new tests: V2 keyset derivation, hex/base64 parsing, collision detection.

Co-authored-by: Amperstrand <amperstrand@localhost>
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