Skip to content

PeerID Spec Conformance #22

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

Merged
merged 6 commits into from
Mar 5, 2025
Merged

PeerID Spec Conformance #22

merged 6 commits into from
Mar 5, 2025

Conversation

btoms20
Copy link
Member

@btoms20 btoms20 commented Mar 5, 2025

What:

  • This PR brings swift-crypto into compliance with the Libp2p PeerID Spec.

Changes:

  • When unmarshalling a ED25519 Private Key, we support the multiple formatting cases laid out in the spec
  • When parsing a Secp256k1 Public Key, we now support the 5 different key formats
    • even, odd, uncompressed, even hybrid and odd hybrid
    • previously we only supported uncompressed 64 byte public keys
  • Added support for compressing a Secp256k1 Public Key
  • When marshalling a Secp256k1 Public Key we used the compressed (32 byte) version
  • General code clean up

Tests:

  • Added the test vectors outlined in the Spec

@btoms20 btoms20 added the dependency-check Tests direct dependents for breaking changes label Mar 5, 2025
@btoms20 btoms20 merged commit f3f1c27 into main Mar 5, 2025
25 of 26 checks passed
@btoms20 btoms20 deleted the secp256+compressed branch March 5, 2025 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency-check Tests direct dependents for breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant