Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function validProof(bytes proof, bytes32 root, bytes32 hash) constant returns (bool) {
- bytes32 el;
- for (uint256 i = 32; i <= proof.length; i += 32) {
- assembly {
- el := mload(add(proof, i))
- }
- if (hash < el) {
- hash = sha3(hash, el);
- } else {
- hash = sha3(el, hash);
- }
- }
- return hash == root;
- }
Add Comment
Please, Sign In to add comment