GF256 = galois.GF(2**8)
A=GF256(matrix)
np.linalg.matrix_rank(A)
print('np.linalg.matrix_rank(A):',np.linalg.matrix_rank(A))
def is_all_sub_inverse(m, r, k):
subs = combinations(range(k), r)
num_subm=0
for idx in subs:
subm = m[:, idx]
GF4=galois.GF(2**2) # 4
subm=GF4(subm)
matrix_rank=np.linalg.matrix_rank(subm)
print('np.linalg.matrix_rank(subm):',matrix_rank)
if matrix_rank < 3:
print('False subm',subm)
return False
print('num_subm',num_subm)
return True