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

runtime-sdk: Add support for secp256r1 #1436

Merged
merged 2 commits into from
Aug 9, 2023
Merged

Conversation

kostko
Copy link
Member

@kostko kostko commented Aug 7, 2023

Fixes #1417

  • runtime-sdk: Add support for secp256r1
  • runtime-sdk/modules/evm: Adjust mispriced gas costs

@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Merging #1436 (6fb425c) into main (c5f319f) will increase coverage by 0.00%.
The diff coverage is 64.28%.

@@           Coverage Diff            @@
##             main    #1436    +/-   ##
========================================
  Coverage   57.54%   57.55%            
========================================
  Files         134      135     +1     
  Lines        9636     9741   +105     
========================================
+ Hits         5545     5606    +61     
- Misses       4049     4093    +44     
  Partials       42       42            
Files Changed Coverage Δ
...-sdk/modules/evm/src/precompile/standard/simple.rs 82.53% <ø> (ø)
runtime-sdk/src/crypto/signature/digests.rs 20.51% <0.00%> (-2.35%) ⬇️
runtime-sdk/src/crypto/signature/secp256r1.rs 48.48% <48.48%> (ø)
runtime-sdk/src/crypto/signature/mod.rs 71.87% <73.07%> (+0.97%) ⬆️
...ime-sdk/modules/evm/src/precompile/confidential.rs 81.31% <100.00%> (+0.97%) ⬆️

for byte in &[context, message] {
<Sha512_256 as Digest>::update(&mut digest, byte);
}
let sig = ecdsa::Signature::from_der(signature.0.as_ref())
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let sig = ecdsa::Signature::from_der(signature.0.as_ref())
self.verify_digest(digest, signature)

Copy link
Contributor

Choose a reason for hiding this comment

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

Could remove some duplicate code, but not needed, to be inline with k1.

@kostko kostko enabled auto-merge August 9, 2023 08:11
@kostko kostko merged commit ad5335a into main Aug 9, 2023
27 checks passed
@kostko kostko deleted the kostko/feature/secp256r1 branch August 9, 2023 08:40
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.

EVM: add SEC P256 R1 family to generation, signing & verification
2 participants