Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Bug Fixes in 0.2

This chapter lists all bugs of the 0.1 releases that are fixed in 0.2. Fixes marked with behavior change change the output of a function without changing its signature. The compiler will not point you to them, so check your code for these functions.

qFALL-math

  • Behavior change: Zq::get_representative_least_absolute_residue returned the absolute value of the least absolute residue instead of the residue itself. For example, 15 mod 17 was mapped to 2 instead of -2. The function now returns values in [-⌊q/2⌋, ⌊q/2⌋] as documented.
  • Behavior change: MatZq::sample_discrete_gauss, MatZq::sample_binomial, and MatZq::sample_binomial_with_offset did not reduce the sampled values modulo q before storing them. For example, MatZq::sample_discrete_gauss(1, 1, 3, 0, 15.0) could return [[-1]] mod 3 or [[5]] mod 3. Such matrices printed, compared, and computed with values outside of [0, q), which could lead to wrong results in subsequent operations. All entries are now reduced to [0, q).
  • MatZq::clone leaked the memory of the entries of the freshly allocated matrix, as the clone re-initialized them instead of overwriting them. This issue is fixed by clearing the allocated memory before cloning the entries.
  • PolyOverZq::clone converted the polynomial into a string and parsed it again. Now, it copies the FLINT structure directly and avoids this costly detour.
  • qfall-math 0.1.0 failed to compile once rand 0.10 was released, as it required rand = "0". qfall-math 0.1.1 adapted to the breaking changes of rand 0.10, and 0.2 requires specific minor versions of all its dependencies due to further breaks of SemVer rules from dependencies.

qFALL-tools

  • qfall-tools 0.1.0 required qfall-math = "0", sha2 = "0", and typetag = "0", i.e. any 0.x version. New releases of these dependencies with breaking changes could therefore break the build. qfall-tools 0.2 requires qfall-math = "0.2", sha2 = "0.11", and typetag = "0.2" to protect against breaking changes of these crates.

qFALL-schemes

  • qfall-schemes 0.1.0 failed to build with recent releases of sha2, as the computed hash no longer implemented hexadecimal formatting via {:x}. The SHA-256 based hash functions in qfall_schemes::hash assemble the hex string manually since 0.1.1. The output is unchanged.
  • Like qfall-tools, the crate pins the minor versions of all its dependencies since 0.2.