-
Notifications
You must be signed in to change notification settings - Fork 389
Fix/ecdsa err Fix #344 #345
Conversation
tx_circuit_2tx_2max_tx failed? is it expected? |
@@ -0,0 +1 @@ | |||
pub(crate) const DEGREE: usize = 19; |
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.
is this change needed?
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.
fixed with 89fafcd
let pk_hash = keccak(&sign_data); | ||
let address = pk_hash.to_address(); | ||
assert_eq!(address, tx.caller_address); | ||
} |
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.
suggest change to log::error! so the test tx_circuit_bad_address will not panic
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.
fixed with 89fafcd
because of the assertion
shall we keep this check and return an error instead, or remove this check? @kunxian-xia |
@kunxian-xia can you have another check of tx_circuit_2tx_2max_tx? strange.. |
seems like |
let (_pk, _, address) = ecdsa_chip.range.gate.inner_product( | ||
ctx, | ||
&powers_of_256_cells[0..20].to_vec(), | ||
&pk_hash_cells[12..].to_vec(), |
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.
pk_hash_cells
is in little endian order?
.into_iter() | ||
.enumerate() | ||
.filter(|(idx, _)| { | ||
// each sign_data produce two inputs for hashing |
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.
cool! and LGTM!
Description
[PR description]
#344
[link issue here]
Type of change
Contents
Rationale
[design decisions and extended information]
How Has This Been Tested?
How to fill a PR description
Please give a concise description of your PR.
The target readers could be future developers, reviewers, and auditors. By reading your description, they should easily understand the changes proposed in this pull request.
MUST: Reference the issue to resolve
Single responsability
Is RECOMMENDED to create single responsibility commits, but not mandatory.
Anyway, you MUST enumerate the changes in a unitary way, e.g.
Design choices
RECOMMENDED to: