-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement keccak256 operator and softfork (#489)
* fixup the new-operator checklist * add keccak256 operator and corresponding soft-fork * keccak fuzzer * Fix test cases after rebase * Add comments explaining the situation * node.js 18 --------- Co-authored-by: arvidn <[email protected]>
- Loading branch information
Showing
18 changed files
with
1,901 additions
and
63 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#![no_main] | ||
use clvmr::keccak256_ops::op_keccak256; | ||
use clvmr::{reduction::Reduction, Allocator, NodePtr}; | ||
use libfuzzer_sys::fuzz_target; | ||
|
||
fuzz_target!(|data: &[u8]| { | ||
let mut a = Allocator::new(); | ||
let blob = a.new_atom(data).expect("failed to create atom"); | ||
let args = a | ||
.new_pair(blob, NodePtr::NIL) | ||
.expect("failed to create pair"); | ||
let Reduction(cost, node) = op_keccak256(&mut a, args, 11000000000).expect("keccak256 failed"); | ||
assert!(cost >= 210); | ||
assert!(node.is_atom()); | ||
assert_eq!(a.atom_len(node), 32); | ||
}); |
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
Oops, something went wrong.