  The notion of branch numbers of a linear transformation is crucial for both
linear and differential cryptanalysis. The number of non-zero elements in a
state difference or linear mask directly correlates with the active S-Boxes.
The differential or linear branch number indicates the minimum number of active
S-Boxes in two consecutive rounds of an SPN cipher, specifically for
differential or linear cryptanalysis, respectively. This paper presents a new
algorithm for computing the branch number of non-singular matrices over finite
fields. The algorithm is based on the existing classical method but
demonstrates improved computational complexity compared to its predecessor. We
conduct a comparative study of the proposed algorithm and the classical
approach, providing an analytical estimation of the algorithm's complexity. Our
analysis reveals that the computational complexity of our algorithm is the
square root of that of the classical approach.
