Question Decrypt Bob's response e
Let where Remember, in this ring, we work
modulo the polynomial or equivalently, with the relation that
For any modulus not necessarily prime we denote by
so in other words, we reduce the coefficients modulo
and keep the same relation on We do not assume are prime below
unless otherwise stated. Finally, we let denotes the set of
which have coefficients equal to coefficients equal to and the re
maining coefficients are equal to As an example, when
and for
def encodes:
s strs
if lens:
printError string too long.
return
return sumordsi i for i in rangelens
def decoden:
n intn
v
while n :
vappendchrn
n
return joinv
q
f
g
h modfqmodgq
e
e
##### EXAMPLE CODE FOR GAUSSIAN LATTICE BASIS REDUCTION ########
# In this code I will reduce the lattice
# L kh lq : kl in Z
# It is important call h an Integer so that
# Sage does not do modular arithmetic here
v vector