-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* prover: keccak: fix tests Reduce the expected value by BN254 group order, because the circuit does the same. The expected value had just byte order adjusted, but it wasn't reduced modulo that big number, so the results didn't match and all tests failed. Signed-off-by: Wojciech Zmuda <[email protected]> * prover: keccak: account for domain separator size The length of the padded message did not consider size of the domain separation sequence. For input messages length close to the block size (i.e. 1080-1088 bits) the padding size was calculated to be 1088. Writing domain separator resulted in out of bounds write. Adjust padding size, so that input of size close to block size results in extending the message by the length of another block size, leaving room for the domain separator. Rename variable paddingSize to paddedSize, as this variable reflects the size of the input after size adjustments, not just the size of the padding. Signed-off-by: Wojciech Zmuda <[email protected]> --------- Signed-off-by: Wojciech Zmuda <[email protected]>
- Loading branch information
Showing
2 changed files
with
51 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters