hiero-ledger / hiero-ledger/hiero-consensus-node
Avoid byte array copies when verifying signatures
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
`EcdsaSecp256k1VerificationProvider.handleItem()` and `Ed25519VerificationProvider.handleItem()` convert `Bytes` provided in `TransactionSignature` to byte arrays required by native signature verification libraries.
To avoid byte array copies, an approach similar to one used in `CryptoStatic.verifySignature()` should be considered: delegate calling actual signature verification to Bytes preserving its immutability and avoiding exposing its internal `byte[]`.
See also #18146.
Contributor guide
Research direction
Start with EcdsaSecp256k1VerificationProvider.handleItem() and Ed25519VerificationProvider.handleItem(), then compare their byte-array conversion with CryptoStatic.verifySignature(). The work is done when signature verification delegates through Bytes without exposing its internal byte[] or making unnecessary copies, while preserving existing verification behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- cryptography
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100