-
Notifications
You must be signed in to change notification settings - Fork 4
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
crypto: add ecdsa malleability checks #21
Conversation
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
.url = "https://github.com/jsign/zig-eth-secp256k1/archive/refs/tags/v0.1.0-beta-3.tar.gz", | ||
.hash = "1220fcf062f8ee89b343e1588ac3cc002f37ee3f72841dd7f9493d9c09acad7915a3", | ||
.url = "https://github.com/jsign/zig-eth-secp256k1/archive/refs/tags/v0.1.0-beta-4.tar.gz", | ||
.hash = "1220c2dbdc5ddd85906c8858f2046b52870f4fe793e0c9af50b8591d10a3f267e250", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to do some update in my dep, so updating here.
pub fn validateSignatureFields(r: u256, s: u256) !void { | ||
if (r > secp256k1.Secp256k1.order) { | ||
return error.InvalidR; | ||
} | ||
// Malleability check. | ||
if (s > secp256k1.Secp256k1.order / 2) { | ||
return error.InvalidS; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the important checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* types: add receipt structs Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * types/receipt: add logs bloom calculation Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * blockchain: add receipt generation Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> --------- Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
This PR should be reviewed/merged after #20
This PR adds the check to solve the ECDSA malleability problem.