Constant Time Miller-Rabin Test Added To Finite Field Arithmetic

Stanislav Datskovskiy (WOT: asciilifeform) has published code that adds a constant time implementation of the Miller-Rabin primality test to his Finite Field Arithmetic library as chapter 16A. He will publish a proof his algorithm implements Miller-Rabin and a discussion of the statistics informing proper use of the Miller-Rabin in the field as chapter 16B.

In his genesis of the FFA library Datskovskiy laid out his mission of creating a auditable bignum library whose entire operation is accessible to literate readers while avoiding optimization traps that add complexity or deviate from constant time operation opening up side channels that leak information intended to be kept secret. In the case of Werner Koch's MPI versus FFA, Datskovskiy's constant time implementation actually outperforms the optimized, variable time, legacy Koch library in in modular exponentiation.

At present FFA consists of 4013 non-empty lines of code in the libffa library of which 1835 are comments and 1047 non-empty lines of code in the accompanying ffacalc interface to the library of which 390 are comments.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>