Lune

CCS2020Top-tier venue

A Performant, Misuse-Resistant API for Primality Testing

Jake Massimo, Kenneth G. Paterson

Abstract

Primality testing is a basic cryptographic task. But developers today are faced with complex APIs for primality testing, along with documentation that fails to clearly state the reliability of the tests being performed. This leads to the APIs being incorrectly used in practice, with potentially disastrous consequences. In an effort to overcome this, we present a primality test having a simplest-possible API: the test accepts a number to be tested and returns a Boolean indicating whether the input was composite or probably prime. For all inputs, the output is guaranteed to be correct with probability at least 1 - 2-128. The test is performant: on random, odd, 1024-bit inputs, it is faster than the default test used in OpenSSL by 17%. We investigate the impact of our new test on the cost of random prime generation, a key use case for primality testing. The OpenSSL developers have adopted our suggestions in full; our new API and primality test are scheduled for release in OpenSSL 3.0.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Victory by KO: Attacking OpenPGP Using Key Overwriting cites Prime and Prejudice: Primality Testing Under Adversarial Conditions
  • Why Do Developers Get Password Storage Wrong?: A Qualitative Usability Study cites Comparing the Usability of Cryptographic APIs
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. Victory by KO: Attacking OpenPGP Using Key OverwritingLara Bruseghini, Daniel Huigens, Kenneth G. PatersonCCS 2022 · 6 citations

Builds on4

  1. Comparing the Usability of Cryptographic APIsYasemin Acar, Michael Backes, Sascha Fahl, Simson L. Garfinkel et al.S&P 2017 · 261 citations
  2. Why Do Developers Get Password Storage Wrong?: A Qualitative Usability StudyAlena Naiakshina, Anastasia Danilova, Christian Tiefenau, Marco Herzog et al.CCS 2017 · 146 citations
  3. Prime and Prejudice: Primality Testing Under Adversarial ConditionsMartin R. Albrecht, Jake Massimo, Kenneth G. Paterson, Juraj SomorovskyCCS 2018 · 21 citations
  4. Partially Specified Channels: The TLS 1.3 Record Layer without ElisionChristopher Patton, Thomas ShrimptonCCS 2018 · 11 citations

Related papers

  1. The Secure Socket API: TLS as an Operating System ServiceMark O'Neill, Scott Heidbrink, Jordan Whitehead, Tanner Perdue et al.USENIX Security 2018 · 20 citations
  2. Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without CompromisesAndres Erbsen, Jade Philipoom, Jason Gross, Robert Sloan et al.S&P 2019 · 147 citations
  3. HACL*: A Verified Modern Cryptographic LibraryJean Karim Zinzindohoué, Karthikeyan Bhargavan, Jonathan Protzenko, Benjamin BeurdoucheCCS 2017 · 258 citations
  4. "I'm Pretty Expert and I Still Screw It Up": Qualitative Insights into Experiences and Challenges of Designing and Implementing Cryptographic Library APIsJuliane Schmüser, Philip Klostermeyer, Kay Friedrich, Sascha FahlS&P 2025
  5. Secure Distributed RSA Modulus Generation Revisited: A Faster and More Communication-Efficient ConstructionShaojing Zhang, Chengliang Tian, Ruixue Wang, Hequn Xian et al.USENIX Security 2026
Dusk over the sea between two cliffs drawn in fine vertical lines