Gram Schmidt Cryptohack 2021

The formula:

: CryptoHack Lattices - Direct link to the "Gram Schmidt" task. gram schmidt cryptohack

Classical Gram–Schmidt is a reduction algorithm by itself — it changes the subspace (in exact arithmetic it preserves the span, but in floating-point it’s unstable, and in lattices it doesn’t preserve the integer lattice). In lattice crypto, we never replace the original basis with its Gram–Schmidt basis (that would generally leave the lattice). Instead, we use the Gram–Schmidt lengths ( |\mathbfv_i^*| ) as a theoretical tool to bound the quality of a basis. The formula: : CryptoHack Lattices - Direct link

basis = [[1,2], [3,4]] orthogonal = gram_schmidt(basis) for u in orthogonal: print([float(x) for x in u]) # For readability # But submit as Fractions: (Fraction(1,1), Fraction(2,1)) # and (Fraction(4,5), Fraction(-2,5)) but in floating-point it’s unstable