
Public-key cryptosystems based on logarithms and knapsacks 139
sage: s = matrix([[114, 171, 399, 1425, 619, 603, 1092, 283]])
sage: S = 3030
sage: n = len(s.row(0))
sage: M = block_matrix([2*identity_matrix(n),transpose(s),\
matrix([[1 for i in range(n)]]),matrix([[S]])],\
subdivide=false)
Now a lattice reduction algorithm can be applied to this matrix; a standard
algorithm is that developed by Lenstr a, Lenstra and Lov´asz [55], and hence
known as the LLL lattice reduct ion algorithm that can be called in Sage a s
sage: ML = M.LLL(); ML
and the reduced matrix is
−1 1 −1 −1 1 1 −1 1 0
2 0 −2 0 0 0 0 2 −2
−1 −1 1 1 −1 3 −1 −1 0
−2 −2 0 0 0 0