Skip to content
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

XDC-01 | Potential Missed Fixings in crypto Module #398

Merged
merged 5 commits into from Jan 22, 2024
Merged

Conversation

wgr523
Copy link
Collaborator

@wgr523 wgr523 commented Jan 18, 2024

Proposed changes

In go-ethereum, there is a list of edge cases or compilation-related issues fixed in the crypto module:

crypto/secp256k1: add checking z sign in affineFromJacobian
crypto: added checks for nil pointers in Marshal functions
crypto/bn256: improve bn256 fuzzer
crypto/cloudflare/bn256: fix in-place addition and unmarshalling
crypto/bn256/cloudflare: fix asm for dynamic linking

We fix these known issues to improve the robustness of the system.

Types of changes

What types of changes does your code introduce to XDC network?
Put an in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Regular KTLO or any of the maintaince work. e.g code style
  • CICD Improvement

Impacted Components

Which part of the codebase this PR will touch base on,

Put an in the boxes that apply

  • Consensus
  • Account
  • Network
  • Geth
  • Smart Contract
  • External components
  • Not sure (Please specify below)

Checklist

Put an in the boxes once you have confirmed below actions (or provide reasons on not doing so) that

  • This PR has sufficient test coverage (unit/integration test) OR I have provided reason in the PR description for not having test coverage
  • Provide an end-to-end test plan in the PR description on how to manually test it on the devnet/testnet.
  • Tested the backwards compatibility.
  • Tested with XDC nodes running this version co-exist with those running the previous version.
  • Relevant documentation has been updated as part of this PR
  • N/A

hbakhtiyor and others added 5 commits January 18, 2024 21:56
…#18419)

The z == 0 check is hit whenever we Add two points with the same x1/x2
coordinate. crypto/elliptic uses the same check in their affineFromJacobian
function. This change does not affect block processing or tx signature verification
in any way, because it does not use the Add or Double methods.
…ethereum#19609)

* Added checks for nil pointers in Marshal functions

* Set nil pointer to identity in GT before marshaling
* crypto/cloudflare: fix nil deref in random G1/G2 reading

* crypto/bn256: improve fuzzer

* crypto/bn256: fix some flaws in fuzzer
When using -buildmode=shared, R15 is clobbered by a global variable
access; use a different register instead.

Fixes: ethereum#24439
@wgr523 wgr523 changed the base branch from master to dev-upgrade January 18, 2024 14:02
@liam-lai liam-lai merged commit 513114d into dev-upgrade Jan 22, 2024
2 checks passed
@liam-lai liam-lai deleted the XDC-01 branch January 22, 2024 06:53
@liam-lai liam-lai mentioned this pull request Feb 4, 2024
19 tasks
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.

None yet

8 participants