Guest User

Untitled

a guest
Nov 22nd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. function validProof(bytes proof, bytes32 root, bytes32 hash) constant returns (bool) {
  2. bytes32 el;
  3.  
  4. for (uint256 i = 32; i <= proof.length; i += 32) {
  5. assembly {
  6. el := mload(add(proof, i))
  7. }
  8.  
  9. if (hash < el) {
  10. hash = sha3(hash, el);
  11. } else {
  12. hash = sha3(el, hash);
  13. }
  14. }
  15. return hash == root;
  16. }
Add Comment
Please, Sign In to add comment