djbsort: Intro

djbsort is a software library for sorting arrays of int32 or uint32 or float32 or int64 or uint64 or float64. It provides the following features:

These features are not separate options: there is unified code providing all of these features simultaneously, rather than separate sort_fast and sort_secure and sort_verified functions.

Latest release: 20260127.

Limitations

Interface limitations:

Speed limitations:

Verification limitations:

Credits

The djbsort author is Daniel J. Bernstein.

djbsort builds upon results from the following paper: Daniel J. Bernstein, Chitchanok Chuengsatiansup, Tanja Lange, Christine van Vredendaal, "NTRU Prime: reducing attack surface at low cost", Selected Areas in Cryptography 2017. The NTRU Prime paper explained how to make constant-time sorting software run faster than Intel's Integrated Performance Primitives sorting software on Intel CPUs, and demonstrated this with a software release in 2017. djbsort includes verification and provides another 4x speedup.

See the list of references for related work.


Version: This is version 2026.01.26 of the "Intro" web page.