Closed Pro7ech closed 2 months ago
good catch, yes agreed, we should remove the vector sizes from vec_znx_normalize_base2k_tmp_bytes
, it can take only the module as argument.
IMO, normalization is also almost never time-critical, so we could even maybe expose a variant without tmp, that do non-sequential memory accesses.
The library offers two ways to normalize a Base2K vector:
Both require a buffer to store the carry, but
znx_normalize
takes an array ofint64
, expected to be of sizeN
, whilevec_znx_normalize_base2k
requires an array ofbyte
, which expected to be of sizeN*sizeof(int64_t)
, so the same size.Everything seems to indicate that the type of these buffers could be uniformized. Is there a reason for the difference between the argument types between those two functions?
Additionally, vec_znx_normalize_base2k_tmp_bytes_ref takes two arguments, which if I understand are supposed to be the number of limbs of the input and output vectors, but these have no effect on its output since it always returns
N*size_of(int64_t)
.action-items
vec_znx_normalize_base2k_tmp_bytes_ref
vec_znx_big_normalize_base2k_tmp_bytes
vec_znx_big_range_normalize_base2k_tmp_bytes