Loading…
Attending this event?
View analytic
Wednesday, September 26 • 15:50 - 16:20
Multi-Precision Arithmetic for Cryptology in C++, at Run-Time and at Compile-Time

Sign up or log in to save this to your schedule and see who's attending!

In the talk, I will present a new C++17 library for multi-precision arithmetic for integers in the order of 100--500 bits. Many cryptographic schemes and applications, like elliptic-curve encryption schemes and secure multiparty computation frameworks require multiprecision arithmetic with integers whose bit-lengths lie in that range.

The library is written in “optimizing-compiler-friendly” C++, with an emphasis on the use of fixed-size arrays and particular function-argument-passing styles (including the avoidance of naked pointers) to allow the limbs to be allocated on the stack or even in registers. Depending on the particular functionality, we get close to, or significantly beat the performance of existing libraries for multiprecision arithmetic that employ hand-optimized assembly code.

Beyond the favorable runtime performance, our library is, to the best of the author’s knowledge, the first library that offers big-integer computations during compile-time. For example, when implementing finite-field arithmetic with a fixed modulus, this feature enables the automatic precomputation (at compile time) of the special modulus- dependent constants required for Barrett and Montgomery reduction. Another application is to parse (at compile-time) a base-10-encoded big-integer literal.

In this talk, I will focus on several Modern C++ language features that I've used to write the library and design its API (e.g., std::array, variadic templates, std::integer_sequence, constexpr, user-defined literals, using-declarations and decltype, and combinations thereof) and explain some "tricks" that I've discovered while writing the library, for example, a technique to enforce the compile-time evaluation of a constexpr-function. Also, I plan to give a small demo of the API, show some benchmarks, and will demonstrate that the integer types offered by the library compose well with STL containers or other libraries (like Eigen for matrix/linear algebra operations).

The library is on Github (Apache 2 licensed)
https://github.com/niekbouman/ctbignum

Speakers
NJ

Niek J. Bouman

Researcher Secure Multiparty Computation, University of Technology Eindhoven
2017 - now Postdoc TU/e SODA (Scalable Oblivious Data Mining) project, Eindhoven University of Technology, the Netherlands 2016-2017 Senior Researcher Fraud Detection @ ABN AMRO Bank, Amsterdam, the Netherlands 2014-2016 Postdoc at Swiss Federal Institute of Technology (EPFL), Lausanne... Read More →


Wednesday September 26, 2018 15:50 - 16:20
D

Attendees (22)