Abstract
Program generation allows us to produce high-performance code specialized to each application domain. Although it has had great success in various domains, it remains to be seen whether it is effective for cryptography, where the correctness of programs is indispensable.This work presents a unified approach to program generation, analysis, and verification. Our target is Number-Theoretic Transform (NTT), a key building block of several candidates in Post Quantum Cryptography. We developed a program-generation framework based on the typed tagless-final style, and obtained highly efficient implementations with vector instructions such as AVX2 and AVX-512. The framework allows us to implement a program analyzer for integer-overflow analysis. By combining a brute-force analysis with the standard static interval analysis, we have obtained more precise results than the state-of-the-art static analyzer, which let us find a new optimization.We have verified the generated program using the framework. While verifying the generated program all at once is intractable, we can separately verify the low-level components and the high-level algorithm, thanks to the compositional nature of our program generator. We have used an SMT solver for the former and a custom symbolic interpreter for the latter to prove the functional correctness of the generated program successfully.
Published Version
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have