Skip to content

Conversation

@turuslan
Copy link
Contributor

  • secp256k1 compact signature of keccak hash for ENR.
  • SamplePeer accepts ip

@turuslan turuslan requested a review from kamilsa October 22, 2025 08:25
@kamilsa kamilsa requested a review from Copilot October 22, 2025 08:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements Keccak hashing support and enhances secp256k1 signing capabilities to support Ethereum Name Record (ENR) operations. The main changes enable compact signature generation using keccak256 hashes instead of SHA-256.

Key Changes:

  • Added Keccak-256 hash implementation for ENR compatibility
  • Extended secp256k1 provider to support compact signatures with prehashed data
  • Refactored SamplePeer to accept custom IP addresses and extract key generation logic

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/crypto/sha/keccak.cpp Implements Keccak-256 hashing algorithm with incremental update and finalize methods
src/crypto/sha/CMakeLists.txt Adds keccak.cpp to the build configuration
include/libp2p/crypto/sha/keccak.hpp Declares Keccak class interface with hash operations
include/libp2p/crypto/secp256k1_types.hpp Adds type definitions for compact signatures and prehashed data
include/libp2p/crypto/secp256k1_provider.hpp Extends interface with signCompact and verifyCompact methods
include/libp2p/crypto/secp256k1_provider/secp256k1_provider_impl.hpp Declares implementation of new signing methods and internal helper functions
src/crypto/secp256k1_provider/secp256k1_provider_impl.cpp Refactors signing/verification to support both standard and compact signatures with prehashed input
include/libp2p/common/sample_peer.hpp Refactors to extract keypair/port generation and adds IP address parameter support

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@turuslan turuslan merged commit c4fff47 into main Oct 22, 2025
2 checks passed
@turuslan turuslan deleted the sample branch October 22, 2025 08:58
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.

3 participants