实现Goppa码的生成多项式时遇到问题
H=matrix([[codelocators[j]^(i) for j in range(N)] for i in range(N-K)])
H=H*diagonal_matrix([1/g(codelocators[i]) for i in range(N)])
H_Goppa = matrix(F,m*H.nrows(),H.ncols())
for i in range(H.nrows()):
for j in range(H.ncols()):
be = bin(eval(H[i,j].int_repr()))[2:];
be = '0'*(m-len(be))+be;
be = list(be);
H_Goppa[m*i:m*(i+1),j]=vector(map(int,be));
Krnl = H_Goppa.right_kernel();
G = Krnl.basis_matrix();
G
def encode(u):
return u*G;
但是考虑到,该代码的校验子应等于零的属性不起作用。 预先感谢