In order to compute the Hamming distance between 2 polynomials a and b, we can encode one of those polynomials in the reverse order and then use polynomial multiplication to obtain the Hamming distance.
Let a_vec and b_vec be the 2 input vectors and we want to compute their Hamming distance. Assume their length is the same, and it is equal to SIZE.
[ ] Reverse the order of vector elements from b_vec (the choice of second input instead of first is arbitrary).
[ ] Encode both vectors as usual into cyclotomic polynomials.
[ ] Polynomial multiplication gives another polynomial whose coefficient at position SIZE is the Hamming distance.
This is an exploration of bit extraction.
In order to compute the Hamming distance between 2 polynomials
a
andb
, we can encode one of those polynomials in the reverse order and then use polynomial multiplication to obtain the Hamming distance.Let
a_vec
andb_vec
be the 2 input vectors and we want to compute their Hamming distance. Assume their length is the same, and it is equal toSIZE
.b_vec
(the choice of second input instead of first is arbitrary).SIZE
is the Hamming distance.