def METHOD_NAME(self, m, leaves, complete_subtree):
    """SUBPROOF, see RFC6962 section 2.1.2."""
    n = len(leaves)
    if m == n or n == 1:
        if complete_subtree:
            return []
        else:
            return [self.__hasher.hash_full_tree(leaves)]
    k = _down_to_power_of_two(n)
    if m <= k:
        node = self.__hasher.hash_full_tree(leaves[k:n])
        res = self.METHOD_NAME(m, leaves[0:k], complete_subtree)
    else:
        # m > k
        node = self.__hasher.hash_full_tree(leaves[0:k])
        res = self.METHOD_NAME(m - k, leaves[k:n], False)
    res.append(node)
    return res