def recompute_root_hash(self): self.root_hash = setmac.kvhash(self.key3, self.counter, None if not self.root else self.root.mac).encode("hex")
def check_root(self): computed_hash = setmac.kvhash(self.key3, self.counter, None if not self.root else self.root.mac).encode("hex") assert(computed_hash == self.root_hash)