In order to try to simplify or alternatively express cryptographic functions I wonder if the modulo function can be alternatively expressed. Could for example a Fourier series of a sawtooth wave or its discretization be useful? What would that look like for a given range and precision?

  • 2
    $\begingroup$ When the modulus is a power of two, $x\bmod n$ reduces to $x\&(n-1)$, where $\&$ is bitwise AND. That generalizes to $n$ of the form $b^k$, by expressing $x$ in base $b$ and keeping the $k$ low-order digits. That applies to any $n$ by expressing $x$ in base $n$, but is not much useful. $\endgroup$
    – fgrieu
    Commented Jun 3, 2022 at 9:47
  • $\begingroup$ do you mean the function $x \mapsto x \pmod n,$ for some $n$? If yes, the above comment answers it. $\endgroup$
    – kodlu
    Commented Jun 3, 2022 at 11:44
  • 1
    $\begingroup$ how you approximate it also depends on the application, there is a paper eprint.iacr.org/2021/572.pdf that approximates the mod function based on sine series but it needs to use complex number arithmetic $\endgroup$
    – lamba
    Commented Jun 8, 2022 at 8:36


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.