コード例 #1
0
 def test_for_non2power(self, _):
     # Setup
     inst = HashTree(ISD_AS("1-11"), "if_ids", "seed", 1, HashType.SHA256)
     # Call
     inst.calc_tree_depth(6)
     # Tests
     ntools.eq_(inst._depth, 3)
コード例 #2
0
 def test_for_2power(self, _):
     # Setup
     if_ids = [1, 2, 3, 4]
     seed = b"abc"
     inst = HashTree(ISD_AS("1-11"), if_ids, seed, 1, HashType.SHA256)
     # Call
     inst.calc_tree_depth(8)
     # Tests
     ntools.eq_(inst._depth, 3)