OpenZeppelin / OpenZeppelin/openzeppelin-contracts

Addition of an RSA validation optimization

Open
#6,299 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Solidity
Stars
27.2k
Forks
12.4k
Avg merge
2d 19h
Merged PRs (30d)
33

Description

🧐 Motivation
I replaced my SolRsaVerify library with the OpenZeppelin library. After replacing it there was no optimization equivalent in the OpenZeppelin version. Could you add this feature to the OpenZeppelin library? The difference is ~2,300 gas units on a RSA-2048 signature validation.

https://github.com/adria0/SolRsaVerify/blob/master/src/RsaVerifyOptimized.sol

📝 Details
Add an additional method to the RSA.sol named pkcs1Sha256Optimized with an identical interface but optimized gas.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the RSA.sol implementation and compare its pkcs1Sha256 method with the linked SolRsaVerifyOptimized.sol reference. Trace the existing RSA validation interface and determine how the proposed pkcs1Sha256Optimized method should preserve behavior while reducing gas for RSA-2048 validation; done means the method is added with the requested interface and optimization.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
blockchain, cryptography, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.